Parent p = new Parent( String.valueOf( i ) );
Child child = new Child( "child" + i );
child.setParent( p );
p.getChildren().add( child );
s.save( p );
parents.add(p);
Parent p = new Parent( String.valueOf( i + 100 ) );
Child child = new Child( "child" + i );
child.setParent( p );
p.getChildren().add( child );
s.save( p );
parents.add(p);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java
|
Method name: void testIterateWithClearBottomOfLoop()
|
|
Method name: void testIterateWithEvictBottomOfLoop()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | Parent p = new Parent( String.valueOf( i ) );↵ | | 1 | Parent p = new Parent( String.valueOf( i + 100 ) );↵
|
2 | Child child = new Child( "child" + i );↵ | | 2 | Child child = new Child( "child" + i );↵
|
3 | child.setParent( p );↵ | | 3 | child.setParent( p );↵
|
4 | p.getChildren().add( child );↵ | | 4 | p.getChildren().add( child );↵
|
5 | s.save( p );↵ | | 5 | s.save( p );↵
|
6 | parents.add(p); | | 6 | parents.add(p);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 15 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | Parent p = new Parent(String.valueOf(i)); | | 5 | Parent p = new Parent(String.valueOf(i + 100)); |
6 | Child child = new Child("child" + i); | | 6 | Child child = new Child("child" + i); |
7 | child.setParent(p); | | 7 | child.setParent(p); |
8 | p.getChildren().add(child); | | 8 | p.getChildren().add(child); |
9 | s.save(p); | | 9 | s.save(p); |
10 | parents.add(p); | | 10 | parents.add(p); |
Precondition Violations (0)
Row |
Violation |