File dir = getProject().resolveFile(localPath); 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()); }
File dir = getProject().resolveFile(localPath); 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: 7 Number of AST nodes: 7
1
File dir = getProject().resolveFile(localPath);
1
File dir = getProject().resolveFile(localPath);
2
            if (!dir.exists()) {
2
            if (!dir.exists()) {
3
                boolean done = dir.mkdirs();
3
                boolean done = dir.mkdirs();
4
                if (!done) {
4
                if (!done) {
5
                    String msg = "Directory " + localPath + " creation was not "
5
                    String msg = "Directory " + localPath + " creation was not "
6
                        + "successful for an unknown reason";
6
                            + "successful for an unknown reason";
7
                    throw new BuildException(msg, getLocation());
7
                    throw new BuildException(msg, getLocation());
8
                }
8
                }
9
                getProject().log("Created dir: " + dir.getAbsolutePath());
9
                getProject().log("Created dir: " + dir.getAbsolutePath());
10
            }
10
            }
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons19
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    3
    File dir = getProject().resolveFile(localPath);
    3
    File dir = getProject().resolveFile(localPath);
    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 (1)
    Row Violation
    1Clone fragment #1 returns variables dir , while Clone fragment #2 returns variables