if (isSet(opts, SINGLE_LINE)) {
if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
o1 --;
} else {
if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
ch = REUtil.composeFromSurrogates( target [ --o1 ] , ch);
if (!isEOLChar(ch))
return -1;
}
if (isSet(opts, SINGLE_LINE)) {
if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
o1 --;
} else {
if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
ch = REUtil.composeFromSurrogates( target .setIndex( --o1 ) , ch);
if (!isEOLChar(ch))
return -1;
}
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 matchCharArray(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 (isSet(opts, SINGLE_LINE)) {↵ | | 1 | if (isSet(opts, SINGLE_LINE)) {↵
|
2 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | | 2 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵
|
3 | o1 --;↵ | | 3 | o1 --;↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | | 5 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵
|
6 | ch = REUtil.composeFromSurrogates( target [ --o1 ] , ch);↵ | | 6 | ch = REUtil.composeFromSurrogates( target .setIndex( --o1 ) , ch);↵
|
7 | if (!isEOLChar(ch))↵ | | 7 | if (!isEOLChar(ch))↵
|
8 | return -1;↵ | | 8 | return -1;↵
|
9 | } | | 9 | }
|
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 35 |
-
{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) | 4.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
47 | if (isSet(opts, SINGLE_LINE)) | | 47 | if (isSet(opts, SINGLE_LINE)) |
48 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) | | 48 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) |
49 | | | 49 | |
| | | | |
50 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) | | 50 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) |
51 | ch = REUtil.composeFromSurrogates(target[--o1], ch); | | 51 | ch = REUtil.composeFromSurrogates(target.setIndex(--o1), ch); |
52 | | | 52 | |
53 | | | 53 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression target[--o1] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression target.setIndex(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |