int result; result = (sup != null ? sup.hashCode() : 0); result = 29 * result + (one != null ? one.hashCode() : 0); result = 29 * result + (two != null ? two.hashCode() : 0); return result;
int result; result = (akey != null ? akey.hashCode() : 0); result = 29 * result + (bkey != null ? bkey.hashCode() : 0); return result;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/MiddleKey.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/InnerKey.java
Method name: int hashCode() Method name: int hashCode()
Number of AST nodes: 5 Number of AST nodes: 4
1
int result;
1
int result;
2
		result = (sup != null ? sup.hashCode() : 0);
2
		result = (
3
		result = 29 * result + (one != null ? one.hashCode() : 0);
3
akey != null ? akey.hashCode() : 0);
4
		result = 29 * result + (two != null ? two.hashCode() : 0);
4
		result = 29 * result + (bkey != null ? bkey.hashCode() : 0);
5
		return result;
5
		return result;
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.0
Clones locationClones are in different classes
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    int result;
    1
    int result;
    2
    result = (sup != null ? sup.hashCode() : 0);
    2
    result = (sup != null ? sup.hashCode() : 0);
    2
    result = (akey != null ? akey.hashCode() : 0);
    Differences
    Expression1Expression2Difference
    supakeyVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.Innerjava.lang.StringVARIABLE_TYPE_MISMATCH
    supakeyVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.Innerjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.legacy.Inner of variable sup does not match with type java.lang.String of variable akey
    • Make classes org.hibernate.test.legacy.Inner and java.lang.String extend a common superclass
    Type org.hibernate.test.legacy.Inner of variable sup does not match with type java.lang.String of variable akey
    • Make classes org.hibernate.test.legacy.Inner and java.lang.String extend a common superclass
    2
    result = (akey != null ? akey.hashCode() : 0);
    3
    result = 29 * result + (one != null ? one.hashCode() : 0);
    3
    result = 29 * result + (one != null ? one.hashCode() : 0);
    3
    result = 29 * result + (bkey != null ? bkey.hashCode() : 0);
    Differences
    Expression1Expression2Difference
    onebkeyVARIABLE_NAME_MISMATCH
    onebkeyVARIABLE_NAME_MISMATCH
    3
    result = 29 * result + (bkey != null ? bkey.hashCode() : 0);
    4
    result = 29 * result + (two != null ? two.hashCode() : 0);
    4
    result = 29 * result + (two != null ? two.hashCode() : 0);
    Preondition Violations
    Unmatched statement result=29 * result + (two != null ? two.hashCode() : 0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                          
    5
    return result;
    4
    return result;
    Precondition Violations (4)
    Row Violation
    1Type org.hibernate.test.legacy.Inner of variable sup does not match with type java.lang.String of variable akey
    2Type org.hibernate.test.legacy.Inner of variable sup does not match with type java.lang.String of variable akey
    3Unmatched statement result=29 * result + (two != null ? two.hashCode() : 0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Clone fragment #1 returns variables result , while Clone fragment #2 returns variables