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.2 |
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.9 |
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 org.hibernate.test.cache.jbc2.functional.classloader.AccountHolder does not match with type org.hibernate.test.sql.hand.MonetaryAmount |
2 | Expression pk.lastName cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression monetaryAmount.currency cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Type java.lang.String of variable pk.lastName does not match with type java.util.Currency of variable monetaryAmount.currency |
5 | Expression pk.lastName cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression monetaryAmount.currency cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Type java.lang.String of variable pk.lastName does not match with type java.util.Currency of variable monetaryAmount.currency |
8 | Type java.lang.String of variable lastName does not match with type java.util.Currency of variable currency |
9 | Expression pk.ssn cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression monetaryAmount.value cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Type java.lang.String of variable pk.ssn does not match with type java.math.BigDecimal of variable monetaryAmount.value |
12 | Expression pk.ssn cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression monetaryAmount.value cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Type java.lang.String of variable pk.ssn does not match with type java.math.BigDecimal of variable monetaryAmount.value |
15 | Type java.lang.String of variable ssn does not match with type java.math.BigDecimal of variable value |
16 | Not all possible execution flows end in a return statement |