File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/CollectionRecreateAction.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/EntityInsertAction.java | |||
Method name: void postRecreate()
|
Method name: void postInsert()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | if (postListeners.length > 0) {↵ | |||
2 | PostCollectionRecreateEvent postEvent = new PostCollectionRecreateEvent(↵ | 1 | PostInsertEvent postEvent = new Post↵ | |
3 | getPersister(), getCollection(), ( ↵ | 2 | InsertEvent(↵ | |
3 | getInstance(),↵ | |||
4 | getId(),↵ | |||
5 | state,↵ | |||
6 | getPersister(),↵ | |||
4 | EventSource ) getSession() ↵ | 7 | (EventSource) getSession()↵ | |
5 | );↵ | 8 | );↵ | |
6 | for ( int i = 0; i < postListeners.length; i++ ) {↵ | 9 | for ( int i = 0; i < postListeners.length; i++ ) {↵ | |
7 | postListeners[i].onPostRecreateCollection( postEvent );↵ | 10 | postListeners[i].onPostInsert(postEvent);↵ | |
8 | }↵ | 11 |
| |
9 | } | |||
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | PostCollectionRecreateEvent postEvent = new PostCollectionRecreateEvent(getPersister(), getCollection(), (EventSource)getSession()); |
| 3 | PostInsertEvent postEvent = new PostInsertEvent(getInstance(), getId(), state, getPersister(), (EventSource)getSession()); | |||||||||||||||||||
4 | for (int i = 0; i < postListeners.length; i++) |
| 4 | for (int i = 0; i < postListeners.length; i++) | |||||||||||||||||||
|
| 5 | postListeners[i].onPostInsert(postEvent); | ||||||||||||||||||||
5 | postListeners[i].onPostRecreateCollection(postEvent); |
| |
Row | Violation |
---|---|
1 | Type org.hibernate.event.PostCollectionRecreateEventListener[] of variable postListeners does not match with type org.hibernate.event.PostInsertEventListener[] of variable postListeners |
2 | Unmatched statement postListeners[i].onPostInsert(postEvent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement postListeners[i].onPostRecreateCollection(postEvent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Clone fragment #1 returns variables postEvent, i , while Clone fragment #2 returns variables postEvent, i |