File path: /jruby-1.4.0/src/org/jruby/runtime/callback/InvocationCallbackFactory.java | File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/InvocationMethodFactory.java | |||
Method name: CompiledBlockCallback getBlockCallback(String, Object)
|
Method name: CompiledBlockCallback getBlockCallback(String, Object)
|
|||
Number of AST nodes: 21 | Number of AST nodes: 21 | |||
1 | Class typeClass = scriptObject.getClass();↵ | 1 | Class typeClass = scriptObject.getClass();↵ | |
2 | String typePathString = p(typeClass);↵ | 2 | String typePathString = p(typeClass);↵ | |
3 | String mname = typeClass.getName() + "BlockCallback$" + method + "xx1";↵ | 3 | String mname = typeClass.getName() + "BlockCallback$" + method + "xx1";↵ | |
4 | String mnamePath = typePathString + "BlockCallback$" + method + "xx1";↵ | 4 | String mnamePath = typePathString + "BlockCallback$" + method + "xx1";↵ | |
5 | synchronized (classLoader) {↵ | 5 | synchronized (classLoader) {↵ | |
6 | Class c = tryClass(mname);↵ | 6 | Class c = tryClass(mname);↵ | |
7 | try {↵ | 7 | try {↵ | |
8 | if (c == null) {↵ | 8 | if (c == null) {↵ | |
9 | ClassWriter cw = createBlockCtor(mnamePath, typeClass);↵ | 9 | ClassWriter cw = createBlockCtor(mnamePath, typeClass);↵ | |
10 | SkinnyMethodAdapter mv = startBlockCall(cw);↵ | 10 | SkinnyMethodAdapter mv = startBlockCall(cw);↵ | |
11 | mv.aload(0);↵ | 11 | mv.aload(0);↵ | |
12 | mv.getfield(mnamePath, "$scriptObject", ci(typeClass));↵ | 12 | mv.getfield(mnamePath, "$scriptObject", ci(typeClass));↵ | |
13 | mv.aload(1);↵ | 13 | mv.aload(1);↵ | |
14 | mv.aload(2);↵ | 14 | mv.aload(2);↵ | |
15 | mv.aload(3);↵ | 15 | mv.aload(3);↵ | |
16 | mv.invokestatic(typePathString, method, sig(↵ | 16 | mv.invokestatic(typePathString, method, sig(↵ | |
17 | RubyKernel.IRUBY_OBJECT, "L" + typePathString + ";", ThreadContext.class,↵ | 17 | RubyKernel.IRUBY_OBJECT, "L" + typePathString + ";", ThreadContext.class,↵ | |
18 | RubyKernel.IRUBY_OBJECT, IRubyObject.class));↵ | 18 | RubyKernel.IRUBY_OBJECT, IRubyObject.class));↵ | |
19 | mv.areturn();↵ | 19 | mv.areturn();↵ | |
20 | ↵ | |||
21 | mv.visitMaxs(2, 3);↵ | 20 | mv.visitMaxs(2, 3);↵ | |
22 | c = endCall(cw, mv, mname);↵ | 21 | c = endCall(cw, mv, mname);↵ | |
23 | }↵ | 22 | }↵ | |
24 | CompiledBlockCallback ic = (CompiledBlockCallback) c.getConstructor(Object.class).newInstance(scriptObject);↵ | 23 | CompiledBlockCallback ic = (CompiledBlockCallback) c.getConstructor(Object.class).newInstance(scriptObject);↵ | |
25 | return ic;↵ | 24 | return ic;↵ | |
26 | } catch (IllegalArgumentException e) {↵ | 25 | } catch (IllegalArgumentException e) {↵ | |
27 | throw e;↵ | 26 | throw e;↵ | |
28 | } catch (Exception e) {↵ | 27 | } catch (Exception e) {↵ | |
29 | e.printStackTrace();↵ | 28 | e.printStackTrace();↵ | |
30 | throw new IllegalArgumentException(e.getMessage());↵ | 29 | throw new IllegalArgumentException(e.getMessage());↵ | |
31 | }↵ | 30 | }↵ | |
32 | } | 31 |
| |
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.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 167 |
Number of mapped statements | 21 |
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) | 52.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Class typeClass = scriptObject.getClass(); | 1 | Class typeClass = scriptObject.getClass(); | ||||||||||||
2 | String typePathString = p(typeClass); | 2 | String typePathString = p(typeClass); | ||||||||||||
3 | String mname = typeClass.getName() + "BlockCallback$" + method + "xx1"; | 3 | String mname = typeClass.getName() + "BlockCallback$" + method + "xx1"; | ||||||||||||
4 | String mnamePath = typePathString + "BlockCallback$" + method + "xx1"; | 4 | String mnamePath = typePathString + "BlockCallback$" + method + "xx1"; | ||||||||||||
5 | synchronized (classLoader) | 5 | synchronized (classLoader) | ||||||||||||
6 | Class c = tryClass(mname); | 6 | Class c = tryClass(mname); | ||||||||||||
7 | try | 7 | try | ||||||||||||
8 | if (c == null) | 8 | if (c == null) | ||||||||||||
9 | ClassWriter cw = createBlockCtor(mnamePath, typeClass); | 9 | ClassWriter cw = createBlockCtor(mnamePath, typeClass); | ||||||||||||
10 | SkinnyMethodAdapter mv = startBlockCall(cw); | 10 | SkinnyMethodAdapter mv = startBlockCall(cw); | ||||||||||||
11 | mv.aload(0); | 11 | mv.aload(0); | ||||||||||||
12 | mv.getfield(mnamePath, "$scriptObject", ci(typeClass)); | 12 | mv.getfield(mnamePath, "$scriptObject", ci(typeClass)); | ||||||||||||
13 | mv.aload(1); | 13 | mv.aload(1); | ||||||||||||
14 | mv.aload(2); | 14 | mv.aload(2); | ||||||||||||
15 | mv.aload(3); | 15 | mv.aload(3); | ||||||||||||
16 | mv.invokestatic(typePathString, method, sig(RubyKernel.IRUBY_OBJECT, "L" + typePathString + ";", ThreadContext.class, RubyKernel.IRUBY_OBJECT, IRubyObject.class)); |
| 16 | mv.invokestatic(typePathString, method, sig(RubyKernel.IRUBY_OBJECT, "L" + typePathString + ";", ThreadContext.class, RubyKernel.IRUBY_OBJECT, IRubyObject.class)); | |||||||||||
17 | mv.areturn(); | 17 | mv.areturn(); | ||||||||||||
18 | mv.visitMaxs(2, 3); | 18 | mv.visitMaxs(2, 3); | ||||||||||||
19 | c = endCall(cw, mv, mname); | 19 | c = endCall(cw, mv, mname); | ||||||||||||
20 | CompiledBlockCallback ic = (CompiledBlockCallback)c.getConstructor(Object.class).newInstance(scriptObject); | 20 | CompiledBlockCallback ic = (CompiledBlockCallback)c.getConstructor(Object.class).newInstance(scriptObject); | ||||||||||||
21 | return ic; | 21 | return ic; |
Row | Violation |
---|---|
1 | Type java.lang.Class<> of variable RubyKernel.IRUBY_OBJECT does not match with type java.lang.Class<> of variable RubyKernel.IRUBY_OBJECT |