switch (c) {
case 'd': case 'D':
case 'w': case 'W':
case 's': case 'S':
tok.mergeRanges(this.getTokenForShorthand(c));
end = true;
break;
case 'i': case 'I':
case 'c': case 'C':
c = this.processCIinCharacterClass(tok, c);
if (c < 0) end = true;
break;
case 'p':
case 'P':
int pstart = this.offset;
RangeToken tok2 = this.processBacksolidus_pP(c);
if (tok2 == null) throw this.ex("parser.atom.5", pstart);
tok.mergeRanges(tok2);
end = true;
break;
default:
c = this.decodeEscaped();
}
switch (c)
{
case 'd':
case 'D':
case 'w':
case 'W':
case 's':
case 'S':
tok.mergeRanges(this.getTokenForShorthand(c));
end = true;
break;
case 'i':
case 'I':
case 'c':
case 'C':
c = this.processCIinCharacterClass(tok, c);
if (c < 0)
end = true;
break;
case 'p':
case 'P':
int pstart = this.offset;
RangeToken tok2 = this.processBacksolidus_pP(c);
if (tok2 == null)
throw this.ex("parser.atom.5", pstart);
tok.mergeRanges(tok2);
end = true;
break;
default:
c = this.decodeEscaped();
}
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 parseCharacterClass(boolean)
|
|
Method name: RangeToken parseCharacterClass(boolean)
|
Number of AST nodes: 29
|
|
Number of AST nodes: 29
|
|
1 | switch (c) {↵ | | 1 | switch (c)↵
|
2 | ↵ | | 2 | {↵
|
3 | case 'd':↵ | | 3 | case 'd':↵
|
4 | case 'D':↵ | | 4 | case 'D':↵
|
5 | case 'w':↵ | | 5 | case 'w':↵
|
6 | case 'W':↵ | | 6 | case 'W':↵
|
7 | case 's':↵ | | 7 | case 's':↵
|
8 | case 'S':↵ | | 8 | case 'S':↵
|
9 | tok.mergeRanges(this.getTokenForShorthand(c));↵ | | 9 | tok.mergeRanges(this.getTokenForShorthand(c));↵
|
10 | end = true;↵ | | 10 | end = true;↵
|
11 | break;↵ | | 11 | break;↵
|
|
12 | case 'i':↵ | | 12 | case 'i':↵
|
13 | case 'I':↵ | | 13 | case 'I':↵
|
14 | case 'c':↵ | | 14 | case 'c':↵
|
15 | case 'C':↵ | | 15 | case 'C':↵
|
16 | c = this.processCIinCharacterClass(tok, c);↵ | | 16 | c = this.processCIinCharacterClass(tok, c);↵
|
17 | if (c < 0) end = true;↵ | | 17 | if (c < 0)↵
|
18 | break;↵ | | 18 | end = true;↵
|
19 | ↵ | | 19 | break;↵
|
|
20 | case 'p':↵ | | 20 | case 'p':↵
|
21 | case 'P':↵ | | 21 | case 'P':↵
|
22 | int pstart = this.offset;↵ | | 22 | int pstart = this.offset;↵
|
23 | RangeToken tok2 = this.processBacksolidus_pP(c);↵ | | 23 | RangeToken tok2 = this.processBacksolidus_pP(c);↵
|
24 | if (tok2 == null)↵ | | 24 | if (tok2 == null)↵
|
25 | throw this.ex("parser.atom.5", pstart);↵ | | 25 | throw this.ex("parser.atom.5", pstart);↵
|
26 | tok.mergeRanges(tok2);↵ | | 26 | tok.mergeRanges(tok2);↵
|
27 | end = true;↵ | | 27 | end = true;↵
|
28 | break;↵ | | 28 | break;↵
|
|
29 | default:↵ | | 29 | default:↵
|
30 | c = this.decodeEscaped();↵ | | 30 | c = this.decodeEscaped();↵
|
31 | } | | 31 | }
|
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.4 |
Clones location | Clones are in the same java file |
Number of node comparisons | 341 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 29 |
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) | 52.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
22 | switch (c) | | 22 | switch (c) |
23 | | | 23 | |
24 | | | 24 | |
25 | | | 25 | |
26 | | | 26 | |
27 | | | 27 | |
28 | | | 28 | |
29 | tok.mergeRanges(this.getTokenForShorthand(c)); | | 29 | tok.mergeRanges(this.getTokenForShorthand(c)); |
30 | | | 30 | |
31 | | | 31 | |
32 | | | 32 | |
33 | | | 33 | |
34 | | | 34 | |
35 | | | 35 | |
36 | c = this.processCIinCharacterClass(tok, c); | | 36 | c = this.processCIinCharacterClass(tok, c); |
37 | | | 37 | |
38 | | | 38 | |
39 | | | 39 | |
40 | | | 40 | |
41 | | | 41 | |
42 | int pstart = this.offset; | | 42 | int pstart = this.offset; |
43 | RangeToken tok2 = this.processBacksolidus_pP(c); | | 43 | RangeToken tok2 = this.processBacksolidus_pP(c); |
44 | | | 44 | |
45 | throw this.ex("parser.atom.5", pstart); | | 45 | throw this.ex("parser.atom.5", pstart); |
46 | | | 46 | |
47 | | | 47 | |
48 | | | 48 | |
49 | | | 49 | |
50 | c = this.decodeEscaped(); | | 50 | c = this.decodeEscaped(); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables end, c , while Clone fragment #2 returns variables end, c |