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/javassist/JavassistClassTransformer.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/buildtime/JavassistInstrumenter.java
|
Method name: boolean alreadyInstrumented(ClassFile)
|
|
Method name: boolean isInstrumented()
|
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 | 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 | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{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.6 |
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 (0)
Row |
Violation |