File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/classloader/AccountHolder.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 (obj == this) return true;↵ | 1 | if (this == o) return true;↵ | |
2 | ↵ | |||
3 | if (!(obj instanceof AccountHolder)) return false;↵ | 2 | if (!(o instanceof MonetaryAmount)) return false;↵ | |
4 | AccountHolder pk = (AccountHolder)obj;↵ | |||
5 | if (!lastName.equals(pk.lastName)) return false;↵ | |||
6 | if (!ssn.equals(pk.ssn↵ | |||
3 | final MonetaryAmount monetaryAmount = (MonetaryAmount) o;↵ | |||
4 | if (!currency.equals(monetaryAmount.currency)) return false;↵ | |||
7 | )) return false;↵ | 5 | if (!value.equals(monetaryAmount.value)) return false;↵ | |
8 | ↵ | |||
9 | return true; | 6 | return true; | |
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) | 1.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 35 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (!(obj instanceof AccountHolder)) |
| 3 | if (!(o instanceof MonetaryAmount)) | ||||||||||||||||||||||||||||
4 | return false; |
| 4 | return false; | ||||||||||||||||||||||||||||
| 5 | final MonetaryAmount monetaryAmount = (MonetaryAmount)o; | ||||||||||||||||||||||||||||||
5 | AccountHolder pk = (AccountHolder)obj; | | ||||||||||||||||||||||||||||||
6 | if (!lastName.equals(pk.lastName)) |
| 6 | if (!currency.equals(monetaryAmount.currency)) | ||||||||||||||||||||||||||||
7 | return false; |
| 7 | return false; | ||||||||||||||||||||||||||||
8 | if (!ssn.equals(pk.ssn)) |
| 8 | if (!value.equals(monetaryAmount.value)) | ||||||||||||||||||||||||||||
9 | return false; |
| 9 | return false; |
Row | Violation |
---|---|
1 | Type boolean of variable obj instanceof AccountHolder does not match with type boolean of variable o instanceof MonetaryAmount |
2 | Type org.hibernate.test.cache.jbc2.functional.classloader.AccountHolder of variable pk does not match with type org.hibernate.test.sql.hand.MonetaryAmount of variable monetaryAmount |
3 | Type java.lang.String of variable pk.lastName does not match with type java.util.Currency of variable monetaryAmount.currency |
4 | Type java.lang.String of variable lastName does not match with type java.util.Currency of variable currency |
5 | Type org.hibernate.test.cache.jbc2.functional.classloader.AccountHolder of variable pk does not match with type org.hibernate.test.sql.hand.MonetaryAmount of variable monetaryAmount |
6 | Type java.lang.String of variable pk.ssn does not match with type java.math.BigDecimal of variable monetaryAmount.value |
7 | Type java.lang.String of variable ssn does not match with type java.math.BigDecimal of variable value |
8 | Conditional return false; |
9 | Conditional return false; |
10 | Conditional return false; |
11 | Conditional return false; |
12 | Conditional return false; |
13 | Conditional return false; |