if (this == other) return this;
setCodeRange(replaceCommon(other).getCodeRange()); // encoding doesn't have to be copied.
return this;
if (this == other) return this;
replaceCommon(other);
return this;
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: RubyString replace19(IRubyObject)
|
|
Method name: IRubyObject replace(IRubyObject)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (this == other) return this;↵ | | 1 | if (this == other) return this;↵
|
2 | setCodeRange(replaceCommon(other).getCodeRange()); // encoding doesn't have to be copied.↵ | | 2 | replaceCommon(other);↵
|
3 | return this; | | 3 | return this;
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (this == other) | | 1 | if (this == other) |
2 | | | 2 | |
| | | 3 | replaceCommon(other); |
3 | setCodeRange(replaceCommon(other).getCodeRange()); | | | |
4 | return this; | | 4 | return this; |
Precondition Violations (0)
Row |
Violation |