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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
40 | if (failOnError) | | 12 | if (failOnError) |
| | | 13 | throw new BuildException(getTaskType() + " returned: " + returnCode, getLocation()); |
41 | throw new BuildException("Exec returned: " + err, getLocation()); | | | |
| | | | |
42 | log("Result: " + err, Project.MSG_ERR); | | 14 | log("Result: " + returnCode, Project.MSG_ERR); |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched throw new BuildException(getTaskType() + " returned: " + returnCode,getLocation()); |
2 | Unmatched throw new BuildException("Exec returned: " + err,getLocation()); |