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;
if (this == o) return true; if (!(o instanceof Country)) return false; final Country country = (Country) o; if (!name.equals(country.name)) 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/Inner.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/stats/Country.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (this == o) return true;
1
if (this == o) return true;
2
		if (!(o instanceof Inner)) return false;
2
		if (!(o instanceof Country)) return false;
3
		final Inner cidSuper = (Inner) o;
3
		final 
4
		if (id != null ? !id.equals(cidSuper.id) : cidSuper.id != null
4
Country country = (Country) o;
5
) return false;
5
		if (!name.equals(country.name)) 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.3
Clones locationClones are in different classes
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this == o)
    1
    if (this == o)
    2
    return true;
    2
    return true;
    2
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    2
    return true;
    3
    if (!(o instanceof Inner))
    3
    if (!(o instanceof Inner))
    3
    if (!(o instanceof Country))
    Differences
    Expression1Expression2Difference
    org.hibernate.test.legacy.Innerorg.hibernate.test.stats.CountryVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable o instanceof Inner does not match with type boolean of variable o instanceof Country
    • Make classes org.hibernate.test.legacy.Inner and org.hibernate.test.stats.Country extend a common superclass
    3
    if (!(o instanceof Country))
    4
    return false;
    4
    return false;
    4
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    4
    return false;
    Precondition Violations (5)
    Row Violation
    1Type boolean of variable o instanceof Inner does not match with type boolean of variable o instanceof Country
    2Conditional return true;
    3Conditional return true;
    4Conditional return false;
    5Conditional return false;