File path: /jruby-1.4.0/src/org/jruby/RubyMethod.java | File path: /jruby-1.4.0/src/org/jruby/RubyUnboundMethod.java | |||
Method name: RubyClass createMethodClass(Ruby)
|
Method name: RubyClass defineUnboundMethodClass(Ruby)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | RubyClass methodClass = ↵ | 1 | RubyClass newClass = ↵ | |
2 | runtime.defineClass("Method", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);↵ | 2 | runtime.defineClass("UnboundMethod", runtime.getMethod(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);↵ | |
3 | runtime.setMethod(methodClass);↵ | 3 | runtime.setUnboundMethod(newClass);↵ | |
4 | ↵ | |||
5 | methodClass.defineAnnotatedMethods(RubyMethod.class);↵ | 4 | newClass.defineAnnotatedMethods(RubyUnboundMethod.class);↵ | |
6 | ↵ | |||
7 | return methodClass; | 5 | return newClass; | |
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) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 16 |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | RubyClass methodClass = runtime.defineClass("Method", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR); |
| 1 | RubyClass newClass = runtime.defineClass("UnboundMethod", runtime.getMethod(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR); | |||||||||||||||||
2 | runtime.setMethod(methodClass); |
| 2 | runtime.setUnboundMethod(newClass); | |||||||||||||||||
3 | methodClass.defineAnnotatedMethods(RubyMethod.class); |
| 3 | newClass.defineAnnotatedMethods(RubyUnboundMethod.class); | |||||||||||||||||
4 | return methodClass; |
| 4 | return newClass; |
Row | Violation |
---|---|
1 | Expression runtime.setMethod(methodClass) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression runtime.setUnboundMethod(newClass) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression runtime.setMethod(methodClass) is a void method call, and thus it cannot be parameterized |
4 | Expression runtime.setUnboundMethod(newClass) is a void method call, and thus it cannot be parameterized |