if (ch != '?') { if (isCaseSensitive && ch != strArr[strIdxStart]) { return false; // Character mismatch } if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxStart])) { return false; // Character mismatch } }
if (ch != '?') { if (isCaseSensitive && ch != strArr[strIdxEnd]) { return false; // Character mismatch } if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxEnd])) { 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[strIdxStart]) {
2
                if (isCaseSensitive && ch != strArr[strIdxEnd]) {
3
                    return false; // Character mismatch
3
                    return false; // Character mismatch
4
                }
4
                }
5
                if (!isCaseSensitive && Character.toUpperCase(ch)
5
                if (!isCaseSensitive && Character.toUpperCase(ch)
6
                        != Character.toUpperCase(strArr[strIdxStart])) {
6
                        != Character.toUpperCase(strArr[strIdxEnd])) {
7
                    return false; // Character mismatch
7
                    return false; // Character mismatch
8
                }
8
                }
9
            }
9
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.8
Clones locationClones are in the same method
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    27
    if (ch != '?')
    40
    if (ch != '?')
    28
    if (isCaseSensitive && ch != strArr[strIdxStart])
    28
    if (isCaseSensitive && ch != strArr[strIdxStart])
    41
    if (isCaseSensitive && ch != strArr[strIdxEnd])
    Differences
    Expression1Expression2Difference
    strIdxStartstrIdxEndVARIABLE_NAME_MISMATCH
    41
    if (isCaseSensitive && ch != strArr[strIdxEnd])
    29
    return false;
    42
    return false;
    30
    if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxStart]))
    30
    if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxStart]))
    43
    if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxEnd]))
    Differences
    Expression1Expression2Difference
    strIdxStartstrIdxEndVARIABLE_NAME_MISMATCH
    43
    if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxEnd]))
    31
    return false;
    44
    return false;
    Precondition Violations (1)
    Row Violation
    1Not all possible execution flows end in a return statement