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: 36 | Number of AST nodes: 36 | |||
1 | if (dx > 0) {↵ | 1 | if (dx > 0) {↵ | |
2 | if (offset >= con.limit)↵ | 2 | if (offset >= con.limit)↵ | |
3 | return -1;↵ | 3 | return -1;↵ | |
4 | int ch = target .charAt( offset ) ;↵ | 4 | int ch = target .setIndex( offset ) ;↵ | |
5 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵ | 5 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵ | |
6 | ch = REUtil.composeFromSurrogates(ch, target .charAt( ++offset ) );↵ | 6 | ch = REUtil.composeFromSurrogates(ch, target .setIndex( ++offset ) );↵ | |
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 ++;↵ | 20 | offset ++;↵ | |
21 | } else {↵ | 21 | } else {↵ | |
22 | int o1 = offset-1;↵ | 22 | int o1 = offset-1;↵ | |
23 | if (o1 >= con.limit || o1 < 0)↵ | 23 | if (o1 >= con.limit || o1 < 0)↵ | |
24 | return -1;↵ | 24 | return -1;↵ | |
25 | int ch = target .charAt( o1 ) ;↵ | 25 | int ch = target .setIndex( o1 ) ;↵ | |
26 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | 26 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | |
27 | ch = REUtil.composeFromSurrogates( target .charAt( --o1 ) , ch);↵ | 27 | ch = REUtil.composeFromSurrogates( target .setIndex( --o1 ) , ch);↵ | |
28 | RangeToken tok = op.getToken();↵ | 28 | RangeToken tok = op.getToken();↵ | |
29 | if (isSet(opts, IGNORE_CASE)) {↵ | 29 | if (isSet(opts, IGNORE_CASE)) {↵ | |
30 | tok = tok.getCaseInsensitiveToken();↵ | 30 | tok = tok.getCaseInsensitiveToken();↵ | |
31 | if (!tok.match(ch)) {↵ | 31 | if (!tok.match(ch)) {↵ | |
32 | if (ch >= 0x10000) return -1;↵ | 32 | if (ch >= 0x10000) return -1;↵ | |
33 | char uch;↵ | 33 | char uch;↵ | |
34 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵ | 34 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵ | |
35 | && !tok.match(Character.toLowerCase(uch)))↵ | 35 | && !tok.match(Character.toLowerCase(uch)))↵ | |
36 | return -1;↵ | 36 | return -1;↵ | |
37 | }↵ | 37 | }↵ | |
38 | } else {↵ | 38 | } else {↵ | |
39 | if (!tok.match(ch)) return -1;↵ | 39 | if (!tok.match(ch)) return -1;↵ | |
40 | }↵ | 40 | }↵ | |
41 | offset = o1;↵ | 41 | offset = o1;↵ | |
42 | } | 42 |
| |
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) | 6.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 193 |
Number of mapped statements | 36 |
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) | 80.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
59 | if (dx > 0) | 59 | if (dx > 0) | |||||||||||||||||
60 | if (offset >= con.limit) | 60 | if (offset >= con.limit) | |||||||||||||||||
61 | return -1; | 61 | return -1; | |||||||||||||||||
62 | int ch = target.charAt(offset); |
| 62 | int ch = target.setIndex(offset); | ||||||||||||||||
63 | if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit) | 63 | if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit) | |||||||||||||||||
64 | ch = REUtil.composeFromSurrogates(ch, target.charAt(++offset)); |
| 64 | ch = REUtil.composeFromSurrogates(ch, target.setIndex(++offset)); | ||||||||||||||||
65 | RangeToken tok = op.getToken(); | 65 | RangeToken tok = op.getToken(); | |||||||||||||||||
66 | if (isSet(opts, IGNORE_CASE)) | 66 | if (isSet(opts, IGNORE_CASE)) | |||||||||||||||||
67 | tok = tok.getCaseInsensitiveToken(); | 67 | tok = tok.getCaseInsensitiveToken(); | |||||||||||||||||
68 | if (!tok.match(ch)) | 68 | if (!tok.match(ch)) | |||||||||||||||||
69 | if (ch >= 0x10000) | 69 | if (ch >= 0x10000) | |||||||||||||||||
70 | return -1; | 70 | return -1; | |||||||||||||||||
71 | char uch; | 71 | char uch; | |||||||||||||||||
72 | if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch))) | 72 | if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch))) | |||||||||||||||||
73 | return -1; | 73 | return -1; | |||||||||||||||||
else | else | |||||||||||||||||||
74 | if (!tok.match(ch)) | 74 | if (!tok.match(ch)) | |||||||||||||||||
75 | return -1; | 75 | return -1; | |||||||||||||||||
76 | offset++; | 76 | offset++; | |||||||||||||||||
else | else | |||||||||||||||||||
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.charAt(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.charAt(--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.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |
4 | Expression target.charAt(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression target.setIndex(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |
7 | Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |
10 | Expression target.charAt(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression target.setIndex(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |