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 matches(CharacterIterator, int, int)
|
Method name: int matches(char[], int, int)
|
|||
Number of AST nodes: 19 | Number of AST nodes: 19 | |||
1 | if (this.ignoreCase)↵ | 1 | if (this.ignoreCase)↵ | |
2 | return this.matchesIgnoreCase(iterator, start, limit);↵ | 2 | return this.matchesIgnoreCase(chars, start, limit);↵ | |
3 | int plength = this.pattern.length;↵ | 3 | int plength = this.pattern.length;↵ | |
4 | if (plength == 0)↵ | 4 | if (plength == 0)↵ | |
5 | return start;↵ | 5 | return start;↵ | |
6 | int index = start + plength;↵ | 6 | int index = start + plength;↵ | |
7 | while (index <= limit)↵ | 7 | while (index <= limit)↵ | |
8 | {↵ | 8 | {↵ | |
9 | //System.err.println("Starts at "+index);↵ | |||
9 | int pindex = plength;↵ | 10 | int pindex = plength;↵ | |
10 | int nindex = index + 1;↵ | 11 | int nindex = index + 1;↵ | |
11 | char ch;↵ | 12 | char ch;↵ | |
12 | do↵ | 13 | do↵ | |
13 | {↵ | 14 | {↵ | |
14 | if ((ch = iterator.setIndex(--index)) != this.pattern[--pindex])↵ | 15 | if ((ch = chars[--index]) != this.pattern[--pindex])↵ | |
15 | break;↵ | 16 | break;↵ | |
16 | if (pindex == 0)↵ | 17 | if (pindex == 0)↵ | |
17 | return index;↵ | 18 | return index;↵ | |
18 | }↵ | 19 | }↵ | |
19 | while (pindex > 0);↵ | 20 | while (pindex > 0);↵ | |
20 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | 21 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | |
21 | if (index < nindex)↵ | 22 | if (index < nindex)↵ | |
22 | index = nindex;↵ | 23 | index = nindex;↵ | |
23 | }↵ | 24 | }↵ | |
24 | return -1; | 25 |
| |
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 67 |
Number of mapped statements | 19 |
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.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this.ignoreCase) | 1 | if (this.ignoreCase) | |||||||||||||||
2 | return this.matchesIgnoreCase(iterator, start, limit); |
| 2 | return this.matchesIgnoreCase(chars, start, limit); | ||||||||||||||
3 | int plength = this.pattern.length; | 3 | int plength = this.pattern.length; | |||||||||||||||
4 | if (plength == 0) | 4 | if (plength == 0) | |||||||||||||||
5 | return start; | 5 | return start; | |||||||||||||||
6 | int index = start + plength; | 6 | int index = start + plength; | |||||||||||||||
7 | while (index <= limit) | 7 | while (index <= limit) | |||||||||||||||
8 | int pindex = plength; | 8 | int pindex = plength; | |||||||||||||||
9 | int nindex = index + 1; | 9 | int nindex = index + 1; | |||||||||||||||
10 | char ch; | 10 | char ch; | |||||||||||||||
15 | do while(pindex > 0) | 15 | do while(pindex > 0) | |||||||||||||||
11 | if ((ch = iterator.setIndex(--index)) != this.pattern[--pindex]) |
| 11 | if ((ch = chars[--index]) != this.pattern[--pindex]) | ||||||||||||||
12 | break; | 12 | break; | |||||||||||||||
13 | if (pindex == 0) | 13 | if (pindex == 0) | |||||||||||||||
14 | return index; | 14 | return index; | |||||||||||||||
16 | index += this.shiftTable[ch % this.shiftTable.length] + 1; | 16 | index += this.shiftTable[ch % this.shiftTable.length] + 1; | |||||||||||||||
17 | if (index < nindex) | 17 | if (index < nindex) | |||||||||||||||
18 | index = nindex; | 18 | index = nindex; | |||||||||||||||
19 | return -1; | 19 | return -1; |
Row | Violation |
---|---|
1 | Type java.text.CharacterIterator of variable iterator does not match with type char[] of variable chars |
2 | Expression iterator.setIndex(--index) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression chars[--index] cannot be parameterized, because it has dependencies to/from statements that will be extracted |