File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java | |||
Method name: void initializePath(String, int)
|
Method name: void initializePath(String, int)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 9 | |||
1 | while (index < end) {↵ | |||
1 | testChar = p_uriSpec.charAt(index);↵ | 2 | testChar = p_uriSpec.charAt(index);↵ | |
2 | if (testChar == '#') {↵ | |||
3 | break;↵ | |||
4 | }↵ | |||
5 | if (testChar == '%') {↵ | 3 | if (testChar == '%') {↵ | |
6 | if (index+2 >= end ||↵ | 4 | if (index+2 >= end ||↵ | |
7 | !isHex(p_uriSpec.charAt(index+1)) ||↵ | 5 | !isHex(p_uriSpec.charAt(index+1)) ||↵ | |
8 | !isHex(p_uriSpec.charAt(index+2))) {↵ | 6 | !isHex(p_uriSpec.charAt(index+2))) {↵ | |
9 | throw new MalformedURIException(↵ | 7 | throw new MalformedURIException(↵ | |
10 | "Query string contains invalid escape sequence!");↵ | 8 | "Fragment contains invalid escape sequence!");↵ | |
11 | }↵ | 9 | }↵ | |
12 | index += 2;↵ | 10 | index += 2;↵ | |
13 | }↵ | 11 | }↵ | |
14 | else if (!isURICharacter(testChar)) {↵ | 12 | else if (!isURICharacter(testChar)) {↵ | |
15 | throw new MalformedURIException(↵ | 13 | throw new MalformedURIException(↵ | |
16 | "Query string contains invalid character: " + testChar);↵ | 14 | "Fragment contains invalid character: "+testChar);↵ | |
17 | }↵ | 15 | }↵ | |
18 | index++; | 16 | index++;↵ | |
17 |
| |||
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) | 0.7 |
Clones location | Clones are in the same method |
Number of node comparisons | 26 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36 | testChar = p_uriSpec.charAt(index); | 51 | testChar = p_uriSpec.charAt(index); | |||||||||||
37 | if (testChar == '#') |
| | |||||||||||
38 | break; |
| | |||||||||||
39 | if (testChar == '%') | 52 | if (testChar == '%') | |||||||||||
40 | if (index + 2 >= end || !isHex(p_uriSpec.charAt(index + 1)) || !isHex(p_uriSpec.charAt(index + 2))) | 53 | if (index + 2 >= end || !isHex(p_uriSpec.charAt(index + 1)) || !isHex(p_uriSpec.charAt(index + 2))) | |||||||||||
41 | throw new MalformedURIException("Query string contains invalid escape sequence!"); |
| 54 | throw new MalformedURIException("Fragment contains invalid escape sequence!"); | ||||||||||
42 | index += 2; | 55 | index += 2; | |||||||||||
43 | else if (!isURICharacter(testChar)) | 56 | else if (!isURICharacter(testChar)) | |||||||||||
44 | throw new MalformedURIException("Query string contains invalid character: " + testChar); |
| 57 | throw new MalformedURIException("Fragment contains invalid character: " + testChar); |
Row | Violation |
---|---|
1 | Unmatched statement if(testChar == '#') cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched break; |
3 | Clone fragment #1 returns variables testChar, index , while Clone fragment #2 returns variables index |