int pindex = plength;
int nindex = index + 1;
char ch;
do
{
if ((ch = str.charAt(--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;
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(String, int, int)
|
|
Method name: int matches(char[], int, int)
|
Number of AST nodes: 11
|
|
Number of AST nodes: 11
|
|
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 | if ((ch = str.charAt(--index)) != this.pattern[--pindex])↵ | | 6 | if ((ch = chars[--index]) != this.pattern[--pindex])↵
|
7 | break;↵ | | 7 | break;↵
|
8 | if (pindex == 0)↵ | | 8 | if (pindex == 0)↵
|
9 | return index;↵ | | 9 | return index;↵
|
10 | }↵ | | 10 | }↵
|
11 | while (pindex > 0);↵ | | 11 | while (pindex > 0);↵
|
12 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | | 12 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵
|
13 | if (index < nindex)↵ | | 13 | if (index < nindex)↵
|
14 | index = nindex; | | 14 | index = nindex;
|
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 37 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 11 |
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) | 1.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
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 = str.charAt(--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 | if (index < nindex) | | 17 | if (index < nindex) |
18 | | | 18 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression str.charAt(--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 |