if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(",");
if (this.ranges[i] == this.ranges[i+1]) {
sb.append(escapeCharInCharClass(this.ranges[i]));
} else {
sb.append(escapeCharInCharClass(this.ranges[i]));
sb.append('-');
sb.append(escapeCharInCharClass(this.ranges[i+1]));
}
if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(",");
if (this.ranges[i] == this.ranges[i+1]) {
sb.append(escapeCharInCharClass(this.ranges[i]));
} else {
sb.append(escapeCharInCharClass(this.ranges[i]));
sb.append('-');
sb.append(escapeCharInCharClass(this.ranges[i+1]));
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
|
Method name: String toString(int)
|
|
Method name: String toString(int)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(",");↵ | | 1 | if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(",");↵
|
2 | if (this.ranges[i] == this.ranges[i+1]) {↵ | | 2 | if (this.ranges[i] == this.ranges[i+1]) {↵
|
3 | sb.append(escapeCharInCharClass(this.ranges[i]));↵ | | 3 | sb.append(escapeCharInCharClass(this.ranges[i]));↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | sb.append(escapeCharInCharClass(this.ranges[i]));↵ | | 5 | sb.append(escapeCharInCharClass(this.ranges[i]));↵
|
6 | sb.append('-');↵ | | 6 | sb.append('-');↵
|
7 | sb.append(escapeCharInCharClass(this.ranges[i+1]));↵ | | 7 | sb.append(escapeCharInCharClass(this.ranges[i+1]));↵
|
8 | } | | 8 | }
|
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.7 |
Clones location | Clones are in the same method |
Number of node comparisons | 41 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 4.5 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
14 | if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) | | 32 | if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) |
15 | | | 33 | |
16 | if (this.ranges[i] == this.ranges[i + 1]) | | 34 | if (this.ranges[i] == this.ranges[i + 1]) |
17 | sb.append(escapeCharInCharClass(this.ranges[i])); | | 35 | sb.append(escapeCharInCharClass(this.ranges[i])); |
| | | | |
18 | sb.append(escapeCharInCharClass(this.ranges[i])); | | 36 | sb.append(escapeCharInCharClass(this.ranges[i])); |
19 | | | 37 | |
20 | sb.append(escapeCharInCharClass(this.ranges[i + 1])); | | 38 | sb.append(escapeCharInCharClass(this.ranges[i + 1])); |
Precondition Violations (0)
Row |
Violation |