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/action/CollectionUpdateAction.java | |||
Method name: void preUpdate()
|
Method name: void postUpdate()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | PreCollectionUpdateEventListener[] preListeners = getSession().getListeners()↵ | 1 | PostCollectionUpdateEventListener[] postListeners = getSession().getListeners()↵ | |
2 | .getPreCollectionUpdateEventListeners();↵ | 2 | .getPostCollectionUpdateEventListeners();↵ | |
3 | if (preListeners.length > 0) {↵ | 3 | if (postListeners.length > 0) {↵ | |
4 | PreCollectionUpdateEvent preEvent = new PreCollectionUpdateEvent(↵ | 4 | PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent(↵ | |
5 | getPersister(), getCollection(), ( EventSource ) getSession() );↵ | 5 | getPersister(), getCollection(), ( EventSource ) getSession() );↵ | |
6 | for ( int i = 0; i < preListeners.length; i++ ) {↵ | 6 | for ( int i = 0; i < postListeners.length; i++ ) {↵ | |
7 | preListeners[i].onPreUpdateCollection( preEvent );↵ | 7 | postListeners[i].onPostUpdateCollection( postEvent );↵ | |
8 | }↵ | 8 | }↵ | |
9 | } | 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 declared in the same class |
Number of node comparisons | 9 |
Number of mapped statements | 3 |
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) | 25.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PostCollectionUpdateEventListener[] postListeners = getSession().getListeners().getPostCollectionUpdateEventListeners(); | |||||||||||||||||||||
1 | PreCollectionUpdateEventListener[] preListeners = getSession().getListeners().getPreCollectionUpdateEventListeners(); | | |||||||||||||||||||||
2 | if (preListeners.length > 0) |
| 2 | if (postListeners.length > 0) | |||||||||||||||||||
3 | PreCollectionUpdateEvent preEvent = new PreCollectionUpdateEvent(getPersister(), getCollection(), (EventSource)getSession()); |
| 3 | PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent(getPersister(), getCollection(), (EventSource)getSession()); | |||||||||||||||||||
4 | for (int i = 0; i < preListeners.length; i++) |
| 4 | for (int i = 0; i < postListeners.length; i++) | |||||||||||||||||||
|
| 5 | postListeners[i].onPostUpdateCollection(postEvent); | ||||||||||||||||||||
5 | preListeners[i].onPreUpdateCollection(preEvent); |
| |
Row | Violation |
---|---|
1 | Type int of variable preListeners.length does not match with type int of variable postListeners.length |
2 | Type int of variable preListeners.length does not match with type int of variable postListeners.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 preListeners[i].onPreUpdateCollection(preEvent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables preEvent, i , while Clone fragment #2 returns variables postEvent, i |