if (cl != 1) {
while (cl-- > 0 && p < end) obytes[op++] = bytes[p++];
p--;
continue;
}
if (cl != 1) {
while (cl-- > 0 && p < end) p++;
p--;
continue;
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyRegexp.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyRegexp.java
|
Method name: ByteList quote(ByteList, Encoding)
|
|
Method name: ByteList quote(ByteList, Encoding)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (cl != 1) {↵ | | 1 | if (cl != 1) {↵
|
2 | while (cl-- > 0 && p < end) obytes[op++] = bytes[p++];↵ | | 2 | while (cl-- > 0 && p < end) ↵
|
| | | 3 | p++;↵
|
3 | p--;↵ | | 4 | p--;↵
|
4 | continue;↵ | | 5 | continue;↵
|
5 | } | | 6 | }
|
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.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 17 |
-
{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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
44 | if (cl != 1) | | 7 | if (cl != 1) |
45 | while (cl-- > 0 && p < end) | | 8 | while (cl-- > 0 && p < end) |
| | | 9 | |
46 | obytes[op++] = bytes[p++]; | | | |
47 | | | 10 | |
48 | | | 11 | |
Precondition Violations (4)
Row |
Violation |
1 | Unmatched statement p++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement obytes[op++]=bytes[p++]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Statement continue; without innermost loop |
4 | Statement continue; without innermost loop |