if (o1 == o2) return true; if (o1 == null || o2 == null) return false; int length = o1.length; if (length != o2.length) return false; for (int index = 0 ; index < length ; index++) { if ( ! ( o1[index] == o2[index] ) ) return false; } return true;
if (o1 == o2) return true; if (o1 == null || o2 == null) return false; int length = o1.length; if (length != o2.length) return false; for (int index = 0 ; index < length ; index++) { if ( ! o1[index].equals( o2[index] ) ) return false; } return true;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ArrayHelper.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ArrayHelper.java
Method name: boolean isEquals(char[], char[]) Method name: boolean isEquals(Object[], Object[])
Number of AST nodes: 11 Number of AST nodes: 11
1
if (o1 == o2) return true;
1
if (o1 == o2) return true;
2
		if (o1 == null || o2 == null) return false;
2
		if (o1 == null || o2 == null) return false;
3
		int length = o1.length;
3
		int length = o1.length;
4
		if (length != o2.length) return false;
4
		if (length != o2.length) return false;
5
		for (int index = 0 ; index < length ; index++) {
5
		for (int index = 0 ; index < length ; index++) {
6
			if ( ! ( o1[index] == o2[index] ) ) return false;
6
			if ( ! o1[index].equals( o2[index] ) ) return false;
7
		}
7
		}
8
        return true;
8
        return true;
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.9
Clones locationClones are declared in the same class
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (o1 == null || o2 == null)
    3
    if (o1 == null || o2 == null)
    3
    if (o1 == null || o2 == null)
    Differences
    Expression1Expression2Difference
    char[]java.lang.Object[]VARIABLE_TYPE_MISMATCH
    char[]java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type char[] of variable o1 does not match with type java.lang.Object[] of variable o1
    • Make classes char[] and java.lang.Object[] extend a common superclass
    Type char[] of variable o2 does not match with type java.lang.Object[] of variable o2
    • Make classes char[] and java.lang.Object[] extend a common superclass
    3
    if (o1 == null || o2 == null)
    4
    return false;
    4
    return false;
    4
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    4
    return false;
    5
    int length = o1.length;
    5
    int length = o1.length;
    5
    int length = o1.length;
    Differences
    Expression1Expression2Difference
    char[]java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type char[] of variable o1 does not match with type java.lang.Object[] of variable o1
    • Make classes char[] and java.lang.Object[] extend a common superclass
    5
    int length = o1.length;
    6
    if (length != o2.length)
    6
    if (length != o2.length)
    6
    if (length != o2.length)
    Differences
    Expression1Expression2Difference
    char[]java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type char[] of variable o2 does not match with type java.lang.Object[] of variable o2
    • Make classes char[] and java.lang.Object[] extend a common superclass
    6
    if (length != o2.length)
    7
    return false;
    7
    return false;
    7
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    7
    return false;
    8
    for (int index = 0; index < length; index++)
    8
    for (int index = 0; index < length; index++)
    9
    if (!(o1[index] == o2[index]))
    9
    if (!(o1[index] == o2[index]))
    9
    if (!o1[index].equals(o2[index]))
    Differences
    Expression1Expression2Difference
    (o1[index] == o2[index])o1[index].equals(o2[index])TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression (o1[index] == o2[index]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression o1[index].equals(o2[index]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    if (!o1[index].equals(o2[index]))
    10
    return false;
    10
    return false;
    10
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    10
    return false;
    Precondition Violations (12)
    Row Violation
    1Type char[] of variable o1 does not match with type java.lang.Object[] of variable o1
    2Type char[] of variable o2 does not match with type java.lang.Object[] of variable o2
    3Type char[] of variable o1 does not match with type java.lang.Object[] of variable o1
    4Type char[] of variable o2 does not match with type java.lang.Object[] of variable o2
    5Expression (o1[index] == o2[index]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression o1[index].equals(o2[index]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Conditional return false;
    8Conditional return false;
    9Conditional return false;
    10Conditional return false;
    11Conditional return false;
    12Conditional return false;