ZipFile zipFile = (ZipFile) zipFiles.get(file);
if (zipFile == null) {
zipFile = new ZipFile(file);
zipFiles.put(file, zipFile);
}
ZipEntry entry = zipFile.getEntry(resourceName);
ZipFile zipFile = (ZipFile) zipFiles.get(file);
if (zipFile == null) {
zipFile = new ZipFile(file);
zipFiles.put(file, zipFile);
}
ZipEntry entry = zipFile.getEntry(resourceName);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/AntClassLoader.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/AntClassLoader.java
|
Method name: InputStream getResourceStream(File, String)
|
|
Method name: URL getResourceURL(File, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | ZipFile zipFile = (ZipFile) zipFiles.get(file);↵ | | 1 | ZipFile zipFile = (ZipFile) zipFiles.get(file);↵
|
2 | if (zipFile == null) {↵ | | 2 | if (zipFile == null) {↵
|
3 | zipFile = new ZipFile(file);↵ | | 3 | zipFile = new ZipFile(file);↵
|
4 | zipFiles.put(file, zipFile);↵ | | 4 | zipFiles.put(file, zipFile);↵
|
5 | }↵ | | 5 | }↵
|
|
6 | ZipEntry entry = zipFile.getEntry(resourceName); | | 6 | ZipEntry entry = zipFile.getEntry(resourceName);
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 19 |
-
{Non-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) | 1.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | ZipFile zipFile = (ZipFile)zipFiles.get(file); | | 9 | ZipFile zipFile = (ZipFile)zipFiles.get(file); |
9 | if (zipFile == null) | | 10 | if (zipFile == null) |
10 | zipFile = new ZipFile(file); | | 11 | zipFile = new ZipFile(file); |
11 | zipFiles.put(file, zipFile); | | 12 | zipFiles.put(file, zipFile); |
12 | ZipEntry entry = zipFile.getEntry(resourceName); | | 13 | ZipEntry entry = zipFile.getEntry(resourceName); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables entry, zipFile , while Clone fragment #2 returns variables entry |