AntClassLoader l = null;
try {
l = getProject().createClassLoader(commandline.getClasspath());
l.loadClass("antlr.Version");
return true;
} catch (ClassNotFoundException e) {
return false;
} finally {
if (l != null) {
l.cleanup();
}
}
AntClassLoader l = null;
try {
l = getProject().createClassLoader(getClasspath());
l.loadClass("org.apache.jasper.tagplugins.jstl.If");
return true;
} catch (ClassNotFoundException e) {
return false;
} finally {
if (l != null) {
l.cleanup();
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ANTLR.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
|
Method name: boolean is272()
|
|
Method name: boolean isTomcat5x()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | AntClassLoader l = null;↵ | | 1 | AntClassLoader l = null;↵
|
2 | try {↵ | | 2 | try {↵
|
3 | l = getProject().createClassLoader(commandline.getClasspath());↵ | | 3 | l = getProject().createClassLoader(getClasspath());↵
|
4 | l.loadClass("antlr.Version");↵ | | 4 | l.loadClass("org.apache.jasper.tagplugins.jstl.If");↵
|
5 | return true;↵ | | 5 | return true;↵
|
6 | } catch (ClassNotFoundException e) {↵ | | 6 | } catch (ClassNotFoundException e) {↵
|
7 | return false;↵ | | 7 | return false;↵
|
8 | } finally {↵ | | 8 | } finally {↵
|
9 | if (l != null) {↵ | | 9 | if (l != null) {↵
|
10 | l.cleanup();↵ | | 10 | l.cleanup();↵
|
11 | }↵ | | 11 | }↵
|
12 | } | | 12 | }
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | AntClassLoader l = null; | | 1 | AntClassLoader l = null; |
2 | try | | 2 | try |
3 | l = getProject().createClassLoader(commandline.getClasspath()); | | 3 | l = getProject().createClassLoader(getClasspath()); |
4 | l.loadClass("antlr.Version"); | | 4 | l.loadClass("org.apache.jasper.tagplugins.jstl.If"); |
5 | | | 5 | |
Precondition Violations (0)
Row |
Violation |