if (replValue.realSize != plen) {
int src = value.begin + beg + plen;
int dst = value.begin + beg + replValue.realSize;
int length = value.realSize - beg - plen;
System.arraycopy(value.bytes, src, value.bytes, dst, length);
}
if (replValue.realSize != plen) {
int src = value.begin + beg + plen;
int dst = value.begin + beg + replValue.realSize;
int length = value.realSize - beg - plen;
System.arraycopy(value.bytes, src, value.bytes, dst, length);
}
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 subBangCommon19(ThreadContext, Regex, Matcher, RubyString, int)
|
|
Method name: IRubyObject subBangCommon(ThreadContext, Regex, Matcher, RubyString, int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (replValue.realSize != plen) {↵ | | 1 | if (replValue.realSize != plen) {↵
|
2 | int src = value.begin + beg + plen;↵ | | 2 | int src = value.begin + beg + plen;↵
|
3 | int dst = value.begin + beg + replValue.realSize;↵ | | 3 | int dst = value.begin + beg + replValue.realSize;↵
|
4 | int length = value.realSize - beg - plen;↵ | | 4 | int length = value.realSize - beg - plen;↵
|
5 | System.arraycopy(value.bytes, src, value.bytes, dst, length);↵ | | 5 | System.arraycopy(value.bytes, src, value.bytes, dst, length);↵
|
6 | } | | 6 | }
|
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 | 25 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
18 | if (replValue.realSize != plen) | | 7 | if (replValue.realSize != plen) |
19 | int src = value.begin + beg + plen; | | 8 | int src = value.begin + beg + plen; |
20 | int dst = value.begin + beg + replValue.realSize; | | 9 | int dst = value.begin + beg + replValue.realSize; |
21 | int length = value.realSize - beg - plen; | | 10 | int length = value.realSize - beg - plen; |
22 | System.arraycopy(value.bytes, src, value.bytes, dst, length); | | 11 | System.arraycopy(value.bytes, src, value.bytes, dst, length); |
Precondition Violations (0)
Row |
Violation |