File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/Group.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/Membership.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 Group ) { ↵ | 4 | if ( obj instanceof Membership ) {↵ | |
5 | Group grp = ( Group ) obj; ↵ | 5 | Membership mem = ( Membership ) obj;↵ | |
6 | if ( grp.getName() != null && name != null ) { ↵ | 6 | if ( mem.getName() != null && name != null ) {↵ | |
7 | return grp.getName().equals( name ); ↵ | 7 | return mem.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) | 1.2 |
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) | 3.0 |
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 Group) |
| 3 | if (obj instanceof Membership) | ||||||||||||||
|
| 4 | Membership mem = (Membership)obj; | |||||||||||||||
4 | Group grp = (Group)obj; |
| | |||||||||||||||
5 | if (grp.getName() != null && name != null) |
| 5 | if (mem.getName() != null && name != null) | ||||||||||||||
6 | return grp.getName().equals(name); |
| 6 | return mem.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.Group does not match with type org.hibernate.test.manytomanyassociationclass.Membership |
2 | Unmatched statement Membership mem=(Membership)obj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement Group grp=(Group)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.Group of variable grp does not match with type org.hibernate.test.manytomanyassociationclass.Membership of variable mem |
5 | Type org.hibernate.test.manytomanyassociationclass.Group of variable grp does not match with type org.hibernate.test.manytomanyassociationclass.Membership of variable mem |
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 |