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