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 (b1 == b2) return true; if (b1 == null || b2 == null) return false; int length = b1.length; if (length != b2.length) return false; for (int index = 0 ; index < length ; index++) { if ( ! ( b1[index] == b2[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(byte[], byte[])
Number of AST nodes: 11 Number of AST nodes: 11
1
if (o1 == o2) return true;
1
if (b1 == b2) return true;
2
		if (o1 == null || o2 == null) return false;
2
		if (b1 == null || b2 == null) return false;
3
		int length = o1.length;
3
		int length = b1.length;
4
		if (length != o2.length) return false;
4
		if (length != b2.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 ( ! ( b1[index] == b2[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.8
Clones locationClones are declared in the same class
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (o1 == o2)
    1
    if (o1 == o2)
    1
    if (b1 == b2)
    Differences
    Expression1Expression2Difference
    o1b1VARIABLE_NAME_MISMATCH
    char[]byte[]VARIABLE_TYPE_MISMATCH
    o2b2VARIABLE_NAME_MISMATCH
    char[]byte[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type char[] of variable o1 does not match with type byte[] of variable b1
    • Make classes char[] and byte[] extend a common superclass
    Type char[] of variable o2 does not match with type byte[] of variable b2
    • Make classes char[] and byte[] extend a common superclass
    1
    if (b1 == b2)
    2
    return true;
    2
    return true;
    3
    if (o1 == null || o2 == null)
    3
    if (o1 == null || o2 == null)
    3
    if (b1 == null || b2 == null)
    Differences
    Expression1Expression2Difference
    o1b1VARIABLE_NAME_MISMATCH
    char[]byte[]VARIABLE_TYPE_MISMATCH
    o2b2VARIABLE_NAME_MISMATCH
    char[]byte[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type char[] of variable o1 does not match with type byte[] of variable b1
    • Make classes char[] and byte[] extend a common superclass
    Type char[] of variable o2 does not match with type byte[] of variable b2
    • Make classes char[] and byte[] extend a common superclass
    3
    if (b1 == null || b2 == null)
    4
    return false;
    4
    return false;
    5
    int length = o1.length;
    5
    int length = o1.length;
    5
    int length = b1.length;
    Differences
    Expression1Expression2Difference
    o1b1VARIABLE_NAME_MISMATCH
    char[]byte[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable o1.length does not match with type int of variable b1.length
    • Make classes char[] and byte[] extend a common superclass
    5
    int length = b1.length;
    6
    if (length != o2.length)
    6
    if (length != o2.length)
    6
    if (length != b2.length)
    Differences
    Expression1Expression2Difference
    o2b2VARIABLE_NAME_MISMATCH
    char[]byte[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable o2.length does not match with type int of variable b2.length
    • Make classes char[] and byte[] extend a common superclass
    6
    if (length != b2.length)
    7
    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 (!(b1[index] == b2[index]))
    Differences
    Expression1Expression2Difference
    o1b1VARIABLE_NAME_MISMATCH
    char[]byte[]VARIABLE_TYPE_MISMATCH
    o2b2VARIABLE_NAME_MISMATCH
    char[]byte[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type char[] of variable o1 does not match with type byte[] of variable b1
    • Make classes char[] and byte[] extend a common superclass
    Type char[] of variable o2 does not match with type byte[] of variable b2
    • Make classes char[] and byte[] extend a common superclass
    9
    if (!(b1[index] == b2[index]))
    10
    return false;
    10
    return false;
    11
    return true;
    11
    return true;
    Precondition Violations (8)
    Row Violation
    1Type char[] of variable o1 does not match with type byte[] of variable b1
    2Type char[] of variable o2 does not match with type byte[] of variable b2
    3Type char[] of variable o1 does not match with type byte[] of variable b1
    4Type char[] of variable o2 does not match with type byte[] of variable b2
    5Type int of variable o1.length does not match with type int of variable b1.length
    6Type int of variable o2.length does not match with type int of variable b2.length
    7Type char[] of variable o1 does not match with type byte[] of variable b1
    8Type char[] of variable o2 does not match with type byte[] of variable b2