int beg = RubyNumeric.num2int(arg0);
int len = RubyNumeric.num2int(arg1);
checkLength(len);
RubyString repl = arg2.convertToString();
replaceInternal(checkIndex(beg, value.realSize), len, repl);
int beg = RubyNumeric.num2int(arg0);
int len = RubyNumeric.num2int(arg1);
checkLength(len);
RubyString repl = arg2.convertToString();
replaceInternal19(checkIndex(beg, strLength()), len, repl);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyString.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyString.java
|
Method name: IRubyObject op_aset(ThreadContext, IRubyObject, IRubyObject, IRubyObject)
|
|
Method name: IRubyObject op_aset19(ThreadContext, IRubyObject, IRubyObject, IRubyObject)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | int beg = RubyNumeric.num2int(arg0);↵ | | 1 | int beg = RubyNumeric.num2int(arg0);↵
|
2 | int len = RubyNumeric.num2int(arg1);↵ | | 2 | int len = RubyNumeric.num2int(arg1);↵
|
3 | checkLength(len);↵ | | 3 | checkLength(len);↵
|
4 | RubyString repl = arg2.convertToString();↵ | | 4 | RubyString repl = arg2.convertToString();↵
|
5 | replaceInternal(checkIndex(beg, value.realSize), len, repl); | | 5 | replaceInternal19(checkIndex(beg, strLength()), len, repl);
|
See real code fragment |
|
See real code fragment |
Summary
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 declared in the same class |
Number of node comparisons | 25 |
-
{Non-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) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | int beg = RubyNumeric.num2int(arg0); | | 3 | int beg = RubyNumeric.num2int(arg0); |
4 | int len = RubyNumeric.num2int(arg1); | | 4 | int len = RubyNumeric.num2int(arg1); |
5 | checkLength(len); | | 5 | checkLength(len); |
6 | RubyString repl = arg2.convertToString(); | | 6 | RubyString repl = arg2.convertToString(); |
| | | 7 | replaceInternal19(checkIndex(beg, strLength()), len, repl); |
7 | replaceInternal(checkIndex(beg, value.realSize), len, repl); | | | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables beg, len, repl , while Clone fragment #2 returns variables beg, len, repl |