if (dest == null) { throw new BuildException("dest attribute is required", getLocation()); } if (dest.exists() && dest.isDirectory()) { throw new BuildException("The specified destination is a directory", getLocation()); }
if (tarFile == null) { throw new BuildException("tarfile attribute must be set!", getLocation()); } if (tarFile.exists() && tarFile.isDirectory()) { throw new BuildException("tarfile is a directory!", getLocation()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Get.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Tar.java
Method name: boolean doGet(int, DownloadProgress) Method name: void execute()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (dest == null) {
1
if (tarFile == null) {
2
            throw new BuildException("dest attribute is required",
2
            throw new BuildException("tarfile attribute must be set!",
3
 getLocation());
3
                                     getLocation());
4
        }
4
        }
5
        if (dest.exists() && dest.isDirectory()) {
5
        if (tarFile.exists() && tarFile.isDirectory()) {
6
            throw new BuildException("The specified destination is a directory",
6
            throw new BuildException("tarfile is a directory!",
7
                    getLocation());
7
                                     getLocation());
8
        }
8
        }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (dest == null)
    3
    if (dest == null)
    1
    if (tarFile == null)
    Differences
    Expression1Expression2Difference
    desttarFileVARIABLE_NAME_MISMATCH
    1
    if (tarFile == null)
    4
    throw new BuildException("dest attribute is required", getLocation());
    4
    throw new BuildException("dest attribute is required", getLocation());
    2
    throw new BuildException("tarfile attribute must be set!", getLocation());
    Differences
    Expression1Expression2Difference
    "dest attribute is required""tarfile attribute must be set!"LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("tarfile attribute must be set!", getLocation());
    5
    if (dest.exists() && dest.isDirectory())
    5
    if (dest.exists() && dest.isDirectory())
    3
    if (tarFile.exists() && tarFile.isDirectory())
    Differences
    Expression1Expression2Difference
    desttarFileVARIABLE_NAME_MISMATCH
    desttarFileVARIABLE_NAME_MISMATCH
    3
    if (tarFile.exists() && tarFile.isDirectory())
    6
    throw new BuildException("The specified destination is a directory", getLocation());
    6
    throw new BuildException("The specified destination is a directory", getLocation());
    4
    throw new BuildException("tarfile is a directory!", getLocation());
    Differences
    Expression1Expression2Difference
    "The specified destination is a directory""tarfile is a directory!"LITERAL_VALUE_MISMATCH
    4
    throw new BuildException("tarfile is a directory!", getLocation());
    Precondition Violations (0)
    Row Violation