File d = new File(toDirNames[i]); if (!d.exists()) { if (!d.mkdirs()) { log("Unable to create directory " + d.getAbsolutePath(), Project.MSG_ERR); } else { createCount++; } }
File d = new File(dirs[i]); if (!d.exists()) { if (!d.mkdirs()) { log("Unable to create directory " + d.getAbsolutePath(), Project.MSG_ERR); } else { createCount++; } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Move.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copy.java
Method name: void doFileOperations() Method name: void doFileOperations()
Number of AST nodes: 5 Number of AST nodes: 5
1
File d = new File(toDirNames[i]);
1
File d = new File(dirs[i]);
2
                    if (!d.exists()) {
2
                    if (!d.exists()) {
3
                        if (!d.mkdirs()) {
3
                        if (!d.mkdirs()) {
4
                            log("Unable to create directory "
4
                            log("Unable to create directory "
5
                                + d.getAbsolutePath(), Project.MSG_ERR);
5
                                + d.getAbsolutePath(), Project.MSG_ERR);
6
                        } else {
6
                        } else {
7
                            createCount++;
7
                            createCount++;
8
                        }
8
                        }
9
                    }
9
                    }
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.7
Clones locationClones are in different classes having the same super class
Number of node comparisons15
  1. {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)78.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    51
    File d = new File(toDirNames[i]);
    51
    File d = new File(toDirNames[i]);
    26
    File d = new File(dirs[i]);
    Differences
    Expression1Expression2Difference
    toDirNamesdirsVARIABLE_NAME_MISMATCH
    26
    File d = new File(dirs[i]);
    52
    if (!d.exists())
    27
    if (!d.exists())
    53
    if (!d.mkdirs())
    28
    if (!d.mkdirs())
    54
    log("Unable to create directory " + d.getAbsolutePath(), Project.MSG_ERR);
    29
    log("Unable to create directory " + d.getAbsolutePath(), Project.MSG_ERR);
    else
    else
    55
    createCount++;
    30
    createCount++;
    Precondition Violations (0)
    Row Violation