File path: /jruby-1.4.0/src/org/jruby/RubyObjectSpace.java | File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java | |||
Method name: IRubyObject id2ref(IRubyObject, IRubyObject)
|
Method name: JavaClass get(Ruby, Class>)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | IRubyObject object = runtime.getObjectSpace().id2ref(longId);↵ | |||
2 | ↵ | 1 | JavaClass javaClass = runtime.getJavaSupport().getJavaClassFromCache(klass);↵ | |
3 | if (object == null) {↵ | 2 | if (javaClass == null) {↵ | |
4 | return runtime.getNil();↵ | 3 | javaClass = createJavaClass(runtime,klass);↵ | |
5 | }↵ | 4 | ↵ | |
6 | ↵ | 5 | }↵ | |
7 | return object; | 6 | return javaClass; | |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | JavaClass javaClass = runtime.getJavaSupport().getJavaClassFromCache(klass); | ||||||||||||||||
14 | IRubyObject object = runtime.getObjectSpace().id2ref(longId); | | ||||||||||||||||
15 | if (object == null) |
| 2 | if (javaClass == null) | ||||||||||||||
|
| 3 | javaClass = createJavaClass(runtime, klass); | |||||||||||||||
16 | return runtime.getNil(); |
| | |||||||||||||||
|
| 4 | return javaClass; | |||||||||||||||
17 | return object; |
| |
Row | Violation |
---|---|
1 | Type org.jruby.runtime.builtin.IRubyObject of variable object does not match with type org.jruby.javasupport.JavaClass of variable javaClass |
2 | Unmatched statement javaClass=createJavaClass(runtime,klass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return runtime.getNil(); |
4 | Unmatched return javaClass; |
5 | Unmatched return object; |