final Person p = ( Person ) itr.next(); if ( p.getName().equals( "John Doe" ) ) { Employee john = ( Employee ) p; assertEquals( "Incorrect fecthed minions count", 2, 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/JoinedSubclassFilterTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java
Method name: void testFiltersWithJoinedSubclass() 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", 2, john.getMinions().size() );
4
				assertEquals( "Incorrect fecthed minions count", 1, john.getMinions().size() );
5
				break;
5
				break;
6
			}
6
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    final Person p = (Person)itr.next();
    28
    final Person p = (Person)itr.next();
    14
    if (p.getName().equals("John Doe"))
    29
    if (p.getName().equals("John Doe"))
    15
    Employee john = (Employee)p;
    30
    Employee john = (Employee)p;
    16
    assertEquals("Incorrect fecthed minions count", 2, john.getMinions().size());
    16
    assertEquals("Incorrect fecthed minions count", 2, john.getMinions().size());
    31
    assertEquals("Incorrect fecthed minions count", 1, john.getMinions().size());
    Differences
    Expression1Expression2Difference
    21LITERAL_VALUE_MISMATCH
    31
    assertEquals("Incorrect fecthed minions count", 1, john.getMinions().size());
    17
    break;
    17
    break;
    32
    break;
    Preondition Violations
    Statement break; without innermost loop
    Statement break; without innermost loop
    32
    break;
    Precondition Violations (2)
    Row Violation
    1Statement break; without innermost loop
    2Statement break; without innermost loop