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);
}
}
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/optional/Rpm.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
|
Method name: void execute()
|
|
Method name: void execute()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | if (Execute.isFailure(returncode)) {↵ | | |
|
2 | String msg = "'" + toExecute.getExecutable()↵ | | |
|
3 | + "' failed with exit code " + returncode;↵ | | 1 | String errorMsg = "File " + file + " cannot be read";↵
|
4 | if (failOnError) {↵ | | 2 | if (failOnError) {↵
|
5 | throw new BuildException(msg);↵ | | 3 | throw new BuildException(errorMsg);↵
|
6 | } else {↵ | | 4 | } else {↵
|
7 | log(msg, Project.MSG_ERR);↵ | | 5 | log(errorMsg, Project.MSG_ERR);↵
|
8 | }↵ | | 6 | }
|
9 | } | | | |
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 10.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 8 | String errorMsg = "File " + file + " cannot be read"; |
41 | String msg = "'" + toExecute.getExecutable() + "' failed with exit code " + returncode; | | | |
42 | if (failOnError) | | 9 | if (failOnError) |
43 | throw new BuildException(msg); | | 10 | throw new BuildException(errorMsg); |
| | | | |
44 | log(msg, Project.MSG_ERR); | | 11 | log(errorMsg, Project.MSG_ERR); |
Precondition Violations (0)
Row |
Violation |