String[] intfs = classFile.getInterfaces();
for ( int i = 0; i < intfs.length; i++ ) {
if ( FieldHandled.class.getName().equals( intfs[i] ) ) {
return true;
}
}
return false;
String[] intfs = classfile.getInterfaces();
for ( int i = 0; i < intfs.length; i++ ) {
if ( FieldHandled.class.getName().equals( intfs[i] ) ) {
return true;
}
}
return false;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/buildtime/JavassistInstrumenter.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/javassist/JavassistClassTransformer.java
|
Method name: boolean isInstrumented()
|
|
Method name: boolean alreadyInstrumented(ClassFile)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | String[] intfs = classFile.getInterfaces();↵ | | 1 | String[] intfs = classfile.getInterfaces();
↵
|
2 | for ( int i = 0; i < intfs.length; i++ ) {↵ | | 2 | for ( int i = 0; i < intfs.length; i++ ) {
↵
|
3 | if ( FieldHandled.class.getName().equals( intfs[i] ) ) {↵ | | 3 | if ( FieldHandled.class.getName().equals( intfs[i] ) ) {
↵
|
4 | return true;↵ | | 4 | return true;
↵
|
5 | }↵ | | 5 | }
↵
|
6 | }↵ | | 6 | ↵
|
7 | ↵ | | 7 | }↵
|
8 | return false; | | 8 | return false;
|
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.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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 | String[] intfs = classFile.getInterfaces(); | | 1 | String[] intfs = classfile.getInterfaces(); |
2 | for (int i = 0; i < intfs.length; i++) | | 2 | for (int i = 0; i < intfs.length; i++) |
3 | if (FieldHandled.class.getName().equals(intfs[i])) | | 3 | if (FieldHandled.class.getName().equals(intfs[i])) |
4 | | | 4 | |
5 | return false; | | 5 | return false; |
Precondition Violations (1)
Row |
Violation |
1 | The refactoring of the clones is infeasible, because classes org.hibernate.bytecode.buildtime.JavassistInstrumenter.CustomClassDescriptor and org.hibernate.bytecode.javassist.JavassistClassTransformer do not have a common superclass |