i++;
if (i % 2 == 0) {
s.flush();
s.clear();
}
Parent p = (Parent) it.next();
assertEquals( 1, p.getChildren().size() );
Parent p = (Parent) it.next();
assertEquals( 1, p.getChildren().size() );
i++;
if (i % 2 == 0) {
s.flush();
s.clear();
}
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 testIterateWithClearTopOfLoop()
|
|
Method name: void testIterateWithClearBottomOfLoop()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | i++;↵ | | |
|
2 | if (i % 2 == 0) {↵ | | |
|
3 | s.flush();↵ | | |
|
4 | s.clear();↵ | | |
|
5 | }↵ | | |
|
6 | Parent p = (Parent) it.next();↵ | | 1 | Parent p = (Parent) it.next();↵
|
7 | assertEquals( 1, p.getChildren().size() ); | | 2 | assertEquals( 1, p.getChildren().size() );↵
|
| | | 3 | i++;↵
|
| | | 4 | if (i % 2 == 0) {↵
|
| | | 5 | s.flush();↵
|
| | | 6 | s.clear();↵
|
| | | 7 | }
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 19 |
-
{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.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | i++; | | 19 | i++; |
18 | if (i % 2 == 0) | | 20 | if (i % 2 == 0) |
19 | | | 21 | |
20 | | | 22 | |
21 | Parent p = (Parent)it.next(); | | 17 | Parent p = (Parent)it.next(); |
22 | assertEquals(1, p.getChildren().size()); | | 18 | assertEquals(1, p.getChildren().size()); |
Precondition Violations (0)
Row |
Violation |