Method equals;
try {
equals = extractEqualsMethod( clazz );
}
catch ( NoSuchMethodException nsme ) {
return false; //its an interface so we can't really tell anything...
}
return !OBJECT_EQUALS.equals( equals );
Method hashCode;
try {
hashCode = extractHashCodeMethod( clazz );
}
catch ( NoSuchMethodException nsme ) {
return false; //its an interface so we can't really tell anything...
}
return !OBJECT_HASHCODE.equals( hashCode );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ReflectHelper.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ReflectHelper.java
|
Method name: boolean overridesEquals(Class)
|
|
Method name: boolean overridesHashCode(Class)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | Method equals;↵ | | 1 | Method hashCode;↵
|
2 | try {↵ | | 2 | try {↵
|
3 | equals = extractEqualsMethod( clazz );↵ | | 3 | hashCode = extractHashCodeMethod( clazz );↵
|
4 | }↵ | | 4 | }↵
|
5 | catch ( NoSuchMethodException nsme ) {↵ | | 5 | catch ( NoSuchMethodException nsme ) {↵
|
6 | return false; //its an interface so we can't really tell anything...↵ | | 6 | return false; //its an interface so we can't really tell anything...↵
|
7 | }↵ | | 7 | }↵
|
8 | return !OBJECT_EQUALS.equals( equals ); | | 8 | return !OBJECT_HASHCODE.equals( hashCode );
|
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Method equals; | | 1 | Method hashCode; |
2 | try | | 2 | try |
3 | equals = extractEqualsMethod(clazz); | | 3 | hashCode = extractHashCodeMethod(clazz); |
4 | return !OBJECT_EQUALS.equals(equals); | | 4 | return !OBJECT_HASHCODE.equals(hashCode); |
Precondition Violations (2)
Row |
Violation |
1 | Expression extractEqualsMethod(clazz) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression extractHashCodeMethod(clazz) is a method call throwing exception(s) that should be caught by a try block that will be extracted |