if (destfile.exists() && !destfile.canWrite()) { String message = "Can not write to the specified destfile!"; if (failonerror) { throw new BuildException(message, getLocation()); } else { log(message, Project.MSG_ERR); } return; }
if (inFile.exists() && inFile.isDirectory()) { String message = "srcfile is a directory!"; if (failonerror) { throw new BuildException(message, getLocation()); } else { log(message, Project.MSG_ERR); } return; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/EchoProperties.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (destfile.exists() && !destfile.canWrite()) {
1
if (inFile.exists() && inFile.isDirectory()) {
2
                    String message =
2
                String message =
3
                        "Can not write to the specified destfile!";
4
    
3
 "srcfile is a directory!";
5
                if (failonerror) {
4
                if (failonerror) {
6
                        throw new BuildException(message, getLocation());
5
                    throw new BuildException(message, getLocation());
7
                    } else {
6
                } else {
8
                        log(message, Project.MSG_ERR);
7
                    log(message, Project.MSG_ERR);
9
                    }
8
                
10
    
9
}
11
                return;
10
                return;
12
                }
11
            }
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.2
Clones locationClones are in the same method
Number of node comparisons18
  1. {Non-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 2
    Mapped Statements
    ID Statement ID Statement
    41
    if (destfile.exists() && !destfile.canWrite())
    41
    if (destfile.exists() && !destfile.canWrite())
    7
    if (inFile.exists() && inFile.isDirectory())
    Differences
    Expression1Expression2Difference
    destfileinFileVARIABLE_NAME_MISMATCH
    !destfile.canWrite()inFile.isDirectory()TYPE_COMPATIBLE_REPLACEMENT
    7
    if (inFile.exists() && inFile.isDirectory())
    42
    String message = "Can not write to the specified destfile!";
    42
    String message = "Can not write to the specified destfile!";
    8
    String message = "srcfile is a directory!";
    Differences
    Expression1Expression2Difference
    "Can not write to the specified destfile!""srcfile is a directory!"LITERAL_VALUE_MISMATCH
    8
    String message = "srcfile is a directory!";
    43
    if (failonerror)
    9
    if (failonerror)
    44
    throw new BuildException(message, getLocation());
    10
    throw new BuildException(message, getLocation());
    else
    else
    45
    log(message, Project.MSG_ERR);
    11
    log(message, Project.MSG_ERR);
    46
    return;
    46
    return;
    12
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    12
    return;
    Precondition Violations (2)
    Row Violation
    1Conditional return;
    2Conditional return;