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 = (master != null ? master.hashCode() : 0); result = 29 * result + (detailId != null ? detailId.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/OuterKey.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 = name.hashCode();
2
		result = 
3
		result = 29 * result + ( effectiveStartDate != null ? effectiveStartDate.hashCode() : 0 );
3
(master != null ? master.hashCode() : 0);
4
		result = 29 * result + ( effectiveEndDate != null ? effectiveEndDate.hashCode() : 0 );
4
		result = 29 * result + (detailId != null ? detailId.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 = name.hashCode();
    2
    result = name.hashCode();
    2
    result = (master != null ? master.hashCode() : 0);
    Differences
    Expression1Expression2Difference
    name.hashCode()(master != null ? master.hashCode() : 0)TYPE_COMPATIBLE_REPLACEMENT
    2
    result = (master != null ? master.hashCode() : 0);
    3
    result = 29 * result + (effectiveStartDate != null ? effectiveStartDate.hashCode() : 0);
    3
    result = 29 * result + (effectiveStartDate != null ? effectiveStartDate.hashCode() : 0);
    3
    result = 29 * result + (detailId != null ? detailId.hashCode() : 0);
    Differences
    Expression1Expression2Difference
    effectiveStartDatedetailIdVARIABLE_NAME_MISMATCH
    java.util.Datejava.lang.StringVARIABLE_TYPE_MISMATCH
    effectiveStartDatedetailIdVARIABLE_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 detailId
    • 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 detailId
    • Make classes java.util.Date and java.lang.String extend a common superclass
    3
    result = 29 * result + (detailId != null ? detailId.hashCode() : 0);
    4
    result = 29 * result + (effectiveEndDate != null ? effectiveEndDate.hashCode() : 0);
    4
    result = 29 * result + (effectiveEndDate != null ? effectiveEndDate.hashCode() : 0);
    Preondition Violations
    Unmatched statement result=29 * result + (effectiveEndDate != null ? effectiveEndDate.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 java.util.Date of variable effectiveStartDate does not match with type java.lang.String of variable detailId
    2Type java.util.Date of variable effectiveStartDate does not match with type java.lang.String of variable detailId
    3Unmatched statement result=29 * result + (effectiveEndDate != null ? effectiveEndDate.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