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: int matchesIgnoreCase(CharacterIterator, int, int)
|
Method name: int matchesIgnoreCase(String, int, int)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 16 | |||
1 | int pindex = plength;↵ | 1 | int pindex = plength;↵ | |
2 | int nindex = index + 1;↵ | 2 | int nindex = index + 1;↵ | |
3 | char ch;↵ | 3 | char ch;↵ | |
4 | do↵ | 4 | do↵ | |
5 | {↵ | 5 | {↵ | |
6 | char ch1 = ch = iterator.setIndex(--index);↵ | 6 | char ch1 = ch = text.charAt(--index);↵ | |
7 | char ch2 = this.pattern[--pindex];↵ | 7 | char ch2 = this.pattern[--pindex];↵ | |
8 | if (ch1 != ch2)↵ | 8 | if (ch1 != ch2)↵ | |
9 | {↵ | 9 | {↵ | |
10 | ch1 = Character.toUpperCase(ch1);↵ | 10 | ch1 = Character.toUpperCase(ch1);↵ | |
11 | ch2 = Character.toUpperCase(ch2);↵ | 11 | ch2 = Character.toUpperCase(ch2);↵ | |
12 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))↵ | 12 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))↵ | |
13 | break;↵ | 13 | break;↵ | |
14 | }↵ | 14 | }↵ | |
15 | if (pindex == 0)↵ | 15 | if (pindex == 0)↵ | |
16 | return index;↵ | 16 | return index;↵ | |
17 | }↵ | 17 | }↵ | |
18 | while (pindex > 0);↵ | 18 | while (pindex > 0);↵ | |
19 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | 19 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | |
20 | if (index < nindex)↵ | 20 | if (index < nindex)↵ | |
21 | index = nindex; | 21 |
| |
See real code fragment | See real code fragment |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 49 |
Number of mapped statements | 15 |
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) | 2.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
6 | int pindex = plength; | 6 | int pindex = plength; | ||||
7 | int nindex = index + 1; | 7 | int nindex = index + 1; | ||||
8 | char ch; | 8 | char ch; | ||||
18 | do while(pindex > 0) | 18 | do while(pindex > 0) | ||||
|
| 9 | char ch1 = ch = text.charAt(--index); | ||||
9 | char ch1 = ch = iterator.setIndex(--index); |
| | ||||
10 | char ch2 = this.pattern[--pindex]; | 10 | char ch2 = this.pattern[--pindex]; | ||||
11 | if (ch1 != ch2) | 11 | if (ch1 != ch2) | ||||
12 | ch1 = Character.toUpperCase(ch1); | 12 | ch1 = Character.toUpperCase(ch1); | ||||
13 | ch2 = Character.toUpperCase(ch2); | 13 | ch2 = Character.toUpperCase(ch2); | ||||
14 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2)) | 14 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2)) | ||||
15 | break; | 15 | break; | ||||
16 | if (pindex == 0) | 16 | if (pindex == 0) | ||||
17 | return index; | 17 | return index; | ||||
19 | index += this.shiftTable[ch % this.shiftTable.length] + 1; | 19 | index += this.shiftTable[ch % this.shiftTable.length] + 1; | ||||
20 | if (index < nindex) | 20 | if (index < nindex) | ||||
21 | index = nindex; | 21 | index = nindex; |
Row | Violation |
---|---|
1 | Unmatched statement char ch1=ch=text.charAt(--index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement char ch1=ch=iterator.setIndex(--index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variables index, ch , while Clone fragment #2 returns variables index, ch |