while (index <= limit)
{
int pindex = plength;
int nindex = index + 1;
char ch;
do
{
if ((ch = iterator.setIndex(--index)) != this.pattern[--pindex])
break;
if (pindex == 0)
return index;
}
while (pindex > 0);
index += this.shiftTable[ch % this.shiftTable.length] + 1;
if (index < nindex)
index = nindex;
}
while (index <= limit)
{
//System.err.println("Starts at "+index);
int pindex = plength;
int nindex = index + 1;
char ch;
do
{
if ((ch = chars[--index]) != this.pattern[--pindex])
break;
if (pindex == 0)
return index;
}
while (pindex > 0);
index += this.shiftTable[ch % this.shiftTable.length] + 1;
if (index < nindex)
index = nindex;
}
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: int matches(CharacterIterator, int, int)
|
|
Method name: int matches(char[], int, int)
|
Number of AST nodes: 12
|
|
Number of AST nodes: 12
|
|
1 | while (index <= limit)↵ | | 1 | while (index <= limit)↵
|
2 | {↵ | | 2 | {↵
|
| | | 3 | //System.err.println("Starts at "+index);↵
|
3 | int pindex = plength;↵ | | 4 | int pindex = plength;↵
|
4 | int nindex = index + 1;↵ | | 5 | int nindex = index + 1;↵
|
5 | char ch;↵ | | 6 | char ch;↵
|
6 | do↵ | | 7 | do↵
|
7 | {↵ | | 8 | {↵
|
8 | if ((ch = iterator.setIndex(--index)) != this.pattern[--pindex])↵ | | 9 | if ((ch = chars[--index]) != this.pattern[--pindex])↵
|
9 | break;↵ | | 10 | break;↵
|
10 | if (pindex == 0)↵ | | 11 | if (pindex == 0)↵
|
11 | return index;↵ | | 12 | return index;↵
|
12 | }↵ | | 13 | }↵
|
13 | while (pindex > 0);↵ | | 14 | while (pindex > 0);↵
|
14 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | | 15 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵
|
15 | if (index < nindex)↵ | | 16 | if (index < nindex)↵
|
16 | index = nindex;↵ | | 17 | index = nindex;↵
|
17 | } | | 18 | }
|
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) | 1.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 45 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 12 |
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 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | while (index <= limit) | | 7 | while (index <= limit) |
8 | | | 8 | |
9 | | | 9 | |
10 | | | 10 | |
15 | | | 15 | |
11 | if ((ch = iterator.setIndex(--index)) != this.pattern[--pindex]) | | 11 | if ((ch = chars[--index]) != this.pattern[--pindex]) |
12 | | | 12 | |
13 | | | 13 | |
14 | | | 14 | |
16 | index += this.shiftTable[ch % this.shiftTable.length] + 1; | | 16 | index += this.shiftTable[ch % this.shiftTable.length] + 1; |
17 | | | 17 | |
18 | | | 18 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression iterator.setIndex(--index) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression chars[--index] cannot be parameterized, because it has dependencies to/from statements that will be extracted |