List rcs = getResourceCollections(); int size = rcs.size(); if (size < 2) { throw new BuildException("The intersection of " + size + " resource collection" + ((size == 1) ? "" : "s") + " is undefined."); } ArrayList al = new ArrayList();
List rc = getResourceCollections(); int size = rc.size(); if (size < 2) { throw new BuildException("The difference of " + size + " resource collection" + ((size == 1) ? "" : "s") + " is undefined."); } HashSet hs = new HashSet();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/Intersect.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/Difference.java
Method name: Collection getCollection() Method name: Collection getCollection()
Number of AST nodes: 5 Number of AST nodes: 5
1
List rcs = getResourceCollections();
1
List rc = getResourceCollections();
2
        int size = rcs.size();
2
        int size = rc.size();
3
        if (size < 2) {
3
        if (size < 2) {
4
            throw new BuildException("The intersection of " + size
4
            throw new BuildException("The difference of " + size
5
                + " resource collection" + ((size == 1) ? "" : "s")
5
                + " resource collection" + ((size == 1) ? "" : "s")
6
                + " is undefined.");
6
                + " is undefined.");
7
        }
7
        }
8
        ArrayList al = new ArrayList();
8
        HashSet hs = new HashSet();
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  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)12.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    List rcs = getResourceCollections();
    1
    List rcs = getResourceCollections();
    1
    List rc = getResourceCollections();
    Differences
    Expression1Expression2Difference
    rcsrcVARIABLE_NAME_MISMATCH
    1
    List rc = getResourceCollections();
    2
    int size = rcs.size();
    2
    int size = rcs.size();
    2
    int size = rc.size();
    Differences
    Expression1Expression2Difference
    rcsrcVARIABLE_NAME_MISMATCH
    2
    int size = rc.size();
    3
    if (size < 2)
    3
    if (size < 2)
    4
    throw new BuildException("The intersection of " + size + " resource collection" + ((size == 1) ? "" : "s") + " is undefined.");
    4
    throw new BuildException("The intersection of " + size + " resource collection" + ((size == 1) ? "" : "s") + " is undefined.");
    4
    throw new BuildException("The difference of " + size + " resource collection" + ((size == 1) ? "" : "s") + " is undefined.");
    Differences
    Expression1Expression2Difference
    "The intersection of ""The difference of "LITERAL_VALUE_MISMATCH
    4
    throw new BuildException("The difference of " + size + " resource collection" + ((size == 1) ? "" : "s") + " is undefined.");
    5
    ArrayList al = new ArrayList();
    5
    ArrayList al = new ArrayList();
    5
    HashSet hs = new HashSet();
    Differences
    Expression1Expression2Difference
    java.util.ArrayListjava.util.HashSetSUBCLASS_TYPE_MISMATCH
    alhsVARIABLE_NAME_MISMATCH
    java.util.ArrayListjava.util.HashSetSUBCLASS_TYPE_MISMATCH
    java.util.ArrayListjava.util.HashSetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new ArrayList() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new HashSet() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    HashSet hs = new HashSet();
    Precondition Violations (3)
    Row Violation
    1Expression new ArrayList() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new HashSet() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables rcs, al , while Clone fragment #2 returns variables rc, hs