if (testChar == '%') {
if (index+2 >= end ||
!isHex(userinfo.charAt(index+1)) ||
!isHex(userinfo.charAt(index+2))) {
return false;
}
index += 2;
}
else if (!isUserinfoCharacter(testChar)) {
return false;
}
if (testChar == '%') {
if (index+2 >= end ||
!isHex(authority.charAt(index+1)) ||
!isHex(authority.charAt(index+2))) {
return false;
}
index += 2;
}
// can check against path characters because the set
// is the same except for '/' which we've already excluded.
else if (!isPathCharacter(testChar)) {
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 isValidServerBasedAuthority(String, int, String)
|
|
Method name: boolean isValidRegistryBasedAuthority(String)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (testChar == '%') {↵ | | 1 | if (testChar == '%') {↵
|
2 | if (index+2 >= end ||↵ | | 2 | if (index+2 >= end ||↵
|
3 | !isHex(userinfo.charAt(index+1)) ||↵ | | 3 | !isHex(authority.charAt(index+1)) ||↵
|
4 | !isHex(userinfo.charAt(index+2))) {↵ | | 4 | !isHex(authority.charAt(index+2))) {↵
|
5 | return false;↵ | | 5 | return false;↵
|
6 | }↵ | | 6 | ↵
|
7 | ↵ | | 7 | }↵
|
8 | index += 2;↵ | | 8 | index += 2;↵
|
9 | }↵ | | 9 | }↵
|
10 | ↵ | | 10 | // can check against path characters because the set↵
|
| | | 11 | // is the same except for '/' which we've already excluded.↵
|
11 | else if (!isUserinfoCharacter(testChar)) {↵ | | 12 | else if (!isPathCharacter(testChar)) {↵
|
12 | return false;↵ | | 13 | return false;↵
|
13 | } | | 14 | }
|
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | if (testChar == '%') | | 6 | if (testChar == '%') |
12 | if (index + 2 >= end || !isHex(userinfo.charAt(index + 1)) || !isHex(userinfo.charAt(index + 2))) | | 7 | if (index + 2 >= end || !isHex(authority.charAt(index + 1)) || !isHex(authority.charAt(index + 2))) |
13 | | | 8 | |
14 | | | 9 | |
15 | else if (!isUserinfoCharacter(testChar)) | | 10 | else if (!isPathCharacter(testChar)) |
16 | | | 11 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression isUserinfoCharacter(testChar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression isPathCharacter(testChar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |