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: 7 | Number of AST nodes: 8 | |||
1 | for (int i = 0; i <= patIdxEnd; i++) {↵ | 1 | while ((ch = patArr[patIdxStart]) != '*' && strIdxStart <= strIdxEnd) {↵ | |
2 | ch = patArr[i];↵ | |||
3 | if (ch != '?') {↵ | 2 | if (ch != '?') {↵ | |
4 | if (isCaseSensitive && ch != strArr[i]) {↵ | 3 | if (isCaseSensitive && ch != strArr[strIdxStart]) {↵ | |
5 | return false; // Character mismatch↵ | 4 | return false; // Character mismatch↵ | |
6 | }↵ | 5 | ↵ | |
7 | ↵ | 6 | }↵ | |
8 | if (!isCaseSensitive && Character.toUpperCase(ch)↵ | 7 | if (!isCaseSensitive && Character.toUpperCase(ch)↵ | |
9 | != Character.toUpperCase(strArr[i])) {↵ | 8 | != Character.toUpperCase(strArr[strIdxStart])) {↵ | |
10 | return false; // Character mismatch↵ | 9 | return false; // Character mismatch↵ | |
11 | ↵ | 10 | }↵ | |
12 | }↵ | 11 | }↵ | |
13 | ↵ | 12 | patIdxStart++;↵ | |
14 | }↵ | 13 | ↵ | |
15 | ↵ | 14 | strIdxStart++;↵ | |
16 | } | 15 |
| |
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.6 |
Clones location | Clones are in the same method |
Number of node comparisons | 15 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | ch = patArr[i]; |
| | |||||||||||
18 | if (ch != '?') | 27 | if (ch != '?') | |||||||||||
19 | if (isCaseSensitive && ch != strArr[i]) |
| 28 | if (isCaseSensitive && ch != strArr[strIdxStart]) | ||||||||||
20 | return false; |
| 29 | return false; | ||||||||||
21 | if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[i])) |
| 30 | if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxStart])) | ||||||||||
22 | return false; |
| 31 | return false; |
Row | Violation |
---|---|
1 | Unmatched statement ch=patArr[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Conditional return false; |
3 | Conditional return false; |
4 | Conditional return false; |
5 | Conditional return false; |