for ( Iterator iter = beings.iterator(); iter.hasNext(); ) { Being b = (Being) iter.next(); assertNotNull( b.getLocation() ); assertNotNull( b.getIdentity() ); assertNotNull( b.getSpecies() ); }
Being b = (Being) iter.next(); assertFalse( Hibernate.isInitialized( b.getLocation() ) ); assertNotNull( b.getLocation().getName() ); assertNotNull( b.getIdentity() ); assertNotNull( b.getSpecies() );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subselect/SubselectTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/unionsubclass/UnionSubclassTest.java
Method name: void testEntitySubselect() Method name: void testUnionSubclass()
Number of AST nodes: 5 Number of AST nodes: 5
1
for ( Iterator iter = beings.iterator(); iter.hasNext(); ) {
1
Being b = (Being) iter.next();
2
			Being b = (Being) iter.next(
3
);
2
			assertFalse( Hibernate.isInitialized( b.getLocation() ) );
4
			assertNotNull( b.getLocation() );
3
			assertNotNull( b.getLocation().getName() );
5
			assertNotNull( b.getIdentity() );
4
			assertNotNull( b.getIdentity() );
6
			assertNotNull( b.getSpecies() );
5
			assertNotNull( b.getSpecies() );
7
		}
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    16
    Being b = (Being)iter.next();
    16
    Being b = (Being)iter.next();
    Preondition Violations
    Unmatched statement Being b=(Being)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                  
                                                                  
    39
    Being b = (Being)iter.next();
    Preondition Violations
    Unmatched statement Being b=(Being)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    39
    Being b = (Being)iter.next();
                                                                                                                        
    40
    assertFalse(Hibernate.isInitialized(b.getLocation()));
                                                                                              
    41
    assertNotNull(b.getLocation().getName());
    17
    assertNotNull(b.getLocation());
    17
    assertNotNull(b.getLocation());
    42
    assertNotNull(b.getIdentity());
    Differences
    Expression1Expression2Difference
    getLocationgetIdentityMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.test.subselect.Beingorg.hibernate.test.unionsubclass.BeingVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression b.getLocation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression b.getIdentity() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.subselect.Being of variable b does not match with type org.hibernate.test.unionsubclass.Being of variable b
    • Make classes org.hibernate.test.subselect.Being and org.hibernate.test.unionsubclass.Being extend a common superclass
    42
    assertNotNull(b.getIdentity());
    18
    assertNotNull(b.getIdentity());
    18
    assertNotNull(b.getIdentity());
    43
    assertNotNull(b.getSpecies());
    Differences
    Expression1Expression2Difference
    getIdentitygetSpeciesMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.test.subselect.Beingorg.hibernate.test.unionsubclass.BeingVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression b.getIdentity() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression b.getSpecies() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.subselect.Being of variable b does not match with type org.hibernate.test.unionsubclass.Being of variable b
    • Make classes org.hibernate.test.subselect.Being and org.hibernate.test.unionsubclass.Being extend a common superclass
    43
    assertNotNull(b.getSpecies());
    19
    assertNotNull(b.getSpecies());
                                                                        
    Precondition Violations (8)
    Row Violation
    1Unmatched statement Being b=(Being)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Being b=(Being)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression b.getLocation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression b.getIdentity() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type org.hibernate.test.subselect.Being of variable b does not match with type org.hibernate.test.unionsubclass.Being of variable b
    6Expression b.getIdentity() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression b.getSpecies() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type org.hibernate.test.subselect.Being of variable b does not match with type org.hibernate.test.unionsubclass.Being of variable b