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: String toString(int)
|
Method name: String toString(int)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 16 | |||
1 | if (this == Token.token_wordchars)↵ | 1 | if (this == Token.token_not_wordchars)↵ | |
2 | ret = "\\w";↵ | 2 | ret = "\\W";↵ | |
3 | else if (this == Token.token_spaces)↵ | 3 | else if (this == Token.token_not_spaces)↵ | |
4 | ret = "\\s";↵ | 4 | ret = "\\S";↵ | |
5 | else {↵ | 5 | else {↵ | |
6 | StringBuffer sb = new StringBuffer();↵ | 6 | StringBuffer sb = new StringBuffer();↵ | |
7 | sb.append("[");↵ | 7 | sb.append("[^");↵ | |
8 | for (int i = 0; i < this.ranges.length; i += 2) {↵ | 8 | for (int i = 0; i < this.ranges.length; i += 2) {↵ | |
9 | if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(",");↵ | 9 | if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(",");↵ | |
10 | if (this.ranges[i] == this.ranges[i+1]) {↵ | 10 | if (this.ranges[i] == this.ranges[i+1]) {↵ | |
11 | sb.append(escapeCharInCharClass(this.ranges[i]));↵ | 11 | sb.append(escapeCharInCharClass(this.ranges[i]));↵ | |
12 | } else {↵ | 12 | } else {↵ | |
13 | sb.append(escapeCharInCharClass(this.ranges[i]));↵ | 13 | sb.append(escapeCharInCharClass(this.ranges[i]));↵ | |
14 | sb.append('-');↵ | 14 | sb.append('-');↵ | |
15 | sb.append(escapeCharInCharClass(this.ranges[i+1]));↵ | 15 | sb.append(escapeCharInCharClass(this.ranges[i+1]));↵ | |
16 | }↵ | 16 | }↵ | |
17 | }↵ | 17 | }↵ | |
18 | sb.append("]");↵ | 18 | sb.append("]");↵ | |
19 | ret = sb.toString();↵ | 19 | ret = sb.toString();↵ | |
20 | } | 20 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 94 |
Number of mapped statements | 16 |
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) | 7.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | else if (this == Token.token_wordchars) |
| 25 | else if (this == Token.token_not_wordchars) | ||||||||||
8 | ret = "\\w"; |
| 26 | ret = "\\W"; | ||||||||||
9 | else if (this == Token.token_spaces) |
| 27 | else if (this == Token.token_not_spaces) | ||||||||||
10 | ret = "\\s"; |
| 28 | ret = "\\S"; | ||||||||||
else | else | |||||||||||||
11 | StringBuffer sb = new StringBuffer(); | 29 | StringBuffer sb = new StringBuffer(); | |||||||||||
12 | sb.append("["); |
| 30 | sb.append("[^"); | ||||||||||
13 | for (int i = 0; i < this.ranges.length; i += 2) | 31 | for (int i = 0; i < this.ranges.length; i += 2) | |||||||||||
14 | if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) | 32 | if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) | |||||||||||
15 | sb.append(","); | 33 | sb.append(","); | |||||||||||
16 | if (this.ranges[i] == this.ranges[i + 1]) | 34 | if (this.ranges[i] == this.ranges[i + 1]) | |||||||||||
17 | sb.append(escapeCharInCharClass(this.ranges[i])); | 35 | sb.append(escapeCharInCharClass(this.ranges[i])); | |||||||||||
else | else | |||||||||||||
18 | sb.append(escapeCharInCharClass(this.ranges[i])); | 36 | sb.append(escapeCharInCharClass(this.ranges[i])); | |||||||||||
19 | sb.append('-'); | 37 | sb.append('-'); | |||||||||||
20 | sb.append(escapeCharInCharClass(this.ranges[i + 1])); | 38 | sb.append(escapeCharInCharClass(this.ranges[i + 1])); | |||||||||||
21 | sb.append("]"); | 39 | sb.append("]"); | |||||||||||
22 | ret = sb.toString(); | 40 | ret = sb.toString(); |
Row | Violation |
---|