if (isSet(opts, IGNORE_CASE)) {
tok = tok.getCaseInsensitiveToken();
if (!tok.match(ch)) {
if (ch >= 0x10000) return -1;
char uch;
if (!tok.match(uch = Character.toUpperCase((char)ch))
&& !tok.match(Character.toLowerCase(uch)))
return -1;
}
} else {
if (!tok.match(ch)) return -1;
}
if (isSet(opts, IGNORE_CASE)) {
tok = tok.getCaseInsensitiveToken();
if (!tok.match(ch)) {
if (ch >= 0x10000) return -1;
char uch;
if (!tok.match(uch = Character.toUpperCase((char)ch))
&& !tok.match(Character.toLowerCase(uch)))
return -1;
}
} else {
if (!tok.match(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: 10
|
|
Number of AST nodes: 10
|
|
1 | if (isSet(opts, IGNORE_CASE)) {↵ | | 1 | if (isSet(opts, IGNORE_CASE)) {↵
|
2 | tok = tok.getCaseInsensitiveToken();↵ | | 2 | tok = tok.getCaseInsensitiveToken();↵
|
3 | if (!tok.match(ch)) {↵ | | 3 | if (!tok.match(ch)) {↵
|
4 | if (ch >= 0x10000) return -1;↵ | | 4 | if (ch >= 0x10000) return -1;↵
|
5 | char uch;↵ | | 5 | char uch;↵
|
6 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵ | | 6 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵
|
7 | && !tok.match(Character.toLowerCase(uch)))↵ | | 7 | && !tok.match(Character.toLowerCase(uch)))↵
|
8 | return -1;↵ | | 8 | return -1;↵
|
9 | }↵ | | 9 | }↵
|
10 | } else {↵ | | 10 | } else {↵
|
11 | if (!tok.match(ch)) return -1;↵ | | 11 | if (!tok.match(ch)) return -1;↵
|
12 | } | | 12 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 2.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 38 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 10 |
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) | 6.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
84 | if (isSet(opts, IGNORE_CASE)) | | 84 | if (isSet(opts, IGNORE_CASE)) |
85 | tok = tok.getCaseInsensitiveToken(); | | 85 | tok = tok.getCaseInsensitiveToken(); |
86 | | | 86 | |
87 | | | 87 | |
88 | | | 88 | |
89 | | | 89 | |
90 | if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch))) | | 90 | if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch))) |
91 | | | 91 | |
| | | | |
92 | | | 92 | |
93 | | | 93 | |
Precondition Violations (0)
Row |
Violation |