if (type != Block.Type.LAMBDA && block.getProcObject() != null) return block.getProcObject();
RubyProc proc = RubyProc.newProc(this, type);
proc.initialize(getCurrentContext(), block);
return proc;
if (type != Block.Type.LAMBDA && block.getProcObject() != null) return block.getProcObject();
RubyProc proc = RubyProc.newProc(this, type);
proc.callInit(IRubyObject.NULL_ARRAY, block);
return proc;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/Ruby.java
|
|
File path: /jruby-1.4.0/src/org/jruby/Ruby.java
|
Method name: RubyProc newBlockPassProc(Block.Type, Block)
|
|
Method name: RubyProc newProc(Block.Type, Block)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (type != Block.Type.LAMBDA && block.getProcObject() != null) return block.getProcObject();↵ | | 1 | if (type != Block.Type.LAMBDA && block.getProcObject() != null) return block.getProcObject();↵
|
|
2 | RubyProc proc = RubyProc.newProc(this, type);↵ | | 2 | RubyProc proc = RubyProc.newProc(this, type);↵
|
|
3 | proc.initialize(getCurrentContext(), block);↵ | | 3 | proc.callInit(IRubyObject.NULL_ARRAY, block);↵
|
|
4 | return proc; | | 4 | return proc;
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (type != Block.Type.LAMBDA && block.getProcObject() != null) | | 1 | if (type != Block.Type.LAMBDA && block.getProcObject() != null) |
2 | return block.getProcObject(); | | 2 | return block.getProcObject(); |
3 | RubyProc proc = RubyProc.newProc(this, type); | | 3 | RubyProc proc = RubyProc.newProc(this, type); |
| | | 4 | proc.callInit(IRubyObject.NULL_ARRAY, block); |
4 | proc.initialize(getCurrentContext(), block); | | | |
5 | return proc; | | 5 | return proc; |
Precondition Violations (0)
Row |
Violation |