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/EntityDeleteAction.java | |||
Method name: void preRecreate()
|
Method name: void postCommitDelete()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | if (preListeners.length > 0) {↵ | |||
2 | PreCollectionRecreateEvent preEvent = new PreCollectionRecreateEvent(↵ | 1 | PostDeleteEvent postEvent = new P↵ | |
3 | getPersister(), getCollection(), ( ↵ | 2 | ostDeleteEvent(↵ | |
3 | getInstance(),↵ | |||
4 | getId(),↵ | |||
5 | state,↵ | |||
6 | getPersister(),↵ | |||
4 | EventSource ) getSession() ↵ | 7 | (EventSource) getSession()↵ | |
5 | );↵ | 8 | );↵ | |
6 | for ( int i = 0; i < preListeners.length; i++ ) {↵ | 9 | for ( int i = 0; i < postListeners.length; i++ ) {↵ | |
7 | preListeners[i].onPreRecreateCollection( preEvent );↵ | 10 | postListeners[i].onPostDelete(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.2 |
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) | 32.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | PreCollectionRecreateEvent preEvent = new PreCollectionRecreateEvent(getPersister(), getCollection(), (EventSource)getSession()); |
| 3 | PostDeleteEvent postEvent = new PostDeleteEvent(getInstance(), getId(), state, getPersister(), (EventSource)getSession()); | ||||||||||||||||||||||||
4 | for (int i = 0; i < preListeners.length; i++) |
| 4 | for (int i = 0; i < postListeners.length; i++) | ||||||||||||||||||||||||
|
| 5 | postListeners[i].onPostDelete(postEvent); | |||||||||||||||||||||||||
5 | preListeners[i].onPreRecreateCollection(preEvent); |
| |
Row | Violation |
---|---|
1 | Expression new PostDeleteEvent(getInstance(),getId(),state,getPersister(),(EventSource)getSession()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new PostDeleteEvent(getInstance(),getId(),state,getPersister(),(EventSource)getSession()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type int of variable preListeners.length does not match with type int of variable postListeners.length |
4 | Unmatched statement postListeners[i].onPostDelete(postEvent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement preListeners[i].onPreRecreateCollection(preEvent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Clone fragment #1 returns variables preEvent, i , while Clone fragment #2 returns variables postEvent, i |
7 | The refactoring of the clones is infeasible, because classes org.hibernate.action.CollectionRecreateAction and org.hibernate.action.EntityDeleteAction do not have a common superclass |