FileSet fs = new FileSet(); fs.setFile(src); addFileset(fs);
if (sources.size() > 0 && targets.size() > 0 && !uptodate(sources, targets)) { log("Deleting all target files.", Project.MSG_VERBOSE); Delete delete = new Delete(); delete.bindToOwner(this); delete.add(targets); delete.perform(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/DependSet.java
Method name: void setFile(File) Method name: void execute()
Number of AST nodes: 3 Number of AST nodes: 6
1
FileSet fs = new FileSet();
2
        fs.setFile(src
1
if (sources.size() > 0 && targets.size() > 0 && !uptodate(sources, targets)) {
2
           log("Deleting all target files.", Project.MSG_VERBOSE);
3
           Delete delete = new Delete();
3
);
4
           delete.bindToOwner(this);
4
        addFileset(fs);
5
           delete.add(targets);
6
           delete.perform();
7
        }
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons11
  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 fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    FileSet fs = new FileSet();
    1
    FileSet fs = new FileSet();
    7
    Delete delete = new Delete();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.taskdefs.DeleteSUBCLASS_TYPE_MISMATCH
    fsdeleteVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.taskdefs.DeleteSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.taskdefs.DeleteSUBCLASS_TYPE_MISMATCH
    7
    Delete delete = new Delete();
                                                            
    8
    delete.bindToOwner(this);
    Preondition Violations
    Unmatched statement delete.bindToOwner(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    delete.bindToOwner(this);
                                                  
    9
    delete.add(targets);
    2
    fs.setFile(src);
    2
    fs.setFile(src);
    10
    delete.perform();
    Differences
    Expression1Expression2Difference
    setFileperformMETHOD_INVOCATION_NAME_MISMATCH
    fsdeleteVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.taskdefs.DeleteSUBCLASS_TYPE_MISMATCH
    fs.setFile(src)delete.perform()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression fs.setFile(src) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression delete.perform() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression fs.setFile(src) is a void method call, and thus it cannot be parameterized
    Expression delete.perform() is a void method call, and thus it cannot be parameterized
    Expression fs.setFile(src) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression delete.perform() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression fs.setFile(src) is a void method call, and thus it cannot be parameterized
    Expression delete.perform() is a void method call, and thus it cannot be parameterized
    10
    delete.perform();
    3
    addFileset(fs);
    3
    addFileset(fs);
    6
    log("Deleting all target files.", Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    addFilesetlogMETHOD_INVOCATION_NAME_MISMATCH
    addFileset(fs)log("Deleting all target files.",Project.MSG_VERBOSE)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression addFileset(fs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addFileset(fs) is a void method call, and thus it cannot be parameterized
    Expression log("Deleting all target files.",Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    Expression addFileset(fs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addFileset(fs) is a void method call, and thus it cannot be parameterized
    Expression log("Deleting all target files.",Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    6
    log("Deleting all target files.", Project.MSG_VERBOSE);
    Precondition Violations (16)
    Row Violation
    1Unmatched statement delete.bindToOwner(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression fs.setFile(src) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression delete.perform() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression fs.setFile(src) is a void method call, and thus it cannot be parameterized
    5Expression delete.perform() is a void method call, and thus it cannot be parameterized
    6Expression fs.setFile(src) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression delete.perform() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression fs.setFile(src) is a void method call, and thus it cannot be parameterized
    9Expression delete.perform() is a void method call, and thus it cannot be parameterized
    10Expression addFileset(fs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression addFileset(fs) is a void method call, and thus it cannot be parameterized
    12Expression log("Deleting all target files.",Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    13Expression addFileset(fs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression addFileset(fs) is a void method call, and thus it cannot be parameterized
    15Expression log("Deleting all target files.",Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    16Clone fragment #1 returns variables , while Clone fragment #2 returns variables delete