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: boolean matches(CharacterIterator, Match)
|
Method name: boolean matches(String, int, int, Match)
|
|||
Number of AST nodes: 24 | Number of AST nodes: 24 | |||
1 | RangeToken range = this.firstChar;↵ | 1 | RangeToken range = this.firstChar;↵ | |
2 | if (RegularExpression.isSet(this.options, IGNORE_CASE)) {↵ | 2 | if (RegularExpression.isSet(this.options, IGNORE_CASE)) {↵ | |
3 | range = this.firstChar.getCaseInsensitiveToken();↵ | 3 | range = this.firstChar.getCaseInsensitiveToken();↵ | |
4 | for (matchStart = con.start; matchStart <= limit; matchStart ++) {↵ | 4 | for (matchStart = con.start; matchStart <= limit; matchStart ++) {↵ | |
5 | int ch = target .setIndex( matchStart ) ;↵ | 5 | int ch = target .charAt( matchStart ) ;↵ | |
6 | if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) {↵ | 6 | if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) {↵ | |
7 | ch = REUtil.composeFromSurrogates(ch, target .setIndex( matchStart+1 ) );↵ | 7 | ch = REUtil.composeFromSurrogates(ch, target .charAt( matchStart+1 ) );↵ | |
8 | if (!range.match(ch)) continue;↵ | 8 | if (!range.match(ch)) continue;↵ | |
9 | } else {↵ | 9 | } else {↵ | |
10 | if (!range.match(ch)) {↵ | 10 | if (!range.match(ch)) {↵ | |
11 | char ch1 = Character.toUpperCase((char)ch);↵ | 11 | char ch1 = Character.toUpperCase((char)ch);↵ | |
12 | if (!range.match(ch1))↵ | 12 | if (!range.match(ch1))↵ | |
13 | if (!range.match(Character.toLowerCase(ch1)))↵ | 13 | if (!range.match(Character.toLowerCase(ch1)))↵ | |
14 | continue;↵ | 14 | continue;↵ | |
15 | }↵ | 15 | }↵ | |
16 | }↵ | 16 | }↵ | |
17 | if (0 <= (matchEnd = this. matchCharacterIterator (con, this.operations,↵ | 17 | if (0 <= (matchEnd = this. matchString (con, this.operations,↵ | |
18 | matchStart, 1, this.options)))↵ | 18 | matchStart, 1, this.options)))↵ | |
19 | break;↵ | 19 | break;↵ | |
20 | }↵ | 20 | }↵ | |
21 | } else {↵ | 21 | } else {↵ | |
22 | for (matchStart = con.start; matchStart <= limit; matchStart ++) {↵ | 22 | for (matchStart = con.start; matchStart <= limit; matchStart ++) {↵ | |
23 | int ch = target .setIndex( matchStart ) ;↵ | 23 | int ch = target .charAt( matchStart ) ;↵ | |
24 | if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit)↵ | 24 | if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit)↵ | |
25 | ch = REUtil.composeFromSurrogates(ch, target .setIndex( matchStart+1 ) );↵ | 25 | ch = REUtil.composeFromSurrogates(ch, target .charAt( matchStart+1 ) );↵ | |
26 | if (!range.match(ch)) continue;↵ | 26 | if (!range.match(ch)) continue;↵ | |
27 | if (0 <= (matchEnd = this. matchCharacterIterator (con, this.operations,↵ | 27 | if (0 <= (matchEnd = this. matchString (con, this.operations,↵ | |
28 | matchStart, 1, this.options)))↵ | 28 | matchStart, 1, this.options)))↵ | |
29 | break;↵ | 29 | break;↵ | |
30 | }↵ | 30 | }↵ | |
31 | } | 31 |
| |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 79 |
Number of mapped statements | 24 |
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) | 8.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
60 | RangeToken range = this.firstChar; | 63 | RangeToken range = this.firstChar; | |||||||||||||||||
61 | if (RegularExpression.isSet(this.options, IGNORE_CASE)) | 64 | if (RegularExpression.isSet(this.options, IGNORE_CASE)) | |||||||||||||||||
62 | range = this.firstChar.getCaseInsensitiveToken(); | 65 | range = this.firstChar.getCaseInsensitiveToken(); | |||||||||||||||||
63 | for (matchStart = con.start; matchStart <= limit; matchStart++) | 66 | for (matchStart = con.start; matchStart <= limit; matchStart++) | |||||||||||||||||
64 | int ch = target.setIndex(matchStart); |
| 67 | int ch = target.charAt(matchStart); | ||||||||||||||||
65 | if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit) | 68 | if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit) | |||||||||||||||||
66 | ch = REUtil.composeFromSurrogates(ch, target.setIndex(matchStart + 1)); |
| 69 | ch = REUtil.composeFromSurrogates(ch, target.charAt(matchStart + 1)); | ||||||||||||||||
67 | if (!range.match(ch)) | 70 | if (!range.match(ch)) | |||||||||||||||||
68 | continue; | 71 | continue; | |||||||||||||||||
else | else | |||||||||||||||||||
69 | if (!range.match(ch)) | 72 | if (!range.match(ch)) | |||||||||||||||||
70 | char ch1 = Character.toUpperCase((char)ch); | 73 | char ch1 = Character.toUpperCase((char)ch); | |||||||||||||||||
71 | if (!range.match(ch1)) | 74 | if (!range.match(ch1)) | |||||||||||||||||
72 | if (!range.match(Character.toLowerCase(ch1))) | 75 | if (!range.match(Character.toLowerCase(ch1))) | |||||||||||||||||
73 | continue; | 76 | continue; | |||||||||||||||||
74 | if (0 <= (matchEnd = this.matchCharacterIterator(con, this.operations, matchStart, 1, this.options))) |
| 77 | if (0 <= (matchEnd = this.matchString(con, this.operations, matchStart, 1, this.options))) | ||||||||||||||||
75 | break; | 78 | break; | |||||||||||||||||
else | else | |||||||||||||||||||
76 | for (matchStart = con.start; matchStart <= limit; matchStart++) | 79 | for (matchStart = con.start; matchStart <= limit; matchStart++) | |||||||||||||||||
77 | int ch = target.setIndex(matchStart); |
| 80 | int ch = target.charAt(matchStart); | ||||||||||||||||
78 | if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit) | 81 | if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit) | |||||||||||||||||
79 | ch = REUtil.composeFromSurrogates(ch, target.setIndex(matchStart + 1)); |
| 82 | ch = REUtil.composeFromSurrogates(ch, target.charAt(matchStart + 1)); | ||||||||||||||||
80 | if (!range.match(ch)) | 83 | if (!range.match(ch)) | |||||||||||||||||
81 | continue; | 84 | continue; | |||||||||||||||||
82 | if (0 <= (matchEnd = this.matchCharacterIterator(con, this.operations, matchStart, 1, this.options))) |
| 85 | if (0 <= (matchEnd = this.matchString(con, this.operations, matchStart, 1, this.options))) | ||||||||||||||||
83 | break; | 86 | break; |
Row | Violation |
---|---|
1 | Expression target.setIndex(matchStart) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression target.charAt(matchStart) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type java.text.CharacterIterator of variable target does not match with type java.lang.String of variable target |
4 | Expression target.setIndex(matchStart + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression target.charAt(matchStart + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type java.text.CharacterIterator of variable target does not match with type java.lang.String of variable target |
7 | Expression this.matchCharacterIterator(con,this.operations,matchStart,1,this.options) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression this.matchString(con,this.operations,matchStart,1,this.options) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression target.setIndex(matchStart) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression target.charAt(matchStart) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Type java.text.CharacterIterator of variable target does not match with type java.lang.String of variable target |
12 | Expression target.setIndex(matchStart + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression target.charAt(matchStart + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Type java.text.CharacterIterator of variable target does not match with type java.lang.String of variable target |
15 | Expression this.matchCharacterIterator(con,this.operations,matchStart,1,this.options) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression this.matchString(con,this.operations,matchStart,1,this.options) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Clone fragment #1 returns variables matchEnd, matchStart , while Clone fragment #2 returns variables matchEnd, matchStart |