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: 22 | Number of AST nodes: 22 | |||
1 | int refno = op.getData();↵ | 1 | int refno = op.getData();↵ | |
2 | if (refno <= 0 || refno >= this.nofparen)↵ | 2 | if (refno <= 0 || refno >= this.nofparen)↵ | |
3 | throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno);↵ | 3 | throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno);↵ | |
4 | if (con.match.getBeginning(refno) < 0↵ | 4 | if (con.match.getBeginning(refno) < 0↵ | |
5 | || con.match.getEnd(refno) < 0)↵ | 5 | || con.match.getEnd(refno) < 0)↵ | |
6 | return -1; // ********↵ | 6 | return -1; // ********↵ | |
7 | int o2 = con.match.getBeginning(refno);↵ | 7 | int o2 = con.match.getBeginning(refno);↵ | |
8 | int literallen = con.match.getEnd(refno)-o2;↵ | 8 | int literallen = con.match.getEnd(refno)-o2;↵ | |
9 | if (!isSet(opts, IGNORE_CASE)) {↵ | 9 | if (!isSet(opts, IGNORE_CASE)) {↵ | |
10 | if (dx > 0) {↵ | 10 | if (dx > 0) {↵ | |
11 | if (!regionMatches(target, offset, con.limit, o2, literallen))↵ | 11 | if (!regionMatches(target, offset, con.limit, o2, literallen))↵ | |
12 | return -1;↵ | 12 | return -1;↵ | |
13 | offset += literallen;↵ | 13 | offset += literallen;↵ | |
14 | } else {↵ | 14 | } else {↵ | |
15 | if (!regionMatches(target, offset-literallen, con.limit, o2, literallen))↵ | 15 | if (!regionMatches(target, offset-literallen, con.limit, o2, literallen))↵ | |
16 | return -1;↵ | 16 | return -1;↵ | |
17 | offset -= literallen;↵ | 17 | offset -= literallen;↵ | |
18 | }↵ | 18 | }↵ | |
19 | } else {↵ | 19 | } else {↵ | |
20 | if (dx > 0) {↵ | 20 | if (dx > 0) {↵ | |
21 | if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))↵ | 21 | if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))↵ | |
22 | return -1;↵ | 22 | return -1;↵ | |
23 | offset += literallen;↵ | 23 | offset += literallen;↵ | |
24 | } else {↵ | 24 | } else {↵ | |
25 | if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,↵ | 25 | if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,↵ | |
26 | o2, literallen))↵ | 26 | o2, literallen))↵ | |
27 | return -1;↵ | 27 | return -1;↵ | |
28 | offset -= literallen;↵ | 28 | offset -= literallen;↵ | |
29 | }↵ | 29 | }↵ | |
30 | } | 30 |
| |
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) | 4.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 88 |
Number of mapped statements | 22 |
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) | 140.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
163 | int refno = op.getData(); | 163 | int refno = op.getData(); | ||||||||||||
164 | if (refno <= 0 || refno >= this.nofparen) | 164 | if (refno <= 0 || refno >= this.nofparen) | ||||||||||||
165 | throw new RuntimeException("Internal Error: Reference number must be more than zero: " + refno); | 165 | throw new RuntimeException("Internal Error: Reference number must be more than zero: " + refno); | ||||||||||||
166 | if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) | 166 | if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) | ||||||||||||
167 | return -1; | 167 | return -1; | ||||||||||||
168 | int o2 = con.match.getBeginning(refno); | 168 | int o2 = con.match.getBeginning(refno); | ||||||||||||
169 | int literallen = con.match.getEnd(refno) - o2; | 169 | int literallen = con.match.getEnd(refno) - o2; | ||||||||||||
170 | if (!isSet(opts, IGNORE_CASE)) | 170 | if (!isSet(opts, IGNORE_CASE)) | ||||||||||||
171 | if (dx > 0) | 171 | if (dx > 0) | ||||||||||||
172 | if (!regionMatches(target, offset, con.limit, o2, literallen)) |
| 172 | if (!regionMatches(target, offset, con.limit, o2, literallen)) | |||||||||||
173 | return -1; | 173 | return -1; | ||||||||||||
174 | offset += literallen; | 174 | offset += literallen; | ||||||||||||
else | else | ||||||||||||||
175 | if (!regionMatches(target, offset - literallen, con.limit, o2, literallen)) |
| 175 | if (!regionMatches(target, offset - literallen, con.limit, o2, literallen)) | |||||||||||
176 | return -1; | 176 | return -1; | ||||||||||||
177 | offset -= literallen; | 177 | offset -= literallen; | ||||||||||||
else | else | ||||||||||||||
178 | if (dx > 0) | 178 | if (dx > 0) | ||||||||||||
179 | if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen)) |
| 179 | if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen)) | |||||||||||
180 | return -1; | 180 | return -1; | ||||||||||||
181 | offset += literallen; | 181 | offset += literallen; | ||||||||||||
else | else | ||||||||||||||
182 | if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, o2, literallen)) |
| 182 | if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, o2, literallen)) | |||||||||||
183 | return -1; | 183 | return -1; | ||||||||||||
184 | offset -= literallen; | 184 | offset -= literallen; |
Row | Violation |
---|---|
1 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |
2 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |
3 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |
4 | Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target |