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: 18 | Number of AST nodes: 18 | |||
1 | int o1 = offset-1;↵ | 1 | int o1 = offset-1;↵ | |
2 | if (o1 >= con.limit || o1 < 0)↵ | 2 | if (o1 >= con.limit || o1 < 0)↵ | |
3 | return -1;↵ | 3 | return -1;↵ | |
4 | int ch = target [ o1 ] ;↵ | 4 | int ch = target .setIndex( o1 ) ;↵ | |
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 | RangeToken tok = op.getToken();↵ | 7 | RangeToken tok = op.getToken();↵ | |
8 | if (isSet(opts, IGNORE_CASE)) {↵ | 8 | if (isSet(opts, IGNORE_CASE)) {↵ | |
9 | tok = tok.getCaseInsensitiveToken();↵ | 9 | tok = tok.getCaseInsensitiveToken();↵ | |
10 | if (!tok.match(ch)) {↵ | 10 | if (!tok.match(ch)) {↵ | |
11 | if (ch >= 0x10000) return -1;↵ | 11 | if (ch >= 0x10000) return -1;↵ | |
12 | char uch;↵ | 12 | char uch;↵ | |
13 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵ | 13 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵ | |
14 | && !tok.match(Character.toLowerCase(uch)))↵ | 14 | && !tok.match(Character.toLowerCase(uch)))↵ | |
15 | return -1;↵ | 15 | return -1;↵ | |
16 | }↵ | 16 | }↵ | |
17 | } else {↵ | 17 | } else {↵ | |
18 | if (!tok.match(ch)) return -1;↵ | 18 | if (!tok.match(ch)) return -1;↵ | |
19 | }↵ | 19 | }↵ | |
20 | offset = o1; | 20 |
| |
See real code fragment | See real code fragment |
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) | 2.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 69 |
Number of mapped statements | 18 |
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) | 23.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
77 | int o1 = offset - 1; | 77 | int o1 = offset - 1; | |||||||||||||
78 | if (o1 >= con.limit || o1 < 0) | 78 | if (o1 >= con.limit || o1 < 0) | |||||||||||||
79 | return -1; | 79 | return -1; | |||||||||||||
80 | int ch = target[o1]; |
| 80 | int ch = target.setIndex(o1); | ||||||||||||
81 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) | 81 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) | |||||||||||||
82 | ch = REUtil.composeFromSurrogates(target[--o1], ch); |
| 82 | ch = REUtil.composeFromSurrogates(target.setIndex(--o1), ch); | ||||||||||||
83 | RangeToken tok = op.getToken(); | 83 | RangeToken tok = op.getToken(); | |||||||||||||
84 | if (isSet(opts, IGNORE_CASE)) | 84 | if (isSet(opts, IGNORE_CASE)) | |||||||||||||
85 | tok = tok.getCaseInsensitiveToken(); | 85 | tok = tok.getCaseInsensitiveToken(); | |||||||||||||
86 | if (!tok.match(ch)) | 86 | if (!tok.match(ch)) | |||||||||||||
87 | if (ch >= 0x10000) | 87 | if (ch >= 0x10000) | |||||||||||||
88 | return -1; | 88 | return -1; | |||||||||||||
89 | char uch; | 89 | char uch; | |||||||||||||
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 | return -1; | 91 | return -1; | |||||||||||||
else | else | |||||||||||||||
92 | if (!tok.match(ch)) | 92 | if (!tok.match(ch)) | |||||||||||||
93 | return -1; | 93 | return -1; | |||||||||||||
94 | offset = o1; | 94 | offset = o1; |
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 |
3 | Expression target[--o1] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression target.setIndex(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |