String[] incl = other.getIncludePatterns(p); if (incl != null) { for (int i = 0; i < incl.length; i++) { createInclude().setName(incl[i]); } }
String[] excl = other.getExcludePatterns(p); if (excl != null) { for (int i = 0; i < excl.length; i++) { createExclude().setName(excl[i]); } }
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/PatternSet.java
Method name: void append(PatternSet, Project) Method name: void append(PatternSet, Project)
Number of AST nodes: 4 Number of AST nodes: 4
1
String[] incl = other.getIncludePatterns(p);
1
String[] excl = other.getExcludePatterns(p);
2
        if (incl != null) {
2
        if (excl != null) {
3
            for (int i = 0; i < incl.length; i++) {
3
            for (int i = 0; i < excl.length; i++) {
4
                createInclude().setName(incl[i]);
4
                createExclude().setName(excl[i]);
5
            }
5
            }
6
        }
6
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons6
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    String[] incl = other.getIncludePatterns(p);
    3
    String[] incl = other.getIncludePatterns(p);
    7
    String[] excl = other.getExcludePatterns(p);
    Differences
    Expression1Expression2Difference
    inclexclVARIABLE_NAME_MISMATCH
    getIncludePatternsgetExcludePatternsMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression other.getIncludePatterns(p) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression other.getExcludePatterns(p) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    String[] excl = other.getExcludePatterns(p);
    4
    if (incl != null)
    4
    if (incl != null)
    8
    if (excl != null)
    Differences
    Expression1Expression2Difference
    inclexclVARIABLE_NAME_MISMATCH
    8
    if (excl != null)
    5
    for (int i = 0; i < incl.length; i++)
    5
    for (int i = 0; i < incl.length; i++)
    9
    for (int i = 0; i < excl.length; i++)
    Differences
    Expression1Expression2Difference
    inclexclVARIABLE_NAME_MISMATCH
    9
    for (int i = 0; i < excl.length; i++)
    6
    createInclude().setName(incl[i]);
    6
    createInclude().setName(incl[i]);
    10
    createExclude().setName(excl[i]);
    Differences
    Expression1Expression2Difference
    inclexclVARIABLE_NAME_MISMATCH
    createIncludecreateExcludeMETHOD_INVOCATION_NAME_MISMATCH
    10
    createExclude().setName(excl[i]);
    Precondition Violations (2)
    Row Violation
    1Expression other.getIncludePatterns(p) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression other.getExcludePatterns(p) cannot be parameterized, because it has dependencies to/from statements that will be extracted