if ( ( ( PersistentCollection ) otherCollectionOrig ).wasInitialized() ) {
checkResult( listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++ );
otherChildOrig = ( Child ) otherCollectionOrig.iterator().next();
if ( otherChildOrig instanceof ChildWithBidirectionalManyToMany ) {
checkResult( listeners, listeners.getInitializeCollectionListener(), ( ChildWithBidirectionalManyToMany ) otherChildOrig, index++ );
}
}
if ( ( ( PersistentCollection ) otherCollectionOrig ).wasInitialized() ) {
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: 5
|
|
Number of AST nodes: 5
|
|
1 | if ( ( ( PersistentCollection ) otherCollectionOrig ).wasInitialized() ) {↵ | | 1 | if ( ( ( PersistentCollection ) otherCollectionOrig ).wasInitialized() ) {↵
|
2 | checkResult( listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++ );↵ | | 2 | checkResult( listeners, listeners.getInitializeCollectionListener(), otherParent, otherCollectionOrig, index++ );↵
|
3 | otherChildOrig = ( Child ) otherCollectionOrig.iterator().next();↵ | | 3 | otherChildOrig = ( Child ) otherCollectionOrig.iterator().next();↵
|
4 | if ( otherChildOrig instanceof ChildWithBidirectionalManyToMany ) {↵ | | 4 | if ( otherChildOrig instanceof ChildWithBidirectionalManyToMany ) {↵
|
5 | checkResult( listeners, listeners.getInitializeCollectionListener(), ( ChildWithBidirectionalManyToMany ) otherChildOrig, index++ );↵ | | 5 | checkResult( listeners, listeners.getInitializeCollectionListener(), ( ChildWithBidirectionalManyToMany ) otherChildOrig, index++ );↵
|
6 | }↵ | | 6 | }↵
|
7 | } | | 7 | }
|
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 | 13 |
-
{Non-refactorable}
Mapping Summary
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) | 1.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
16 | if (((PersistentCollection)otherCollectionOrig).wasInitialized()) | | 22 | if (((PersistentCollection)otherCollectionOrig).wasInitialized()) |
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 |