File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/Membership.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/User.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if ( this == obj ) {↵ | 1 | if ( this == obj ) { ↵ | |
2 | return true;↵ | 2 | return true; ↵ | |
3 | }↵ | 3 | } ↵ | |
4 | if ( obj instanceof Membership ) {↵ | 4 | if ( obj instanceof User ) { ↵ | |
5 | Membership mem = ( Membership ) obj;↵ | 5 | User user = ( User ) obj; ↵ | |
6 | if ( mem.getName() != null && name != null ) {↵ | 6 | if ( user.getName() != null && name != null ) { ↵ | |
7 | return mem.getName().equals( name );↵ | 7 | return user.getName().equals( name ); ↵ | |
8 | }↵ | 8 | } ↵ | |
9 | else {↵ | 9 | else { ↵ | |
10 | return super.equals( obj );↵ | 10 | return super.equals( obj ); ↵ | |
11 | }↵ | 11 | } ↵ | |
12 | }↵ | 12 | } ↵ | |
13 | else {↵ | 13 | else { ↵ | |
14 | return false;↵ | 14 | return false; ↵ | |
15 | } | 15 |
| |
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.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 22 |
Number of mapped statements | 7 |
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.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this == obj) | 1 | if (this == obj) | |||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||
3 | if (obj instanceof Membership) |
| 3 | if (obj instanceof User) | ||||||||||||||
|
| 4 | User user = (User)obj; | |||||||||||||||
4 | Membership mem = (Membership)obj; |
| | |||||||||||||||
5 | if (mem.getName() != null && name != null) |
| 5 | if (user.getName() != null && name != null) | ||||||||||||||
6 | return mem.getName().equals(name); |
| 6 | return user.getName().equals(name); | ||||||||||||||
else | else | |||||||||||||||||
7 | return super.equals(obj); |
| 7 | return super.equals(obj); | ||||||||||||||
else | else | |||||||||||||||||
8 | return false; | 8 | return false; |
Row | Violation |
---|---|
1 | Type org.hibernate.test.manytomanyassociationclass.Membership does not match with type org.hibernate.test.manytomanyassociationclass.User |
2 | Unmatched statement User user=(User)obj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement Membership mem=(Membership)obj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Type org.hibernate.test.manytomanyassociationclass.Membership of variable mem does not match with type org.hibernate.test.manytomanyassociationclass.User of variable user |
5 | Type org.hibernate.test.manytomanyassociationclass.Membership of variable mem does not match with type org.hibernate.test.manytomanyassociationclass.User of variable user |
6 | Super method call return super.equals(obj); cannot be extracted from method |
7 | Super method call return super.equals(obj); cannot be extracted from method |