checkResult( listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++ );
otherChildOrig = ( Child ) otherCollectionOrig.iterator().next();
if ( otherChildOrig instanceof ChildWithBidirectionalManyToMany ) {
checkResult( listeners, listeners.getInitializeCollectionListener(), ( ChildWithBidirectionalManyToMany ) otherChildOrig, index++ );
}
checkResult( listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++ );
otherChildOrig = ( Child ) otherCollectionOrig.iterator().next();
if ( otherChildOrig instanceof ChildWithBidirectionalManyToMany ) {
checkResult( listeners, listeners.getInitializeCollectionListener(), ( ChildWithBidirectionalManyToMany ) otherChildOrig, index++ );
}
Clone fragments detected by clone detection tool
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 testMoveCollectionToDifferentParent()
|
|
Method name: void testMoveCollectionToDifferentParentFlushMoveToDifferentParent()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | checkResult( listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++ );↵ | | 1 | checkResult( listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++ );↵
|
2 | otherChildOrig = ( Child ) otherCollectionOrig.iterator().next();↵ | | 2 | otherChildOrig = ( Child ) otherCollectionOrig.iterator().next();↵
|
3 | if ( otherChildOrig instanceof ChildWithBidirectionalManyToMany ) {↵ | | 3 | if ( otherChildOrig instanceof ChildWithBidirectionalManyToMany ) {↵
|
4 | checkResult( listeners, listeners.getInitializeCollectionListener(), ( ChildWithBidirectionalManyToMany ) otherChildOrig, index++ );↵ | | 4 | checkResult( listeners, listeners.getInitializeCollectionListener(), ( ChildWithBidirectionalManyToMany ) otherChildOrig, index++ );↵
|
5 | } | | 5 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 declared in the same class |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | checkResult(listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++); | | 23 | checkResult(listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++); |
18 | otherChildOrig = (Child)otherCollectionOrig.iterator().next(); | | 24 | otherChildOrig = (Child)otherCollectionOrig.iterator().next(); |
19 | if (otherChildOrig instanceof ChildWithBidirectionalManyToMany) | | 25 | if (otherChildOrig instanceof ChildWithBidirectionalManyToMany) |
20 | checkResult(listeners, listeners.getInitializeCollectionListener(), (ChildWithBidirectionalManyToMany)otherChildOrig, index++); | | 26 | checkResult(listeners, listeners.getInitializeCollectionListener(), (ChildWithBidirectionalManyToMany)otherChildOrig, index++); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables index, otherChildOrig , while Clone fragment #2 returns variables index, otherChildOrig |