RubyString str = (RubyString) getLastlineString(context, context.getRuntime()).dup();
if (!str.sub_bang(context, arg0, block).isNil()) {
context.getCurrentScope().setLastLine(str);
}
return str;
RubyString str = (RubyString) getLastlineString(context, context.getRuntime()).dup();
if (!str.gsub_bang(context, args, block).isNil()) {
context.getCurrentScope().setLastLine(str);
}
return str;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyKernel.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyKernel.java
|
Method name: IRubyObject sub(ThreadContext, IRubyObject, IRubyObject, Block)
|
|
Method name: IRubyObject gsub(ThreadContext, IRubyObject, IRubyObject[], Block)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | RubyString str = (RubyString) getLastlineString(context, context.getRuntime()).dup();↵ | | 1 | RubyString str = (RubyString) getLastlineString(context, context.getRuntime()).dup();↵
|
|
2 | if (!str.sub_bang(context, arg0, block).isNil()) {↵ | | 2 | if (!str.gsub_bang(context, args, block).isNil()) {↵
|
3 | context.getCurrentScope().setLastLine(str);↵ | | 3 | context.getCurrentScope().setLastLine(str);↵
|
4 | }↵ | | 4 | }↵
|
|
5 | return str; | | 5 | return str;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 1 |