if (this == o) return true; if (!(o instanceof OuterKey)) return false; final OuterKey cidDetailID = (OuterKey) o; if (detailId != null ? !detailId.equals(cidDetailID.detailId) : cidDetailID.detailId != null) return false; if (master != null ? !master.equals(cidDetailID.master) : cidDetailID.master != null) return false; return true;
if (this == o) return true; if (!(o instanceof Inner)) return false; final Inner cidSuper = (Inner) o; if (id != null ? !id.equals(cidSuper.id) : cidSuper.id != 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/OuterKey.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/Inner.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 10 Number of AST nodes: 8
1
if (this == o) return true;
1
if (this == o) return true;
2
		if (!(o instanceof OuterKey)) return false;
2
		if (!(o instanceof Inner)) return false;
3
		final OuterKey cidDetailID = (OuterKey) o;
3
		final Inner cidSuper = (Inner) o;
4
		if (detailId != null ? !detailId.equals(cidDetailID.detailId) : cidDetailID.detailId != null) return false;
4
		if (id != null ? !id.equals(cid
5
		if (master != null ? !master.equals(cidDetailID.master) : cidDetailID.master != null) return false;
5
Super.id) : cidSuper.id != null) return false;
6
		return true;
6
		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 in different classes
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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.2
    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 OuterKey))
    3
    if (!(o instanceof OuterKey))
    3
    if (!(o instanceof Inner))
    Differences
    Expression1Expression2Difference
    org.hibernate.test.legacy.OuterKeyorg.hibernate.test.legacy.InnerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable o instanceof OuterKey does not match with type boolean of variable o instanceof Inner
    • Make classes org.hibernate.test.legacy.OuterKey and org.hibernate.test.legacy.Inner extend a common superclass
    3
    if (!(o instanceof Inner))
    4
    return false;
    4
    return false;
                                                                      
    5
    final Inner cidSuper = (Inner)o;
    5
    final OuterKey cidDetailID = (OuterKey)o;
                                                                                        
    6
    if (detailId != null ? !detailId.equals(cidDetailID.detailId) : cidDetailID.detailId != null)
    6
    if (detailId != null ? !detailId.equals(cidDetailID.detailId) : cidDetailID.detailId != null)
    6
    if (id != null ? !id.equals(cidSuper.id) : cidSuper.id != null)
    Differences
    Expression1Expression2Difference
    detailIdidVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    cidDetailIDcidSuperVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.OuterKeyorg.hibernate.test.legacy.InnerVARIABLE_TYPE_MISMATCH
    detailIdidVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    detailIdidVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    cidDetailIDcidSuperVARIABLE_NAME_MISMATCH
    org.hibernate.test.legacy.OuterKeyorg.hibernate.test.legacy.InnerVARIABLE_TYPE_MISMATCH
    detailIdidVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.hibernate.test.legacy.InnerKeyVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable detailId does not match with type org.hibernate.test.legacy.InnerKey of variable id
    • Make classes java.lang.String and org.hibernate.test.legacy.InnerKey extend a common superclass
    Type org.hibernate.test.legacy.OuterKey of variable cidDetailID does not match with type org.hibernate.test.legacy.Inner of variable cidSuper
    • Make classes org.hibernate.test.legacy.OuterKey and org.hibernate.test.legacy.Inner extend a common superclass
    Type java.lang.String of variable cidDetailID.detailId does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuper.id
    • Make classes java.lang.String and org.hibernate.test.legacy.InnerKey extend a common superclass
    Type java.lang.String of variable detailId does not match with type org.hibernate.test.legacy.InnerKey of variable id
    • Make classes java.lang.String and org.hibernate.test.legacy.InnerKey extend a common superclass
    Type org.hibernate.test.legacy.OuterKey of variable cidDetailID does not match with type org.hibernate.test.legacy.Inner of variable cidSuper
    • Make classes org.hibernate.test.legacy.OuterKey and org.hibernate.test.legacy.Inner extend a common superclass
    Type java.lang.String of variable cidDetailID.detailId does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuper.id
    • Make classes java.lang.String and org.hibernate.test.legacy.InnerKey extend a common superclass
    6
    if (id != null ? !id.equals(cidSuper.id) : cidSuper.id != null)
    7
    return false;
    7
    return false;
    8
    if (master != null ? !master.equals(cidDetailID.master) : cidDetailID.master != null)
                                                                                                                                                                                  
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    return true;
    8
    return true;
    Precondition Violations (8)
    Row Violation
    1Type boolean of variable o instanceof OuterKey does not match with type boolean of variable o instanceof Inner
    2Type java.lang.String of variable detailId does not match with type org.hibernate.test.legacy.InnerKey of variable id
    3Type org.hibernate.test.legacy.OuterKey of variable cidDetailID does not match with type org.hibernate.test.legacy.Inner of variable cidSuper
    4Type java.lang.String of variable cidDetailID.detailId does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuper.id
    5Type java.lang.String of variable detailId does not match with type org.hibernate.test.legacy.InnerKey of variable id
    6Type org.hibernate.test.legacy.OuterKey of variable cidDetailID does not match with type org.hibernate.test.legacy.Inner of variable cidSuper
    7Type java.lang.String of variable cidDetailID.detailId does not match with type org.hibernate.test.legacy.InnerKey of variable cidSuper.id
    8Unmatched return false;