ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, namePath, null, SUPER_CLASS, null);
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, SUPER_CLASS, "<init>", "()V");
Label line = new Label();
mv.visitLineNumber(0, line);
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
return cw;
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, namePath, null, FAST_SUPER_CLASS, null);
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, FAST_SUPER_CLASS, "<init>", "()V");
Label line = new Label();
mv.visitLineNumber(0, line);
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
return cw;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/callback/InvocationCallbackFactory.java
|
|
File path: /jruby-1.4.0/src/org/jruby/runtime/callback/InvocationCallbackFactory.java
|
Method name: ClassWriter createCtor(String)
|
|
Method name: ClassWriter createCtorFast(String)
|
Number of AST nodes: 12
|
|
Number of AST nodes: 12
|
|
1 | ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);↵ | | 1 | ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);↵
|
2 | cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, namePath, null, SUPER_CLASS, null);↵ | | 2 | cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, namePath, null, FAST_SUPER_CLASS, null);↵
|
3 | MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);↵ | | 3 | MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);↵
|
4 | mv.visitCode();↵ | | 4 | mv.visitCode();↵
|
5 | mv.visitVarInsn(ALOAD, 0);↵ | | 5 | mv.visitVarInsn(ALOAD, 0);↵
|
6 | mv.visitMethodInsn(INVOKESPECIAL, SUPER_CLASS, "<init>", "()V");↵ | | 6 | mv.visitMethodInsn(INVOKESPECIAL, FAST_SUPER_CLASS, "<init>", "()V");↵
|
7 | Label line = new Label();↵ | | 7 | Label line = new Label();↵
|
8 | mv.visitLineNumber(0, line);↵ | | 8 | mv.visitLineNumber(0, line);↵
|
9 | mv.visitInsn(RETURN);↵ | | 9 | mv.visitInsn(RETURN);↵
|
10 | mv.visitMaxs(1, 1);↵ | | 10 | mv.visitMaxs(1, 1);↵
|
11 | mv.visitEnd();↵ | | 11 | mv.visitEnd();↵
|
12 | return cw; | | 12 | return cw;
|
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 103 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 12 |
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); | | 1 | ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); |
2 | cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, namePath, null, SUPER_CLASS, null); | | 2 | cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, namePath, null, FAST_SUPER_CLASS, null); |
3 | MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); | | 3 | MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); |
4 | mv.visitCode(); | | 4 | mv.visitCode(); |
5 | mv.visitVarInsn(ALOAD, 0); | | 5 | mv.visitVarInsn(ALOAD, 0); |
6 | mv.visitMethodInsn(INVOKESPECIAL, SUPER_CLASS, "<init>", "()V"); | | 6 | mv.visitMethodInsn(INVOKESPECIAL, FAST_SUPER_CLASS, "<init>", "()V"); |
7 | Label line = new Label(); | | 7 | Label line = new Label(); |
8 | mv.visitLineNumber(0, line); | | 8 | mv.visitLineNumber(0, line); |
9 | mv.visitInsn(RETURN); | | 9 | mv.visitInsn(RETURN); |
10 | mv.visitMaxs(1, 1); | | 10 | mv.visitMaxs(1, 1); |
11 | mv.visitEnd(); | | 11 | mv.visitEnd(); |
12 | return cw; | | 12 | return cw; |
Precondition Violations (0)
Row |
Violation |