if (exe.killedProcess()) { String msg = "Timeout: killed the sub-process"; if (failOnError) { throw new BuildException(msg); } else { log(msg, Project.MSG_WARN); } }
String errorMsg = "File " + file + " cannot be read"; if (failOnError) { throw new BuildException(errorMsg); } else { log(errorMsg, Project.MSG_ERR); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/ExecTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
Method name: void runExecute(Execute) Method name: void execute()
Number of AST nodes: 5 Number of AST nodes: 4
1
if (exe.killedProcess()) {
2
                String msg = "Timeout: killed the sub-process";
1
String errorMsg = "File " + file + " cannot be read";
3
                if (failOnError) {
2
                if (failOnError) {
4
                    throw new BuildException(msg);
3
                    throw new BuildException(errorMsg);
5
                } else {
4
                } else {
6
                    log(msg, Project.MSG_WARN);
5
                    log(errorMsg, Project.MSG_ERR);
7
                }
6
    
8
            }
7
            }
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons10
  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)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    String msg = "Timeout: killed the sub-process";
    5
    String msg = "Timeout: killed the sub-process";
    8
    String errorMsg = "File " + file + " cannot be read";
    Differences
    Expression1Expression2Difference
    msgerrorMsgVARIABLE_NAME_MISMATCH
    "Timeout: killed the sub-process""File " + file + " cannot be read"TYPE_COMPATIBLE_REPLACEMENT
    8
    String errorMsg = "File " + file + " cannot be read";
    6
    if (failOnError)
    9
    if (failOnError)
    7
    throw new BuildException(msg);
    7
    throw new BuildException(msg);
    10
    throw new BuildException(errorMsg);
    Differences
    Expression1Expression2Difference
    msgerrorMsgVARIABLE_NAME_MISMATCH
    10
    throw new BuildException(errorMsg);
    else
    else
    8
    log(msg, Project.MSG_WARN);
    8
    log(msg, Project.MSG_WARN);
    11
    log(errorMsg, Project.MSG_ERR);
    Differences
    Expression1Expression2Difference
    msgerrorMsgVARIABLE_NAME_MISMATCH
    MSG_WARNMSG_ERRVARIABLE_NAME_MISMATCH
    11
    log(errorMsg, Project.MSG_ERR);
    Precondition Violations (0)
    Row Violation