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: boolean isValidIANAEncoding(String)
|
Method name: boolean isValidJavaEncoding(String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {↵ | 1 | if (↵ | |
2 | ↵ | 2 | length > 0) {↵ | |
3 | for (int i = 1; i < length; i++) {↵ | 3 | for (int i = 1; i < length; i++) {↵ | |
4 | c = ianaEncoding.charAt(i);↵ | 4 | char c = javaEncoding.charAt(i);↵ | |
5 | if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&↵ | 5 | if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&↵ | |
6 | (c < '0' || c > '9') && c != '.' && c != '_' &&↵ | 6 | (c < '0' || c > '9') && c != '.' && c != '_' &&↵ | |
7 | c != '-') {↵ | 7 | c != '-') {↵ | |
8 | return false;↵ | 8 | return false;↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | return true;↵ | 11 | return true;↵ | |
12 | } | 12 |
| |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||
---|---|---|---|---|---|---|---|---|---|---|
6 | for (int i = 1; i < length; i++) | 4 | for (int i = 1; i < length; i++) | |||||||
|
| 5 | char c = javaEncoding.charAt(i); | |||||||
7 | c = ianaEncoding.charAt(i); |
| | |||||||
8 | if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') && (c < '0' || c > '9') && c != '.' && c != '_' && c != '-') | 6 | if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') && (c < '0' || c > '9') && c != '.' && c != '_' && c != '-') | |||||||
9 | return false; |
| 7 | return false; |
Row | Violation |
---|---|
1 | Unmatched statement char c=javaEncoding.charAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement c=ianaEncoding.charAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Conditional return false; |
4 | Conditional return false; |