log("DEPRECATED - The copyfile task is deprecated. Use copy instead."); if (srcFile == null) { throw new BuildException("The src attribute must be present.", getLocation()); } if (!srcFile.exists()) { throw new BuildException("src " + srcFile.toString() + " does not exist.", getLocation()); } if (destFile == null) { throw new BuildException("The dest attribute must be present.", getLocation()); } if (srcFile.equals(destFile)) { log("Warning: src == dest", Project.MSG_WARN); }
log("DEPRECATED - The copydir task is deprecated. Use copy instead."); if (srcDir == null) { throw new BuildException("src attribute must be set!", getLocation()); } if (!srcDir.exists()) { throw new BuildException("srcdir " + srcDir.toString() + " does not exist!", getLocation()); } if (destDir == null) { throw new BuildException("The dest attribute must be set.", getLocation()); } if (srcDir.equals(destDir)) { log("Warning: src == dest", Project.MSG_WARN); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copyfile.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copydir.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 9 Number of AST nodes: 9
1
log("DEPRECATED - The copyfile task is deprecated.  Use copy instead.");
1
log("DEPRECATED - The copydir task is deprecated.  Use copy instead.");
2
        if (srcFile == null) {
2
        if (srcDir == null) {
3
            throw new BuildException("The src attribute must be present.",
3
            throw new BuildException("src attribute must be set!",
4
                                     getLocation());
4
                                     getLocation());
5
        }
5
        }
6
        if (!srcFile.exists()) {
6
        if (!srcDir.exists()) {
7
            throw new BuildException("src " + srcFile.toString()
7
            throw new BuildException("srcdir " + srcDir.toString()
8
                                     + " does not exist.", getLocation());
8
                                     + " does not exist!", getLocation());
9
        }
9
        }
10
        if (destFile == null) {
10
        if (destDir == null) {
11
            throw new BuildException("The dest attribute must be present.",
11
            throw new BuildException("The dest attribute must be set.",
12
                                     getLocation());
12
                                     getLocation());
13
        }
13
        }
14
        if (srcFile.equals(destFile)) {
14
        if (srcDir.equals(destDir)) {
15
            log("Warning: src == dest", Project.MSG_WARN);
15
            log("Warning: src == dest", Project.MSG_WARN);
16
        }
16
        }
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons35
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)10.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    log("DEPRECATED - The copyfile task is deprecated.  Use copy instead.");
    1
    log("DEPRECATED - The copyfile task is deprecated. Use copy instead.");
    1
    log("DEPRECATED - The copydir task is deprecated. Use copy instead.");
    Differences
    Expression1Expression2Difference
    "DEPRECATED - The copyfile task is deprecated. Use copy instead.""DEPRECATED - The copydir task is deprecated. Use copy instead."LITERAL_VALUE_MISMATCH
    1
    log("DEPRECATED - The copydir task is deprecated.  Use copy instead.");
    2
    if (srcFile == null)
    2
    if (srcFile == null)
    2
    if (srcDir == null)
    Differences
    Expression1Expression2Difference
    srcFilesrcDirVARIABLE_NAME_MISMATCH
    2
    if (srcDir == null)
    3
    throw new BuildException("The src attribute must be present.", getLocation());
    3
    throw new BuildException("The src attribute must be present.", getLocation());
    3
    throw new BuildException("src attribute must be set!", getLocation());
    Differences
    Expression1Expression2Difference
    "The src attribute must be present.""src attribute must be set!"LITERAL_VALUE_MISMATCH
    3
    throw new BuildException("src attribute must be set!", getLocation());
    4
    if (!srcFile.exists())
    4
    if (!srcFile.exists())
    4
    if (!srcDir.exists())
    Differences
    Expression1Expression2Difference
    srcFilesrcDirVARIABLE_NAME_MISMATCH
    4
    if (!srcDir.exists())
    5
    throw new BuildException("src " + srcFile.toString() + " does not exist.", getLocation());
    5
    throw new BuildException("src " + srcFile.toString() + " does not exist.", getLocation());
    5
    throw new BuildException("srcdir " + srcDir.toString() + " does not exist!", getLocation());
    Differences
    Expression1Expression2Difference
    " does not exist."" does not exist!"LITERAL_VALUE_MISMATCH
    "src ""srcdir "LITERAL_VALUE_MISMATCH
    srcFilesrcDirVARIABLE_NAME_MISMATCH
    5
    throw new BuildException("srcdir " + srcDir.toString() + " does not exist!", getLocation());
    6
    if (destFile == null)
    6
    if (destFile == null)
    6
    if (destDir == null)
    Differences
    Expression1Expression2Difference
    destFiledestDirVARIABLE_NAME_MISMATCH
    6
    if (destDir == null)
    7
    throw new BuildException("The dest attribute must be present.", getLocation());
    7
    throw new BuildException("The dest attribute must be present.", getLocation());
    7
    throw new BuildException("The dest attribute must be set.", getLocation());
    Differences
    Expression1Expression2Difference
    "The dest attribute must be present.""The dest attribute must be set."LITERAL_VALUE_MISMATCH
    7
    throw new BuildException("The dest attribute must be set.", getLocation());
    8
    if (srcFile.equals(destFile))
    8
    if (srcFile.equals(destFile))
    8
    if (srcDir.equals(destDir))
    Differences
    Expression1Expression2Difference
    destFiledestDirVARIABLE_NAME_MISMATCH
    srcFilesrcDirVARIABLE_NAME_MISMATCH
    8
    if (srcDir.equals(destDir))
    9
    log("Warning: src == dest", Project.MSG_WARN);
    9
    log("Warning: src == dest", Project.MSG_WARN);
    Precondition Violations (0)
    Row Violation