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", 2, 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/DiscrimSubclassFilterTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subclassfilter/JoinedSubclassFilterTest.java
Method name: void testFiltersWithSubclass() Method name: void testFiltersWithJoinedSubclass()
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", 2, 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)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    18
    final Person p = (Person)itr.next();
    13
    final Person p = (Person)itr.next();
    19
    if (p.getName().equals("John Doe"))
    14
    if (p.getName().equals("John Doe"))
    20
    Employee john = (Employee)p;
    15
    Employee john = (Employee)p;
    21
    assertEquals("Incorrect fecthed minions count", 1, john.getMinions().size());
    21
    assertEquals("Incorrect fecthed minions count", 1, john.getMinions().size());
    16
    assertEquals("Incorrect fecthed minions count", 2, john.getMinions().size());
    Differences
    Expression1Expression2Difference
    12LITERAL_VALUE_MISMATCH
    16
    assertEquals("Incorrect fecthed minions count", 2, john.getMinions().size());
    22
    break;
    22
    break;
    17
    break;
    Preondition Violations
    Statement break; without innermost loop
    Statement break; without innermost loop
    17
    break;
    Precondition Violations (2)
    Row Violation
    1Statement break; without innermost loop
    2Statement break; without innermost loop