File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/CollectionUpdateAction.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/Junction.java | |||
Method name: void postUpdate()
|
Method name: TypedValue[] getTypedValues(Criteria, CriteriaQuery)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent(↵ | |||
2 | getPersister(), getCollection(), ( EventSource ) getSession() );↵ | 1 | TypedValue[] subvalues = ( (Criterion) iter.next() ).getTypedValues(crit, criteriaQuery);↵ | |
3 | for ( int i = 0; i < postListeners.length; i++ ) {↵ | 2 | for ( int i=0; i<subvalues.length; i++ ) {↵ | |
4 | postListeners[i].onPostUpdateCollection( postEvent );↵ | 3 | typedValues.add( subvalues[i] );↵ | |
5 | } | 4 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent(getPersister(), getCollection(), (EventSource)getSession()); | | ||||||||||||||||
|
| 4 | TypedValue[] subvalues = ((Criterion)iter.next()).getTypedValues(crit, criteriaQuery); | |||||||||||||||
4 | for (int i = 0; i < postListeners.length; i++) |
| 5 | for (int i = 0; i < subvalues.length; i++) | ||||||||||||||
5 | postListeners[i].onPostUpdateCollection(postEvent); |
| | |||||||||||||||
|
| 6 | typedValues.add(subvalues[i]); |
Row | Violation |
---|---|
1 | Unmatched statement TypedValue[] subvalues=((Criterion)iter.next()).getTypedValues(crit,criteriaQuery); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type int of variable postListeners.length does not match with type int of variable subvalues.length |
3 | Unmatched statement postListeners[i].onPostUpdateCollection(postEvent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement typedValues.add(subvalues[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |