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 (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: 5
|
|
Number of AST nodes: 5
|
|
1 | if (this.ranges[i] == this.ranges[i+1]) {↵ | | 1 | if (this.ranges[i] == this.ranges[i+1]) {↵
|
2 | sb.append(escapeCharInCharClass(this.ranges[i]));↵ | | 2 | sb.append(escapeCharInCharClass(this.ranges[i]));↵
|
3 | } else {↵ | | 3 | } else {↵
|
4 | sb.append(escapeCharInCharClass(this.ranges[i]));↵ | | 4 | sb.append(escapeCharInCharClass(this.ranges[i]));↵
|
5 | sb.append('-');↵ | | 5 | sb.append('-');↵
|
6 | sb.append(escapeCharInCharClass(this.ranges[i+1]));↵ | | 6 | sb.append(escapeCharInCharClass(this.ranges[i+1]));↵
|
7 | } | | 7 | }
|
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 26 |
-
{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 |
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 |