FileSet fs = new FileSet(); fs.setFile(src); addFileset(fs);
DirSet ds = new DirSet(); ds.setDefaultexcludes(useDefaultExcludes); ds.setDir(dir); ds.createPatternSet().addConfiguredPatternset(ps); dirSets.addElement(ds);
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/Javadoc.java
Method name: void setFile(File) Method name: void parsePackages(Vector, Path)
Number of AST nodes: 3 Number of AST nodes: 5
1
FileSet fs = new FileSet();
1
DirSet ds = new DirSet();
2
        fs.setFile(src);
2
        
3
        
3
            ds.setDefaultexcludes(useDefaultExcludes);
4
                    ds.setDir(dir);
5
                    ds.createPatternSet().addConfiguredPatternset(ps);
4
addFileset(fs);
6
                    dirSets.addElement(ds);
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();
    25
    DirSet ds = new DirSet();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.types.DirSetSUBCLASS_TYPE_MISMATCH
    fsdsVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.types.DirSetSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.types.DirSetSUBCLASS_TYPE_MISMATCH
    25
    DirSet ds = new DirSet();
                                                                                                
    26
    ds.setDefaultexcludes(useDefaultExcludes);
    Preondition Violations
    Unmatched statement ds.setDefaultexcludes(useDefaultExcludes); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    26
    ds.setDefaultexcludes(useDefaultExcludes);
    2
    fs.setFile(src);
    2
    fs.setFile(src);
    27
    ds.setDir(dir);
    Differences
    Expression1Expression2Difference
    setFilesetDirMETHOD_INVOCATION_NAME_MISMATCH
    srcdirVARIABLE_NAME_MISMATCH
    fsdsVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.types.DirSetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression fs.setFile(src) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setDir(dir) 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 ds.setDir(dir) is a void method call, and thus it cannot be parameterized
    27
    ds.setDir(dir);
                                                                                                                
    28
    ds.createPatternSet().addConfiguredPatternset(ps);
    Preondition Violations
    Unmatched statement ds.createPatternSet().addConfiguredPatternset(ps); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    28
    ds.createPatternSet().addConfiguredPatternset(ps);
    3
    addFileset(fs);
    3
    addFileset(fs);
    29
    dirSets.addElement(ds);
    Differences
    Expression1Expression2Difference
    addFilesetaddElementMETHOD_INVOCATION_NAME_MISMATCH
    fsdsVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.FileSetorg.apache.tools.ant.types.DirSetSUBCLASS_TYPE_MISMATCH
    dirSetsMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression addFileset(fs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dirSets.addElement(ds) 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 dirSets.addElement(ds) 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 dirSets.addElement(ds) 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 dirSets.addElement(ds) is a void method call, and thus it cannot be parameterized
    29
    dirSets.addElement(ds);
    Precondition Violations (15)
    Row Violation
    1Unmatched statement ds.setDefaultexcludes(useDefaultExcludes); 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 ds.setDir(dir) 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 ds.setDir(dir) is a void method call, and thus it cannot be parameterized
    6Unmatched statement ds.createPatternSet().addConfiguredPatternset(ps); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Expression addFileset(fs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression dirSets.addElement(ds) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression addFileset(fs) is a void method call, and thus it cannot be parameterized
    10Expression dirSets.addElement(ds) is a void method call, and thus it cannot be parameterized
    11Expression addFileset(fs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression dirSets.addElement(ds) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression addFileset(fs) is a void method call, and thus it cannot be parameterized
    14Expression dirSets.addElement(ds) is a void method call, and thus it cannot be parameterized
    15Clone fragment #1 returns variables , while Clone fragment #2 returns variables ds