File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/event/collection/AbstractCollectionEventTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/event/collection/AbstractCollectionEventTest.java | |||
Method name: void testUpdateParentOneToTwoSameChildren()
|
Method name: void testUpdateParentTwoChildrenToOne()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if ( child instanceof ChildWithBidirectionalManyToMany ) {↵ | 1 | if ( oldChild instanceof ChildWithBidirectionalManyToMany ) {↵ | |
2 | childWithManyToMany = ( ChildWithBidirectionalManyToMany ) child;↵ | 2 | ChildWithBidirectionalManyToMany oldChildWithManyToMany = ( ChildWithBidirectionalManyToMany ) oldChild;↵ | |
3 | if ( ( ( PersistentCollection ) childWithManyToMany.getParents() ).wasInitialized() ) {↵ | 3 | if ( ( ( PersistentCollection ) oldChildWithManyToMany.getParents() ).wasInitialized() ) {↵ | |
4 | checkResult( listeners, listeners.getInitializeCollectionListener(), childWithManyToMany, index++ );↵ | 4 | checkResult( listeners, listeners.getInitializeCollectionListener(), oldChildWithManyToMany, index++ );↵ | |
5 | }↵ | 5 | }↵ | |
6 | } | 6 |
| |
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 | 8 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18 | if (child instanceof ChildWithBidirectionalManyToMany) |
| 24 | if (oldChild instanceof ChildWithBidirectionalManyToMany) | ||||||||||||||||
19 | childWithManyToMany = (ChildWithBidirectionalManyToMany)child; |
| 25 | ChildWithBidirectionalManyToMany oldChildWithManyToMany = (ChildWithBidirectionalManyToMany)oldChild; | ||||||||||||||||
20 | if (((PersistentCollection)childWithManyToMany.getParents()).wasInitialized()) |
| 26 | if (((PersistentCollection)oldChildWithManyToMany.getParents()).wasInitialized()) | ||||||||||||||||
21 | checkResult(listeners, listeners.getInitializeCollectionListener(), childWithManyToMany, index++); |
| 27 | checkResult(listeners, listeners.getInitializeCollectionListener(), oldChildWithManyToMany, index++); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables index, childWithManyToMany , while Clone fragment #2 returns variables index |