final Person p = ( Person ) itr.next();
if ( p.getName().equals( "John Doe" ) ) {
Employee john = ( Employee ) p;
assertEquals( "Incorrect fecthed minions count", 1, john.getMinions().size() );
break;
}
final Person p = ( Person ) itr.next();
if ( p.getName().equals( "John Doe" ) ) {
Employee john = ( Employee ) p;
assertEquals( "Incorrect fecthed minions count", 1, john.getMinions().size() );
break;
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java
|
Method name: void testFiltersWithUnionSubclass()
|
|
Method name: void testFiltersWithUnionSubclass()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | final Person p = ( Person ) itr.next();↵ | | 1 | final Person p = ( Person ) itr.next();↵
|
2 | if ( p.getName().equals( "John Doe" ) ) {↵ | | 2 | if ( p.getName().equals( "John Doe" ) ) {↵
|
3 | Employee john = ( Employee ) p;↵ | | 3 | Employee john = ( Employee ) p;↵
|
4 | assertEquals( "Incorrect fecthed minions count", 1, john.getMinions().size() );↵ | | 4 | assertEquals( "Incorrect fecthed minions count", 1, john.getMinions().size() );↵
|
5 | break;↵ | | 5 | break;↵
|
6 | } | | 6 | }
|
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 18 |
-
{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.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
18 | final Person p = (Person)itr.next(); | | 28 | final Person p = (Person)itr.next(); |
19 | if (p.getName().equals("John Doe")) | | 29 | if (p.getName().equals("John Doe")) |
20 | Employee john = (Employee)p; | | 30 | Employee john = (Employee)p; |
21 | assertEquals("Incorrect fecthed minions count", 1, john.getMinions().size()); | | 31 | assertEquals("Incorrect fecthed minions count", 1, john.getMinions().size()); |
22 | | | 32 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |