for ( int i = 0; i < targetDatatypes.length; i++ ) { if ( !areSqlTypesCompatible( targetDatatypes[i], sourceDatatypes[i] ) ) { return false; } }
for ( int i = 0; i < propertySpan; i++ ) { if ( !propertyTypes[i].isEqual( xvalues[i], yvalues[i], entityMode ) ) { return false; } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/IntoClause.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ComponentType.java
Method name: boolean areCompatible(Type, Type) Method name: boolean isEqual(Object, Object, EntityMode)
Number of AST nodes: 3 Number of AST nodes: 3
1
for ( int i = 0; i < targetDatatypes.length; i++ ) {
1
for ( int i = 0; i < 
2
			if ( !areSqlTypesCompatible( targetDatatypes[i], sourceDatatypes[i]
2
propertySpan; i++ ) {
3
 ) ) {
3
			if ( !propertyTypes[i].isEqual( xvalues[i], yvalues[i], entityMode ) ) {
4
				return false;
4
				return false;
5
			}
5
			}
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.3
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    for (int i = 0; i < targetDatatypes.length; i++)
    9
    for (int i = 0; i < targetDatatypes.length; i++)
    7
    for (int i = 0; i < propertySpan; i++)
    Differences
    Expression1Expression2Difference
    targetDatatypes.lengthpropertySpanTYPE_COMPATIBLE_REPLACEMENT
    7
    for (int i = 0; i < propertySpan; i++)
    10
    if (!areSqlTypesCompatible(targetDatatypes[i], sourceDatatypes[i]))
    10
    if (!areSqlTypesCompatible(targetDatatypes[i], sourceDatatypes[i]))
    8
    if (!propertyTypes[i].isEqual(xvalues[i], yvalues[i], entityMode))
    Differences
    Expression1Expression2Difference
    areSqlTypesCompatibleisEqualMETHOD_INVOCATION_NAME_MISMATCH
    areSqlTypesCompatible(targetDatatypes[i],sourceDatatypes[i])propertyTypes[i].isEqual(xvalues[i],yvalues[i],entityMode)ARGUMENT_NUMBER_MISMATCH
    propertyTypes[i]MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression areSqlTypesCompatible(targetDatatypes[i],sourceDatatypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method areSqlTypesCompatible
    Expression propertyTypes[i].isEqual(xvalues[i],yvalues[i],entityMode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression areSqlTypesCompatible(targetDatatypes[i],sourceDatatypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method areSqlTypesCompatible
    Expression propertyTypes[i].isEqual(xvalues[i],yvalues[i],entityMode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!propertyTypes[i].isEqual(xvalues[i], yvalues[i], entityMode))
    11
    return false;
    11
    return false;
    9
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    9
    return false;
    Precondition Violations (6)
    Row Violation
    1Expression areSqlTypesCompatible(targetDatatypes[i],sourceDatatypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression propertyTypes[i].isEqual(xvalues[i],yvalues[i],entityMode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression areSqlTypesCompatible(targetDatatypes[i],sourceDatatypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression propertyTypes[i].isEqual(xvalues[i],yvalues[i],entityMode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Conditional return false;
    6Conditional return false;