File path: /jruby-1.4.0/src/org/jruby/JRubyApplet.java | File path: /jruby-1.4.0/src/org/jruby/ext/WeakRef.java | |||
Method name: RubyProc blockToProc(Ruby, Block)
|
Method name: IRubyObject getobj()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | RubyProc proc = block.getProcObject();↵ | 1 | IRubyObject obj = ref.get();↵ | |
2 | ↵ | 2 | ↵ | |
3 | if (proc == null) {↵ | 3 | if (obj == null) {↵ | |
4 | proc = RubyProc.newProc(runtime, block, block.type);↵ | 4 | ↵ | |
5 | ↵ | 5 | // FIXME weakref.rb also does caller(2) here for the backtrace↵ | |
6 | throw newRefError("Illegal Reference - probably recycled");↵ | |||
6 | }↵ | 7 | }↵ | |
7 | ↵ | 8 | ↵ | |
8 | return proc; | 9 | return obj; | |
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.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | IRubyObject obj = ref.get(); | ||||||||||||||||
2 | RubyProc proc = block.getProcObject(); | | ||||||||||||||||
3 | if (proc == null) |
| 2 | if (obj == null) | ||||||||||||||
|
| 3 | throw newRefError("Illegal Reference - probably recycled"); | |||||||||||||||
4 | proc = RubyProc.newProc(runtime, block, block.type); |
| | |||||||||||||||
|
| 4 | return obj; | |||||||||||||||
5 | return proc; |
| |
Row | Violation |
---|---|
1 | Type org.jruby.RubyProc of variable proc does not match with type org.jruby.runtime.builtin.IRubyObject of variable obj |
2 | Unmatched throw newRefError("Illegal Reference - probably recycled"); |
3 | Unmatched statement proc=RubyProc.newProc(runtime,block,block.type); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return obj; |
5 | Unmatched return proc; |