compiler.setJspc(this);
// finally, lets execute the compiler!!
if (!compiler.execute()) {
if (failOnError) {
throw new BuildException(FAIL_MSG, getLocation());
} else {
log(FAIL_MSG, Project.MSG_ERR);
}
}
adapter.setJavac(this);
// finally, lets execute the compiler!!
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/jsp/JspC.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Javac.java
|
Method name: void doCompilation(JspCompilerAdapter)
|
|
Method name: void compile()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | compiler.setJspc(this);↵ | | 1 | adapter.setJavac(this);↵
|
|
2 | // finally, lets execute the compiler!!↵ | | 2 | // finally, lets execute the compiler!!↵
|
3 | if (!compiler.execute()) {↵ | | 3 | if (!adapter.execute()) {↵
|
4 | if (failOnError) {↵ | | 4 | if (failOnError) {↵
|
5 | throw new BuildException(FAIL_MSG, getLocation());↵ | | 5 | throw new BuildException(FAIL_MSG, getLocation());↵
|
6 | } else {↵ | | 6 | } else {↵
|
7 | log(FAIL_MSG, Project.MSG_ERR);↵ | | 7 | log(FAIL_MSG, Project.MSG_ERR);↵
|
8 | }↵ | | 8 | ↵
|
| | | 9 | }↵
|
9 | } | | 10 | }
|
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 2.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | compiler.setJspc(this); | | | |
| | | 9 | adapter.setJavac(this); |
2 | if (!compiler.execute()) | | 10 | if (!adapter.execute()) |
3 | | | 11 | |
4 | throw new BuildException(FAIL_MSG, getLocation()); | | 12 | throw new BuildException(FAIL_MSG, getLocation()); |
| | | | |
5 | log(FAIL_MSG, Project.MSG_ERR); | | 13 | log(FAIL_MSG, Project.MSG_ERR); |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement compiler.setJspc(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement adapter.setJavac(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Type org.apache.tools.ant.taskdefs.optional.jsp.compilers.JspCompilerAdapter of variable compiler does not match with type org.apache.tools.ant.taskdefs.compilers.CompilerAdapter of variable adapter |