thread = null;
if (getFailonerror()) {
throw new BuildException(TIMEOUT_MESSAGE);
} else {
log(TIMEOUT_MESSAGE, Project.MSG_ERR);
}
if (ec != 0) {
String msg = "Remote command failed with exit status " + ec;
if (getFailonerror()) {
throw new BuildException(msg);
} else {
log(msg, Project.MSG_ERR);
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
|
Method name: void execute()
|
|
Method name: void execute()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 5
|
|
1 | thread = null;↵ | | |
|
| | | 1 | if (ec != 0) {↵
|
| | | 2 | String msg = "Remote command failed with exit status " + ec;↵
|
2 | if (getFailonerror()) {↵ | | 3 | if (getFailonerror()) {↵
|
3 | throw new BuildException(TIMEOUT_MESSAGE);↵ | | 4 | throw new BuildException(↵
|
| | | 5 | msg);↵
|
4 | } else {↵ | | 6 | } else {↵
|
5 | log(TIMEOUT_MESSAGE, Project.MSG_ERR);↵ | | 7 | log(msg, 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 the same method |
Number of node comparisons | 11 |
-
{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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
24 | thread = null; | | | |
| | | 34 | String msg = "Remote command failed with exit status " + ec; |
25 | if (getFailonerror()) | | 35 | if (getFailonerror()) |
26 | throw new BuildException(TIMEOUT_MESSAGE); | | 36 | throw new BuildException(msg); |
| | | | |
27 | log(TIMEOUT_MESSAGE, Project.MSG_ERR); | | 37 | log(msg, Project.MSG_ERR); |
Precondition Violations (0)
Row |
Violation |