if (ch != '?') {
if (isCaseSensitive && ch != strArr[i]) {
return false; // Character mismatch
}
if (!isCaseSensitive && Character.toUpperCase(ch)
!= Character.toUpperCase(strArr[i])) {
return false; // Character mismatch
}
}
if (ch != '?') {
if (isCaseSensitive && ch != strArr[strIdxStart]) {
return false; // Character mismatch
}
if (!isCaseSensitive && Character.toUpperCase(ch)
!= Character.toUpperCase(strArr[strIdxStart])) {
return false; // Character mismatch
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java
|
Method name: boolean match(String, String, boolean)
|
|
Method name: boolean match(String, String, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (ch != '?') {↵ | | 1 | if (ch != '?') {↵
|
2 | if (isCaseSensitive && ch != strArr[i]) {↵ | | 2 | if (isCaseSensitive && ch != strArr[strIdxStart]) {↵
|
3 | return false; // Character mismatch↵ | | 3 | return false; // Character mismatch↵
|
4 | }↵ | | 4 | ↵
|
5 | ↵ | | 5 | }↵
|
6 | if (!isCaseSensitive && Character.toUpperCase(ch)↵ | | 6 | if (!isCaseSensitive && Character.toUpperCase(ch)↵
|
7 | != Character.toUpperCase(strArr[i])) {↵ | | 7 | != Character.toUpperCase(strArr[strIdxStart])) {↵
|
8 | return false; // Character mismatch↵ | | 8 | return false; // Character mismatch↵
|
9 | }↵ | | 9 | ↵
|
10 | ↵ | | 10 | }↵
|
11 | } | | 11 | }
|
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.9 |
Clones location | Clones are in the same method |
Number of node comparisons | 15 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
18 | if (ch != '?') | | 27 | if (ch != '?') |
19 | if (isCaseSensitive && ch != strArr[i]) | | 28 | if (isCaseSensitive && ch != strArr[strIdxStart]) |
20 | | | 29 | |
21 | if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[i])) | | 30 | if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxStart])) |
22 | | | 31 | |
Precondition Violations (4)
Row |
Violation |
1 | Conditional return false; |
2 | Conditional return false; |
3 | Conditional return false; |
4 | Conditional return false; |