for (int ch = this.ranges[i]; ch <= this.ranges[i+1]; ch ++) {
if (ch > 0xffff)
uppers.addRange(ch, ch);
else {
char uch = Character.toUpperCase((char)ch);
uppers.addRange(uch, uch);
}
}
for (int ch = uppers.ranges[i]; ch <= uppers.ranges[i+1]; ch ++) {
if (ch > 0xffff)
lowers.addRange(ch, ch);
else {
char uch = Character.toUpperCase((char)ch);
lowers.addRange(uch, uch);
}
}
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: RangeToken getCaseInsensitiveToken()
|
|
Method name: RangeToken getCaseInsensitiveToken()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | for (int ch = this.ranges[i]; ch <= this.ranges[i+1]; ch ++) {↵ | | 1 | for (int ch = uppers.ranges[i]; ch <= uppers.ranges[i+1]; ch ++) {↵
|
2 | if (ch > 0xffff)↵ | | 2 | if (ch > 0xffff)↵
|
3 | uppers.addRange(ch, ch);↵ | | 3 | lowers.addRange(ch, ch);↵
|
4 | else {↵ | | 4 | else {↵
|
5 | char uch = Character.toUpperCase((char)ch);↵ | | 5 | char uch = Character.toUpperCase((char)ch);↵
|
6 | uppers.addRange(uch, uch);↵ | | 6 | lowers.addRange(uch, uch);↵
|
7 | }↵ | | 7 | }↵
|
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 24 |
-
{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) | 2.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | for (int ch = this.ranges[i]; ch <= this.ranges[i + 1]; ch++) | | 12 | for (int ch = uppers.ranges[i]; ch <= uppers.ranges[i + 1]; ch++) |
6 | | | 13 | |
7 | | | 14 | |
| | | | |
8 | char uch = Character.toUpperCase((char)ch); | | 15 | char uch = Character.toUpperCase((char)ch); |
9 | uppers.addRange(uch, uch); | | 16 | lowers.addRange(uch, uch); |
Precondition Violations (0)
Row |
Violation |