if (thrownException != null) { if (thrownException instanceof BuildException) { log(curtarget, "Target '" + curtarget.getName() + "' failed with message '" + thrownException.getMessage() + "'.", MSG_ERR); // only the first build exception is reported if (buildException == null) { buildException = (BuildException) thrownException; } } else { log(curtarget, "Target '" + curtarget.getName() + "' failed with message '" + thrownException.getMessage() + "'.", MSG_ERR); thrownException.printStackTrace(System.err); if (buildException == null) { buildException = new BuildException(thrownException); } } }
if (thrownException instanceof BuildException) { log("File '" + file + "' failed with message '" + thrownException.getMessage() + "'.", Project.MSG_ERR); // only the first build exception is reported if (buildException == null) { buildException = (BuildException) thrownException; } } else { log("Target '" + file + "' failed with message '" + thrownException.getMessage() + "'.", Project.MSG_ERR); thrownException.printStackTrace(System.err); if (buildException == null) { buildException = new BuildException(thrownException); } } if (verbose && subdirPath != null) { log("Leaving directory: " + subdirPath + "\n", Project.MSG_INFO); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Project.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/SubAnt.java
Method name: void executeSortedTargets(Vector) Method name: void execute()
Number of AST nodes: 9 Number of AST nodes: 10
1
if (thrownException != null) {
2
                    if (thrownException instanceof BuildException) {
1
if (thrownException instanceof BuildException) {
3
                        log(curtarget,
2
                    
4
                            "Target '" + curtarget.getName()
5
    
3
log("File '" + file
6
                        + "' failed with message '"
4
                        + "' failed with message '"
7
                            + thrownException.getMessage() + "'.", MSG_ERR);
5
                        + thrownException.getMessage() + "'.", Project.MSG_ERR);
8
                        // only the first build exception is reported
6
                    // only the first build exception is reported
9
                        if (buildException == null) {
7
                    if (buildException == null) {
10
                            buildException = (BuildException) thrownException;
8
                        buildException = (BuildException) thrownException;
11
                        }
9
                    
12
   
10
}
13
                 } else {
11
                } else {
14
                        log(curtarget,
12
                    
15
                            "Target '" + curtarget.getName()
16
    
13
log("Target '" + file
17
                        + "' failed with message '"
14
                        + "' failed with message '"
18
                            + thrownException.getMessage() + "'.", MSG_ERR);
15
                        + thrownException.getMessage() + "'.", Project.MSG_ERR);
19
                        thrownException.printStackTrace(System.err);
16
                    thrownException.printStackTrace(System.err);
20
                        if (buildException == null) {
17
                    if (buildException == null) {
21
                            buildException =
18
                        buildException =
22
                                new BuildException(thrownException);
19
                            new BuildException(thrownException);
23
          
20
                    }
24
              }
21
                }
25
                    }
22
                if (verbose && subdirPath != null) {
23
                    log("Leaving directory: " + subdirPath + "\n", Project.MSG_INFO);
26
                }
24
                }
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.6
Clones locationClones are in different classes
Number of node comparisons31
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    18
    if (thrownException instanceof BuildException)
    28
    if (thrownException instanceof BuildException)
    19
    log(curtarget, "Target '" + curtarget.getName() + "' failed with message '" + thrownException.getMessage() + "'.", MSG_ERR);
    19
    log(curtarget, "Target '" + curtarget.getName() + "' failed with message '" + thrownException.getMessage() + "'.", MSG_ERR);
    29
    log("File '" + file + "' failed with message '" + thrownException.getMessage() + "'.", Project.MSG_ERR);
    Differences
    Expression1Expression2Difference
    log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR)log("File '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log("File '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR) is a void method call, and thus it cannot be parameterized
    Expression log("File '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR) is a void method call, and thus it cannot be parameterized
    29
    log("File '" + file + "' failed with message '" + thrownException.getMessage() + "'.", Project.MSG_ERR);
    20
    if (buildException == null)
    30
    if (buildException == null)
    21
    buildException = (BuildException)thrownException;
    31
    buildException = (BuildException)thrownException;
    else
    else
    22
    log(curtarget, "Target '" + curtarget.getName() + "' failed with message '" + thrownException.getMessage() + "'.", MSG_ERR);
    22
    log(curtarget, "Target '" + curtarget.getName() + "' failed with message '" + thrownException.getMessage() + "'.", MSG_ERR);
    32
    log("Target '" + file + "' failed with message '" + thrownException.getMessage() + "'.", Project.MSG_ERR);
    Differences
    Expression1Expression2Difference
    log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR)log("Target '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log("Target '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR) is a void method call, and thus it cannot be parameterized
    Expression log("Target '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR) is a void method call, and thus it cannot be parameterized
    32
    log("Target '" + file + "' failed with message '" + thrownException.getMessage() + "'.", Project.MSG_ERR);
    23
    thrownException.printStackTrace(System.err);
    33
    thrownException.printStackTrace(System.err);
    24
    if (buildException == null)
    34
    if (buildException == null)
    25
    buildException = new BuildException(thrownException);
    35
    buildException = new BuildException(thrownException);
    Precondition Violations (8)
    Row Violation
    1Expression log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression log("File '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR) is a void method call, and thus it cannot be parameterized
    4Expression log("File '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR) is a void method call, and thus it cannot be parameterized
    5Expression log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression log("Target '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression log(curtarget,"Target '" + curtarget.getName() + "' failed with message '"+ thrownException.getMessage()+ "'.",MSG_ERR) is a void method call, and thus it cannot be parameterized
    8Expression log("Target '" + file + "' failed with message '"+ thrownException.getMessage()+ "'.",Project.MSG_ERR) is a void method call, and thus it cannot be parameterized