if (err != 0) { if (failOnError) { throw new BuildException("Exec returned: " + err, getLocation()); } else { log("Result: " + err, Project.MSG_ERR); } }
if (Execute.isFailure(returnCode)) { if (failOnError) { throw new BuildException(getTaskType() + " returned: " + returnCode, getLocation()); } else { log("Result: " + returnCode, Project.MSG_ERR); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Exec.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/ExecTask.java
Method name: int run(String) Method name: void runExecute(Execute)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (err != 0) {
1
if (Execute.isFailure(returnCode)) {
2
                if (failOnError) {
2
                if (failOnError) {
3
                    throw new BuildException("Exec returned: " + err
3
                    throw new BuildException(getTaskType() + " returned: "
4
, getLocation());
4
                        + returnCode, getLocation());
5
                } else {
5
                } else {
6
                    log("Result: " + err, Project.MSG_ERR);
6
                    log("Result: " + returnCode, Project.MSG_ERR);
7
                }
7
                }
8
            }
8
            }
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    40
    if (failOnError)
    12
    if (failOnError)
                                                                                                                                                                                  
    13
    throw new BuildException(getTaskType() + " returned: " + returnCode, getLocation());
    Preondition Violations
    Unmatched throw new BuildException(getTaskType() + " returned: " + returnCode,getLocation());
    13
    throw new BuildException(getTaskType() + " returned: " + returnCode, getLocation());
    41
    throw new BuildException("Exec returned: " + err, getLocation());
    41
    throw new BuildException("Exec returned: " + err, getLocation());
    Preondition Violations
    Unmatched throw new BuildException("Exec returned: " + err,getLocation());
                                                                                                                                            
    else
    else
    42
    log("Result: " + err, Project.MSG_ERR);
    42
    log("Result: " + err, Project.MSG_ERR);
    14
    log("Result: " + returnCode, Project.MSG_ERR);
    Differences
    Expression1Expression2Difference
    errreturnCodeVARIABLE_NAME_MISMATCH
    14
    log("Result: " + returnCode, Project.MSG_ERR);
    Precondition Violations (2)
    Row Violation
    1Unmatched throw new BuildException(getTaskType() + " returned: " + returnCode,getLocation());
    2Unmatched throw new BuildException("Exec returned: " + err,getLocation());