if (excludes != null && excludes.length() > 0) { StringTokenizer tok = new StringTokenizer(excludes, ", ", false); while (tok.hasMoreTokens()) { createExclude().setName(tok.nextToken()); } }
if (input != null) { StringTokenizer st = new StringTokenizer(input); while (st.hasMoreTokens()) { result.append(st.nextToken()); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/PatternSet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java
Method name: void setExcludes(String) Method name: String removeWhitespace(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (excludes != null && excludes.length() > 0) {
1
if (input != null) {
2
            StringTokenizer tok = new StringTokenizer(excludes, ", ", false);
2
            StringTokenizer st = new StringTokenizer(input);
3
            while (tok.hasMoreTokens()) {
3
            while (st.hasMoreTokens()) {
4
                createExclude().setName(tok.nextToken());
4
                result.append(st.nextToken());
5
            }
5
            }
6
        }
6
        }
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.2
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    StringTokenizer tok = new StringTokenizer(excludes, ", ", false);
    4
    StringTokenizer tok = new StringTokenizer(excludes, ", ", false);
    3
    StringTokenizer st = new StringTokenizer(input);
    Differences
    Expression1Expression2Difference
    tokstVARIABLE_NAME_MISMATCH
    new StringTokenizer(excludes,", ",false)new StringTokenizer(input)ARGUMENT_NUMBER_MISMATCH
    3
    StringTokenizer st = new StringTokenizer(input);
    5
    while (tok.hasMoreTokens())
    5
    while (tok.hasMoreTokens())
    4
    while (st.hasMoreTokens())
    Differences
    Expression1Expression2Difference
    tokstVARIABLE_NAME_MISMATCH
    4
    while (st.hasMoreTokens())
                                                                      
    5
    result.append(st.nextToken());
    Preondition Violations
    Unmatched statement result.append(st.nextToken()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    result.append(st.nextToken());
    6
    createExclude().setName(tok.nextToken());
    6
    createExclude().setName(tok.nextToken());
    Preondition Violations
    Unmatched statement createExclude().setName(tok.nextToken()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                            
    Precondition Violations (2)
    Row Violation
    1Unmatched statement result.append(st.nextToken()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement createExclude().setName(tok.nextToken()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted