File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/stats/Country.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: 8 | Number of AST nodes: 10 | |||
1 | if (this == o) return true;↵ | 1 | if (this == o) return true;↵ | |
2 | if (!(o instanceof Country)) return false;↵ | 2 | if (!(o instanceof MonetaryAmount)) return false;↵ | |
3 | final Country country = (Country) o;↵ | 3 | final ↵ | |
4 | if (!name.equals(country.nam↵ | 4 | MonetaryAmount monetaryAmount = (MonetaryAmount) o;↵ | |
5 | if (!currency.equals(monetaryAmount.currency)) return false;↵ | |||
5 | e)) return false;↵ | 6 | if (!value.equals(monetaryAmount.value)) return false;↵ | |
6 | return true; | 7 |
| |
See real code fragment | See real code fragment |
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.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 34 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this == o) | 1 | if (this == o) | |||||||||||||||||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||||||||||||||||
3 | if (!(o instanceof Country)) |
| 3 | if (!(o instanceof MonetaryAmount)) | ||||||||||||||||||||||||||||
4 | return false; | 4 | return false; | |||||||||||||||||||||||||||||
| 5 | final MonetaryAmount monetaryAmount = (MonetaryAmount)o; | ||||||||||||||||||||||||||||||
5 | final Country country = (Country)o; | | ||||||||||||||||||||||||||||||
6 | if (!name.equals(country.name)) |
| 6 | if (!currency.equals(monetaryAmount.currency)) | ||||||||||||||||||||||||||||
7 | return false; | 7 | return false; | |||||||||||||||||||||||||||||
| 8 | if (!value.equals(monetaryAmount.value)) | ||||||||||||||||||||||||||||||
|
| 9 | return false; | |||||||||||||||||||||||||||||
8 | return true; | 10 | return true; |
Row | Violation |
---|---|
1 | Type boolean of variable o instanceof Country does not match with type boolean of variable o instanceof MonetaryAmount |
2 | Type org.hibernate.test.stats.Country of variable country does not match with type org.hibernate.test.sql.hand.MonetaryAmount of variable monetaryAmount |
3 | Type java.lang.String of variable country.name does not match with type java.util.Currency of variable monetaryAmount.currency |
4 | Type java.lang.String of variable name does not match with type java.util.Currency of variable currency |
5 | Unmatched return false; |