if (action == LIST_FILES) { File pd = listing.getParentFile(); if (!pd.exists()) { pd.mkdirs(); } bw = new BufferedWriter(new FileWriter(listing)); }
File parent = destinationFile.getParentFile(); if (!parent.exists()) { parent.mkdirs(); } os = new FileOutputStream(destinationFile.getAbsolutePath(), append);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTP.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Concat.java
Method name: int transferFiles(FTPClient, FileSet) Method name: void cat(ResourceCollection)
Number of AST nodes: 5 Number of AST nodes: 4
1
if (action == LIST_FILES) {
2
                File pd = listing.getParentFile();
1
File parent = destinationFile.getParentFile();
3
                if (!pd.exists()) {
2
                    if (!parent.exists()) {
4
                    pd.mkdirs();
3
                        parent.mkdirs();
5
                }
4
                    }
6
                bw = new BufferedWriter(new FileWriter(listing));
5
                    os = new 
7
            }
6
FileOutputStream(destinationFile.getAbsolutePath(),
7
                                              append);
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    22
    File pd = listing.getParentFile();
    22
    File pd = listing.getParentFile();
    9
    File parent = destinationFile.getParentFile();
    Differences
    Expression1Expression2Difference
    pdparentVARIABLE_NAME_MISMATCH
    listingdestinationFileVARIABLE_NAME_MISMATCH
    9
    File parent = destinationFile.getParentFile();
    23
    if (!pd.exists())
    23
    if (!pd.exists())
    10
    if (!parent.exists())
    Differences
    Expression1Expression2Difference
    pdparentVARIABLE_NAME_MISMATCH
    10
    if (!parent.exists())
    24
    pd.mkdirs();
    24
    pd.mkdirs();
    11
    parent.mkdirs();
    Differences
    Expression1Expression2Difference
    pdparentVARIABLE_NAME_MISMATCH
    11
    parent.mkdirs();
                                                                                                                                                
    12
    os = new FileOutputStream(destinationFile.getAbsolutePath(), append);
    25
    bw = new BufferedWriter(new FileWriter(listing));
                                                                                                          
    Precondition Violations (0)
    Row Violation