if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } LineItemPK that = ( LineItemPK ) o; if ( !order.equals( that.order ) ) { return false; } if ( !productCode.equals( that.productCode ) ) { return false; } return true;
if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } MapKey mapKey = ( MapKey ) o; if ( !role.equals( mapKey.role ) ) { 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/idprops/LineItemPK.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/collection/backref/map/compkey/MapKey.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 ) {
1
if ( this == o ) {
2
			return true;
2
			return true;
3
		}
3
		}
4
		if ( o == null || getClass() != o.getClass() ) {
4
		if ( o == null || getClass() != o.getClass() ) {
5
			return false;
5
			return false;
6
		}
6
		}
7
		LineItemPK that = ( LineItemPK
8
 ) o;
7
		MapKey mapKey = ( MapKey ) o;
9

10
		if ( !order.equals( that.order ) ) {
8
		if ( !
11
			return false;
12
		}
13
		if ( !productCode.equals( that.productCode ) ) {
9
role.equals( mapKey.role ) ) {
14
			return false;
10
			return false;
15
		}
11
		}
16

17
		return true;
12
		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 statements8
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    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 == null || getClass() != o.getClass())
    3
    if (o == null || getClass() != o.getClass())
    4
    return false;
    4
    return false;
    5
    LineItemPK that = (LineItemPK)o;
    5
    LineItemPK that = (LineItemPK)o;
    5
    MapKey mapKey = (MapKey)o;
    Differences
    Expression1Expression2Difference
    thatmapKeyVARIABLE_NAME_MISMATCH
    5
    MapKey mapKey = (MapKey)o;
    6
    if (!order.equals(that.order))
    6
    if (!order.equals(that.order))
    6
    if (!role.equals(mapKey.role))
    Differences
    Expression1Expression2Difference
    thatmapKeyVARIABLE_NAME_MISMATCH
    orderroleVARIABLE_NAME_MISMATCH
    org.hibernate.test.idprops.Orderjava.lang.StringVARIABLE_TYPE_MISMATCH
    orderroleVARIABLE_NAME_MISMATCH
    org.hibernate.test.idprops.Orderjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.order cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mapKey.role cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.idprops.Order of variable that.order does not match with type java.lang.String of variable mapKey.role
    • Make classes org.hibernate.test.idprops.Order and java.lang.String extend a common superclass
    Type org.hibernate.test.idprops.Order of variable order does not match with type java.lang.String of variable role
    • Make classes org.hibernate.test.idprops.Order and java.lang.String extend a common superclass
    6
    if (!role.equals(mapKey.role))
    7
    return false;
    7
    return false;
    8
    if (!productCode.equals(that.productCode))
                                                                                            
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    return true;
    8
    return true;
    Precondition Violations (6)
    Row Violation
    1Expression that.order cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression mapKey.role cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.hibernate.test.idprops.Order of variable that.order does not match with type java.lang.String of variable mapKey.role
    4Type org.hibernate.test.idprops.Order of variable order does not match with type java.lang.String of variable role
    5Unmatched return false;
    6Clone fragment #1 returns variables that , while Clone fragment #2 returns variables