if (!dir.exists()) { boolean done = dir.mkdirs(); if (!done) { String msg = "Directory " + localPath + " creation was not " + "successful for an unknown reason"; throw new BuildException(msg, getLocation()); } getProject().log("Created dir: " + dir.getAbsolutePath()); }
if (!dir.exists()) { boolean done = dir.mkdirs(); if (!done) { String msg = "Directory " + localPath + " creation was not " + "successful for an unknown reason"; throw new BuildException(msg, getLocation()); } getProject().log("Created dir: " + dir.getAbsolutePath()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOS.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
Method name: String getLocalPath() Method name: String getLocalpath()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (!dir.exists()) {
1
if (!dir.exists()) {
2
                boolean done = dir.mkdirs();
2
                boolean done = dir.mkdirs();
3
                if (!done) {
3
                if (!done) {
4
                    String msg = "Directory " + localPath + " creation was not "
4
                    String msg = "Directory " + localPath + " creation was not "
5
                        + "successful for an unknown reason";
5
                            + "successful for an unknown reason";
6
                    throw new BuildException(msg, getLocation());
6
                    throw new BuildException(msg, getLocation());
7
                }
7
                }
8
                getProject().log("Created dir: " + dir.getAbsolutePath());
8
                getProject().log("Created dir: " + dir.getAbsolutePath());
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    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.9
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    4
    if (!dir.exists())
    4
    if (!dir.exists())
    5
    boolean done = dir.mkdirs();
    5
    boolean done = dir.mkdirs();
    6
    if (!done)
    6
    if (!done)
    7
    String msg = "Directory " + localPath + " creation was not " + "successful for an unknown reason";
    7
    String msg = "Directory " + localPath + " creation was not " + "successful for an unknown reason";
    8
    throw new BuildException(msg, getLocation());
    8
    throw new BuildException(msg, getLocation());
    9
    getProject().log("Created dir: " + dir.getAbsolutePath());
    9
    getProject().log("Created dir: " + dir.getAbsolutePath());
    Precondition Violations (0)
    Row Violation