for ( int i = 0; i < exceptions.length; i++ ) { if ( SQLException.class.isAssignableFrom( exceptions[i] ) ) { return true; } }
while ( iter.hasNext() ) { if ( ( (Column) iter.next() ).isNullable() ) { return false; } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/test/java/org/hibernate/dialect/Mocks.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/UniqueKey.java
Method name: boolean canThrowSQLException(Method) Method name: boolean isGenerated(Dialect)
Number of AST nodes: 3 Number of AST nodes: 3
1
for ( int i = 0; i < exceptions.length; i++ ) {
2
			if ( SQLException.class.isAssignableFrom( exceptions[i] 
1
while ( iter.hasNext() ) {
3
) ) {
2
			if ( ( (Column) iter.next() ).isNullable() ) {
4
				return true;
3
				return false;
5
			}
4
			}
6
		}
5
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    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.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (SQLException.class.isAssignableFrom(exceptions[i]))
    3
    if (SQLException.class.isAssignableFrom(exceptions[i]))
    5
    if (((Column)iter.next()).isNullable())
    Differences
    Expression1Expression2Difference
    isAssignableFromisNullableMETHOD_INVOCATION_NAME_MISMATCH
    SQLException.class.isAssignableFrom(exceptions[i])((Column)iter.next()).isNullable()ARGUMENT_NUMBER_MISMATCH
    5
    if (((Column)iter.next()).isNullable())
    4
    return true;
    4
    return true;
    6
    return false;
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    6
    return false;
    Precondition Violations (0)
    Row Violation