if (fileSets == null) { fileSets = new LinkedList(); } fileSets.add(set);
if (children == null) { children = new ArrayList(); } children.add(child);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/UnknownElement.java
Method name: void addFileset(FileSet) Method name: void addChild(UnknownElement)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (fileSets == null) {
1
if (children == null) {
2
            fileSets = new LinkedList();
2
            children = new ArrayList();
3
        }
3
        }
4
        fileSets.add(set);
4
        children.add(child);
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 comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (fileSets == null)
    1
    if (fileSets == null)
    1
    if (children == null)
    Differences
    Expression1Expression2Difference
    fileSetschildrenVARIABLE_NAME_MISMATCH
    1
    if (children == null)
    2
    fileSets = new LinkedList();
    2
    fileSets = new LinkedList();
    2
    children = new ArrayList();
    Differences
    Expression1Expression2Difference
    fileSetschildrenVARIABLE_NAME_MISMATCH
    java.util.LinkedListjava.util.ArrayListSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression fileSets is a field being modified, and thus it cannot be parameterized
    Expression children is a field being modified, and thus it cannot be parameterized
    2
    children = new ArrayList();
    3
    fileSets.add(set);
    3
    fileSets.add(set);
    3
    children.add(child);
    Differences
    Expression1Expression2Difference
    setchildVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.UnknownElementSUBCLASS_TYPE_MISMATCH
    fileSetschildrenVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression fileSets cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression children cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    children.add(child);
    Precondition Violations (4)
    Row Violation
    1Expression fileSets is a field being modified, and thus it cannot be parameterized
    2Expression children is a field being modified, and thus it cannot be parameterized
    3Expression fileSets cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression children cannot be parameterized, because it has dependencies to/from statements that will be extracted