if (this == o) return true; if (!(o instanceof MiddleKey)) return false; final MiddleKey cidMasterID = (MiddleKey) o; if (one != null ? !one.equals(cidMasterID.one) : cidMasterID.one != null) return false; if (sup != null ? !sup.equals(cidMasterID.sup) : cidMasterID.sup != null) return false; if (two != null ? !two.equals(cidMasterID.two) : cidMasterID.two != null) return false; return true;
if (this == o) return true; if (!(o instanceof InnerKey)) return false; final InnerKey cidSuperID = (InnerKey) o; if (akey != null ? !akey.equals(cidSuperID.akey) : cidSuperID.akey != null) return false; if (bkey != null ? !bkey.equals(cidSuperID.bkey) : cidSuperID.bkey != null) return false; return true;
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: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 12 Number of AST nodes: 10
1
if (this == o) return true;
1
if (this == o) return true;
2
		if (!(o instanceof MiddleKey)) return false;
2
		if (!(o instanceof InnerKey)) return false;
3
		final MiddleKey cidMasterID = (MiddleKey) o;
3
		final InnerKey cidSuperID = (InnerKey) o;
4
		if (one != null ? !one.equals(cidMasterID.one) : cidMasterID.one != null) return false;
4
		if (akey != null ? !akey.equals(cidSuperID.akey) : cid
5
		if (sup != null ? !sup.equals(cidMasterID.sup) : cidMasterID.sup != null) return false;
5
SuperID.akey != null) return false;
6
		if (two != null ? !two.equals(cidMasterID.two) : cidMasterID.two != null) return false;
6
		if (bkey != null ? !bkey.equals(cidSuperID.bkey) : cidSuperID.bkey != null) return false;
7
		return true;
7
		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)1.9
Clones locationClones are in different classes
Number of node comparisons54
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (this == o)
    1
    if (this == o)
    2
    return true;
    2
    return true;
    3
    if (!(o instanceof MiddleKey))
    3
    if (!(o instanceof MiddleKey))
    3
    if (!(o instanceof InnerKey))
    Differences
    Expression1Expression2Difference
    org.hibernate.test.legacy.MiddleKeyorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable o instanceof MiddleKey does not match with type boolean of variable o instanceof InnerKey
    • Make classes org.hibernate.test.legacy.MiddleKey and org.hibernate.test.legacy.InnerKey extend a common superclass
    3
    if (!(o instanceof InnerKey))
    4
    return false;
    4
    return false;
                                                                                      
    5
    final InnerKey cidSuperID = (InnerKey)o;
    5
    final MiddleKey cidMasterID = (MiddleKey)o;
                                                                                            
    6
    if (one != null ? !one.equals(cidMasterID.one) : cidMasterID.one != null)
    6
    if (one != null ? !one.equals(cidMasterID.one) : cidMasterID.one != null)
    6
    if (akey != null ? !akey.equals(cidSuperID.akey) : cidSuperID.akey != null)
    Differences
    Expression1Expression2Difference
    oneakeyVARIABLE_NAME_MISMATCH
    cidMasterIDcidSuperIDVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.MiddleKeyorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    oneakeyVARIABLE_NAME_MISMATCH
    oneakeyVARIABLE_NAME_MISMATCH
    cidMasterIDcidSuperIDVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.MiddleKeyorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    oneakeyVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.hibernate.test.legacy.MiddleKey of variable cidMasterID does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuperID
    • Make classes org.hibernate.test.legacy.MiddleKey and org.hibernate.test.legacy.InnerKey extend a common superclass
    Type org.hibernate.test.legacy.MiddleKey of variable cidMasterID does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuperID
    • Make classes org.hibernate.test.legacy.MiddleKey and org.hibernate.test.legacy.InnerKey extend a common superclass
    6
    if (akey != null ? !akey.equals(cidSuperID.akey) : cidSuperID.akey != null)
    7
    return false;
    7
    return false;
    8
    if (sup != null ? !sup.equals(cidMasterID.sup) : cidMasterID.sup != null)
    8
    if (sup != null ? !sup.equals(cidMasterID.sup) : cidMasterID.sup != null)
    8
    if (bkey != null ? !bkey.equals(cidSuperID.bkey) : cidSuperID.bkey != null)
    Differences
    Expression1Expression2Difference
    supbkeyVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.Innerjava.lang.StringVARIABLE_TYPE_MISMATCH
    cidMasterIDcidSuperIDVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.MiddleKeyorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    supbkeyVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.Innerjava.lang.StringVARIABLE_TYPE_MISMATCH
    supbkeyVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.Innerjava.lang.StringVARIABLE_TYPE_MISMATCH
    cidMasterIDcidSuperIDVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.MiddleKeyorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    supbkeyVARIABLE_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 bkey
    • Make classes org.hibernate.test.legacy.Inner and java.lang.String extend a common superclass
    Type org.hibernate.test.legacy.MiddleKey of variable cidMasterID does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuperID
    • Make classes org.hibernate.test.legacy.MiddleKey and org.hibernate.test.legacy.InnerKey extend a common superclass
    Type org.hibernate.test.legacy.Inner of variable cidMasterID.sup does not match with type java.lang.String of variable cidSuperID.bkey
    • 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 bkey
    • Make classes org.hibernate.test.legacy.Inner and java.lang.String extend a common superclass
    Type org.hibernate.test.legacy.MiddleKey of variable cidMasterID does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuperID
    • Make classes org.hibernate.test.legacy.MiddleKey and org.hibernate.test.legacy.InnerKey extend a common superclass
    Type org.hibernate.test.legacy.Inner of variable cidMasterID.sup does not match with type java.lang.String of variable cidSuperID.bkey
    • Make classes org.hibernate.test.legacy.Inner and java.lang.String extend a common superclass
    8
    if (bkey != null ? !bkey.equals(cidSuperID.bkey) : cidSuperID.bkey != null)
    9
    return false;
    9
    return false;
    10
    if (two != null ? !two.equals(cidMasterID.two) : cidMasterID.two != null)
                                                                                                                                                            
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    return true;
    10
    return true;
    Precondition Violations (10)
    Row Violation
    1Type boolean of variable o instanceof MiddleKey does not match with type boolean of variable o instanceof InnerKey
    2Type org.hibernate.test.legacy.MiddleKey of variable cidMasterID does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuperID
    3Type org.hibernate.test.legacy.MiddleKey of variable cidMasterID does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuperID
    4Type org.hibernate.test.legacy.Inner of variable sup does not match with type java.lang.String of variable bkey
    5Type org.hibernate.test.legacy.MiddleKey of variable cidMasterID does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuperID
    6Type org.hibernate.test.legacy.Inner of variable cidMasterID.sup does not match with type java.lang.String of variable cidSuperID.bkey
    7Type org.hibernate.test.legacy.Inner of variable sup does not match with type java.lang.String of variable bkey
    8Type org.hibernate.test.legacy.MiddleKey of variable cidMasterID does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuperID
    9Type org.hibernate.test.legacy.Inner of variable cidMasterID.sup does not match with type java.lang.String of variable cidSuperID.bkey
    10Unmatched return false;