while ( iter.hasNext() ) { GlarchProxy g = (GlarchProxy) iter.next(); assertTrue( "not null", g!=null ); iter.remove(); }
while ( iter.hasNext() ) { BarProxy bar = (BarProxy) iter.next(); assertTrue( "not null", bar!=null ); iter.remove(); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/FooBarTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/FooBarTest.java
Method name: void testRecursiveLoad() Method name: void testRecursiveLoad()
Number of AST nodes: 4 Number of AST nodes: 4
1
while ( iter.hasNext() ) {
1
while ( iter.hasNext() ) {
2
			GlarchProxy g = (GlarchProxy) iter.next();
2
			BarProxy bar = (BarProxy) iter.next();
3
			assertTrue( "not null", g!=null );
3
			assertTrue( "not null", bar!=null );
4
			iter.remove();
4
			iter.remove();
5
		}
5
		}
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.1
Clones locationClones are in the same method
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    30
    while (iter.hasNext())
    66
    while (iter.hasNext())
    31
    GlarchProxy g = (GlarchProxy)iter.next();
    31
    GlarchProxy g = (GlarchProxy)iter.next();
    Preondition Violations
    Unmatched statement GlarchProxy g=(GlarchProxy)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                          
                                                                                  
    67
    BarProxy bar = (BarProxy)iter.next();
    Preondition Violations
    Unmatched statement BarProxy bar=(BarProxy)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    67
    BarProxy bar = (BarProxy)iter.next();
    32
    assertTrue("not null", g != null);
    32
    assertTrue("not null", g != null);
    68
    assertTrue("not null", bar != null);
    Differences
    Expression1Expression2Difference
    gbarVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.GlarchProxyorg.hibernate.test.legacy.BarProxyVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.legacy.GlarchProxy of variable g does not match with type org.hibernate.test.legacy.BarProxy of variable bar
    • Make classes org.hibernate.test.legacy.GlarchProxy and org.hibernate.test.legacy.BarProxy extend a common superclass
    68
    assertTrue("not null", bar != null);
    33
    iter.remove();
    69
    iter.remove();
    Precondition Violations (3)
    Row Violation
    1Unmatched statement GlarchProxy g=(GlarchProxy)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement BarProxy bar=(BarProxy)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.hibernate.test.legacy.GlarchProxy of variable g does not match with type org.hibernate.test.legacy.BarProxy of variable bar