if (dx > 0) {
if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))
return -1;
offset += literallen;
} else {
if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,
o2, literallen))
return -1;
offset -= literallen;
}
if (dx > 0) {
if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))
return -1;
offset += literallen;
} else {
if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,
o2, literallen))
return -1;
offset -= literallen;
}
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 matchString(Context, Op, int, int, int)
|
|
Method name: int matchCharacterIterator(Context, Op, int, int, int)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (dx > 0) {↵ | | 1 | if (dx > 0) {↵
|
2 | if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))↵ | | 2 | if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))↵
|
3 | return -1;↵ | | 3 | return -1;↵
|
4 | offset += literallen;↵ | | 4 | offset += literallen;↵
|
5 | } else {↵ | | 5 | } else {↵
|
6 | if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,↵ | | 6 | if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,↵
|
7 | o2, literallen))↵ | | 7 | o2, literallen))↵
|
8 | return -1;↵ | | 8 | return -1;↵
|
9 | offset -= literallen;↵ | | 9 | offset -= literallen;↵
|
10 | } | | 10 | }
|
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 27 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 59.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
178 | if (dx > 0) | | 178 | if (dx > 0) |
179 | if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen)) | | 179 | if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen)) |
180 | | | 180 | |
181 | | | 181 | |
| | | | |
182 | if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, o2, literallen)) | | 182 | if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, o2, literallen)) |
183 | | | 183 | |
184 | | | 184 | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |
2 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |