Iterator itr = collection.iterator(); while ( itr.hasNext() ) { assertClassAssignability( itr.next().getClass(), clazz ); }
if ( dialect.supportsTableCheck() ) { Iterator chiter = checkConstraints.iterator(); while ( chiter.hasNext() ) { buf.append( ", check (" ) .append( chiter.next() ) .append( ')' ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/junit/UnitTestCase.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/Table.java
Method name: void assertElementTypeAssignability(java.util.Collection, Class) Method name: String sqlCreateString(Dialect, Mapping, String, String)
Number of AST nodes: 3 Number of AST nodes: 4
1
if ( dialect.supportsTableCheck() ) {
1
Iterator itr = collection.iterator();
2
			Iterator chiter = checkConstraints.iterator();
2
		while ( itr.hasNext() ) {
3
			while ( chiter.hasNext() ) {
3
			assertClassAssignability( 
4
				buf.append( ", check (" )
4
itr.next().getClass(), clazz );
5
						.append( chiter.next() )
6
						.append( ')' );
7
			}
5
		}
8
		}
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 different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Iterator itr = collection.iterator();
    1
    Iterator itr = collection.iterator();
    44
    Iterator chiter = checkConstraints.iterator();
    Differences
    Expression1Expression2Difference
    itrchiterVARIABLE_NAME_MISMATCH
    collectioncheckConstraintsVARIABLE_NAME_MISMATCH
    java.util.Collectionjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection of variable collection does not match with type java.util.List of variable checkConstraints
    • Make classes java.util.Collection and java.util.List extend a common superclass
    44
    Iterator chiter = checkConstraints.iterator();
    2
    while (itr.hasNext())
    2
    while (itr.hasNext())
    45
    while (chiter.hasNext())
    Differences
    Expression1Expression2Difference
    itrchiterVARIABLE_NAME_MISMATCH
    45
    while (chiter.hasNext())
    3
    assertClassAssignability(itr.next().getClass(), clazz);
                                                                                                                      
                                                                                                                                
    46
    buf.append(", check (").append(chiter.next()).append(')');
    Precondition Violations (1)
    Row Violation
    1Type java.util.Collection of variable collection does not match with type java.util.List of variable checkConstraints