if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
(c < '0' || c > '9') && c != '.' && c != '_' &&
c != '-') {
return false;
}
if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
(c < '0' || c > '9') && c != '.' && c != '_' &&
c != '-') {
return false;
}
Clone fragments detected by clone detection tool
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: 2
|
|
Number of AST nodes: 2
|
|
1 | if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&↵ | | 1 | if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&↵
|
2 | (c < '0' || c > '9') && c != '.' && c != '_' &&↵ | | 2 | (c < '0' || c > '9') && c != '.' && c != '_' &&↵
|
3 | c != '-') {↵ | | 3 | c != '-') {↵
|
4 | return false;↵ | | 4 | return false;↵
|
5 | } | | 5 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 declared in the same class |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 0.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
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 | | | 7 | |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return false; |
2 | Conditional return false; |