String className = (String) listeners.elementAt(i);
BuildListener listener =
(BuildListener) ClasspathUtils.newInstance(className,
Main.class.getClassLoader(), BuildListener.class);
if (project != null) {
project.setProjectReference(listener);
}
project.addBuildListener(listener);
FileResource r = (FileResource) iter.next();
File f = r.getFile();
if (f == null) {
f = new File(r.getBaseDir(), r.getName());
}
tarFile(f, tOut, f.getName(), tfs);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Main.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Tar.java
|
Method name: void addBuildListeners(Project)
|
|
Method name: void tar(ResourceCollection, TarOutputStream)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | String className = (String) listeners.elementAt(i);↵ | | 1 | FileResource r = (FileResource) iter.next();↵
|
2 | BuildListener listener =↵ | | 2 | ↵
|
3 | (BuildListener) ClasspathUtils.newInstance(className,↵ | | 3 | File f = r.getFile();↵
|
| | | 4 | if (f == null) {↵
|
4 | Main.class.getClassLoader(), BuildListener.class);↵ | | 5 | ↵
|
5 | if (project != null) {↵ | | |
|
6 | project.setProjectReference(listener);↵ | | |
|
7 | }↵ | | |
|
8 | project.addBuildListener(listener↵ | | 6 | f = new File(r.getBaseDir(), r.getName());↵
|
| | | 7 | }↵
|
9 | ); | | 8 | tarFile(f, tOut, f.getName(), tfs);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
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 |
Number of node comparisons | 1 |