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 MonetaryAmount)) return false;
final MonetaryAmount monetaryAmount = (MonetaryAmount) o;
if (!currency.equals(monetaryAmount.currency)) return false;
if (!value.equals(monetaryAmount.value)) 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/sql/hand/MonetaryAmount.java
|
Method name: boolean equals(Object)
|
|
Method name: boolean equals(Object)
|
Number of AST nodes: 10
|
|
Number of AST nodes: 10
|
|
1 | if (this == o) return true;↵ | | 1 | if (this == o) return true;↵
|
2 | if (!(o instanceof OuterKey)) return false;↵ | | 2 | if (!(o instanceof MonetaryAmount)) return false;↵
|
|
3 | final OuterKey cidDetailID = (OuterKey) o;↵ | | 3 | final ↵
|
|
4 | if (detailId != null ? !detailId.equals(cidDetailID.detailId) : cidDetailID.detailId != null) return false;↵ | | |
|
5 | if (master != null ? !master.equals(cidDetailID.master) : cidDetailID.master != null↵ | | 4 | MonetaryAmount monetaryAmount = (MonetaryAmount) o;↵
|
|
| | | 5 | if (!currency.equals(monetaryAmount.currency)) return false;↵
|
6 | ) return false;↵ | | 6 | if (!value.equals(monetaryAmount.value)) return false;↵
|
|
7 | return true; | | 7 | return true;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 25 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (this == o) | | 1 | if (this == o) |
2 | | | 2 | |
3 | if (!(o instanceof OuterKey)) | | 3 | if (!(o instanceof MonetaryAmount)) |
4 | | | 4 | |
Precondition Violations (5)
Row |
Violation |
1 | Type boolean of variable o instanceof OuterKey does not match with type boolean of variable o instanceof MonetaryAmount |
2 | Conditional return true; |
3 | Conditional return true; |
4 | Conditional return false; |
5 | Conditional return false; |