while (merges.hasMoreElements()) {
String path = (String) merges.nextElement();
File f = new File(path);
if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) {
//Do the merge
mergeZipJarContents(output, f);
} else {
//Add this file to the addfiles Vector and add it
//later at the top level of the output file.
addAddFile(path);
}
}
IdentityStack id = IdentityStack.getInstance(stack);
if (id.contains(o)) {
throw circularReference();
} else {
id.push(o);
((DataType) o).dieOnCircularReference(id, project);
id.pop();
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/DataType.java
|
Method name: void link()
|
|
Method name: void dieOnCircularReference(Stack, Project)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | while (merges.hasMoreElements()) {↵ | | |
|
2 | String path = (String) merges.nextElement();↵ | | |
|
3 | File f = new File(path);↵ | | |
|
|
4 | if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) {↵ | | |
|
5 | //Do the merge↵ | | |
|
6 | mergeZipJarContents(output, f);↵ | | |
|
7 | } else {↵ | | |
|
8 | //Add this file to the addfiles Vector and add it↵ | | |
|
9 | //later at the top level of the output file.↵ | | 1 | IdentityStack id = IdentityStack.getInstance(stack);↵
|
|
| | | 2 | if (id.contains(o)) {↵
|
| | | 3 | throw circularReference();↵
|
| | | 4 | } else {↵
|
| | | 5 | id.push(o);↵
|
| | | 6 | ((DataType) o).dieOnCircularReference(id, project);↵
|
10 | addAddFile(path);↵ | | 7 | id.pop();↵
|
11 | }↵ | | 8 | }
|
12 | } | | | |
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 |