if (Execute.isFailure(returncode)) { String msg = "'" + toExecute.getExecutable() + "' failed with exit code " + returncode; if (failOnError) { throw new BuildException(msg); } else { log(msg, Project.MSG_ERR); } }
if (Execute.isFailure(err)) { if (failOnError) { throw new BuildException(title + " returned: " + err, owner.getLocation()); } else { owner.log(title + " Result: " + err, Project.MSG_ERR); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/Rpm.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
Method name: void execute() Method name: void runCommand()
Number of AST nodes: 5 Number of AST nodes: 4
1
if (Execute.isFailure(returncode)) {
1
if (Execute.isFailure(err)) {
2
                String msg = "'" + toExecute.getExecutable()
3
                    + "' failed with exit code " + returncode;
4
                if (failOnError) {
2
                if (failOnError) {
5
                    throw new BuildException(msg);
3
                    throw new BuildException(title + " returned: " + err, owner.getLocation());
6
                } else {
4
                } else {
7
                    log(msg, Project.MSG_ERR);
5
                    owner.log(title + "  Result: " + err, Project.MSG_ERR);
8
                }
6
                }
9
            }
7
            }
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
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    40
    if (Execute.isFailure(returncode))
    40
    if (Execute.isFailure(returncode))
    11
    if (Execute.isFailure(err))
    Differences
    Expression1Expression2Difference
    returncodeerrVARIABLE_NAME_MISMATCH
    11
    if (Execute.isFailure(err))
    41
    String msg = "'" + toExecute.getExecutable() + "' failed with exit code " + returncode;
                                                                                                                                                                                    
    42
    if (failOnError)
    12
    if (failOnError)
    43
    throw new BuildException(msg);
    43
    throw new BuildException(msg);
    13
    throw new BuildException(title + " returned: " + err, owner.getLocation());
    Differences
    Expression1Expression2Difference
    new BuildException(msg)new BuildException(title + " returned: " + err,owner.getLocation())ARGUMENT_NUMBER_MISMATCH
    13
    throw new BuildException(title + " returned: " + err, owner.getLocation());
    else
    else
    44
    log(msg, Project.MSG_ERR);
    44
    log(msg, Project.MSG_ERR);
    14
    owner.log(title + " Result: " + err, Project.MSG_ERR);
    Differences
    Expression1Expression2Difference
    msgtitle + " Result: " + errTYPE_COMPATIBLE_REPLACEMENT
    ownerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression log(msg,Project.MSG_ERR) is a void method call, and thus it cannot be parameterized
    Expression owner.log(title + " Result: " + err,Project.MSG_ERR) is a void method call, and thus it cannot be parameterized
    14
    owner.log(title + "  Result: " + err, Project.MSG_ERR);
    Precondition Violations (2)
    Row Violation
    1Expression log(msg,Project.MSG_ERR) is a void method call, and thus it cannot be parameterized
    2Expression owner.log(title + " Result: " + err,Project.MSG_ERR) is a void method call, and thus it cannot be parameterized