if (isSet(opts, SINGLE_LINE)) {
if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
offset ++;
} else {
if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
ch = REUtil.composeFromSurrogates(ch, target [ ++offset ] );
if (isEOLChar(ch))
return -1;
}
if (isSet(opts, SINGLE_LINE)) {
if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
offset ++;
} else {
if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
ch = REUtil.composeFromSurrogates(ch, target .charAt( ++offset ) );
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 matchString(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.isHighSurrogate(ch) && offset+1 < con.limit)↵ | | 2 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵
|
3 | offset ++;↵ | | 3 | offset ++;↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵ | | 5 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵
|
6 | ch = REUtil.composeFromSurrogates(ch, target [ ++offset ] );↵ | | 6 | ch = REUtil.composeFromSurrogates(ch, target .charAt( ++offset ) );↵
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 30 |
-
{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) | 10.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
35 | if (isSet(opts, SINGLE_LINE)) | | 35 | if (isSet(opts, SINGLE_LINE)) |
36 | if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit) | | 36 | if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit) |
37 | | | 37 | |
| | | | |
38 | if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit) | | 38 | if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit) |
39 | ch = REUtil.composeFromSurrogates(ch, target[++offset]); | | 39 | ch = REUtil.composeFromSurrogates(ch, target.charAt(++offset)); |
40 | | | 40 | |
41 | | | 41 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression target[++offset] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression target.charAt(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted |