if (inFile.exists() && inFile.isDirectory()) {
String message = "srcfile is a directory!";
if (failonerror) {
throw new BuildException(message, getLocation());
} else {
log(message, Project.MSG_ERR);
}
return;
}
if (!adapter.execute()) {
if (failOnError) {
throw new BuildException(FAIL_MSG, getLocation());
} else {
log(FAIL_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/EchoProperties.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Javac.java
|
Method name: void execute()
|
|
Method name: void compile()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 4
|
|
1 | if (inFile.exists() && inFile.isDirectory()) {↵ | | 1 | if (↵
|
2 | String message = "srcfile is a directory!";↵ | | 2 | !adapter.execute()) {↵
|
3 | if (failonerror) {↵ | | 3 | if (failOnError) {↵
|
4 | throw new BuildException(message, getLocation());↵ | | 4 | throw new BuildException(FAIL_MSG, getLocation());↵
|
5 | } else {↵ | | 5 | } else {↵
|
6 | log(message, Project.MSG_ERR);↵ | | 6 | log(FAIL_MSG, Project.MSG_ERR);↵
|
7 | }↵ | | 7 | }↵
|
8 | return;↵ | | |
|
9 | } | | 8 | }
|
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 | 0 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | String message = "srcfile is a directory!"; | | | |
9 | if (failonerror) | | 11 | if (failOnError) |
10 | throw new BuildException(message, getLocation()); | | 12 | throw new BuildException(FAIL_MSG, getLocation()); |
| | | | |
11 | log(message, Project.MSG_ERR); | | 13 | log(FAIL_MSG, Project.MSG_ERR); |
Precondition Violations (0)
Row |
Violation |