int result; result = name.hashCode(); result = 29 * result + ( effectiveStartDate != null ? effectiveStartDate.hashCode() : 0 ); result = 29 * result + ( effectiveEndDate != null ? effectiveEndDate.hashCode() : 0 ); return result;
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;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/filter/Category.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/MiddleKey.java
Method name: int hashCode() Method name: int hashCode()
Number of AST nodes: 5 Number of AST nodes: 5
1
int result;
1
int result;
2
		result = name.hashCode();
2
		result = (sup != null ? sup.hashCode() : 0);
3
		result = 29 * result + ( effectiveStartDate != null ? effectiveStartDate.hashCode() : 0 );
3
		result = 29 * result + (one != null ? one.hashCode() : 0);
4
		result = 29 * result + ( effectiveEndDate != null ? effectiveEndDate.hashCode() : 0 );
4
		result = 29 * result + (two != null ? two.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 comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int result;
    1
    int result;
    2
    result = name.hashCode();
    2
    result = name.hashCode();
    2
    result = (sup != null ? sup.hashCode() : 0);
    Differences
    Expression1Expression2Difference
    name.hashCode()(sup != null ? sup.hashCode() : 0)TYPE_COMPATIBLE_REPLACEMENT
    2
    result = (sup != null ? sup.hashCode() : 0);
    3
    result = 29 * result + (effectiveStartDate != null ? effectiveStartDate.hashCode() : 0);
    3
    result = 29 * result + (effectiveStartDate != null ? effectiveStartDate.hashCode() : 0);
    3
    result = 29 * result + (one != null ? one.hashCode() : 0);
    Differences
    Expression1Expression2Difference
    effectiveStartDateoneVARIABLE_NAME_MISMATCH
    java.util.Datejava.lang.StringVARIABLE_TYPE_MISMATCH
    effectiveStartDateoneVARIABLE_NAME_MISMATCH
    java.util.Datejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Date of variable effectiveStartDate does not match with type java.lang.String of variable one
    • Make classes java.util.Date and java.lang.String extend a common superclass
    Type java.util.Date of variable effectiveStartDate does not match with type java.lang.String of variable one
    • Make classes java.util.Date and java.lang.String extend a common superclass
    3
    result = 29 * result + (one != null ? one.hashCode() : 0);
    4
    result = 29 * result + (effectiveEndDate != null ? effectiveEndDate.hashCode() : 0);
    4
    result = 29 * result + (effectiveEndDate != null ? effectiveEndDate.hashCode() : 0);
    4
    result = 29 * result + (two != null ? two.hashCode() : 0);
    Differences
    Expression1Expression2Difference
    effectiveEndDatetwoVARIABLE_NAME_MISMATCH
    java.util.Datejava.lang.StringVARIABLE_TYPE_MISMATCH
    effectiveEndDatetwoVARIABLE_NAME_MISMATCH
    java.util.Datejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Date of variable effectiveEndDate does not match with type java.lang.String of variable two
    • Make classes java.util.Date and java.lang.String extend a common superclass
    Type java.util.Date of variable effectiveEndDate does not match with type java.lang.String of variable two
    • Make classes java.util.Date and java.lang.String extend a common superclass
    4
    result = 29 * result + (two != null ? two.hashCode() : 0);
    5
    return result;
    5
    return result;
    Precondition Violations (4)
    Row Violation
    1Type java.util.Date of variable effectiveStartDate does not match with type java.lang.String of variable one
    2Type java.util.Date of variable effectiveStartDate does not match with type java.lang.String of variable one
    3Type java.util.Date of variable effectiveEndDate does not match with type java.lang.String of variable two
    4Type java.util.Date of variable effectiveEndDate does not match with type java.lang.String of variable two