File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/TarScanner.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/ZipScanner.java | |||
Method name: void fillMapsFromArchive(Resource, String, Map, Map, Map, Map)
|
Method name: void fillMapsFromArchive(Resource, String, Map, Map, Map, Map)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | while ((entry = ti.getNextEntry()) != null) {↵ | 1 | entry = (ZipEntry) e.nextElement();↵ | |
2 | Resource r = new TarResource(src, entry);↵ | 2 | Resource r = new ZipResource(srcFile, encoding, entry);↵ | |
3 | String name = entry.getName();↵ | 3 | String name = entry.getName();↵ | |
4 | if (entry.isDirectory()) {↵ | 4 | if (entry.isDirectory()) {↵ | |
5 | name = trimSeparator(name);↵ | 5 | name = trimSeparator(name);↵ | |
6 | dirEntries.put(name, r);↵ | 6 | dirEntries.put(name, r);↵ | |
7 | if (match(name)) {↵ | 7 | if (match(name)) {↵ | |
8 | matchDirEntries.put(name, r);↵ | 8 | matchDirEntries.put(name, r);↵ | |
9 | }↵ | 9 | }↵ | |
10 | } else {↵ | 10 | } else {↵ | |
11 | fileEntries.put(name, r);↵ | 11 | fileEntries.put(name, r);↵ | |
12 | if (match(name)) {↵ | 12 | if (match(name)) {↵ | |
13 | matchFileEntries.put(name, r);↵ | 13 | matchFileEntries.put(name, r);↵ | |
14 | }↵ | 14 | }↵ | |
15 | }↵ | 15 |
| |
16 | } | |||
See real code fragment | See real code fragment |
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 | 36 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 7.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 12 | entry = (ZipEntry)e.nextElement(); | ||||||||||||||
7 | Resource r = new TarResource(src, entry); |
| 13 | Resource r = new ZipResource(srcFile, encoding, entry); | |||||||||||||
8 | String name = entry.getName(); |
| 14 | String name = entry.getName(); | |||||||||||||
9 | if (entry.isDirectory()) |
| 15 | if (entry.isDirectory()) | |||||||||||||
10 | name = trimSeparator(name); | 16 | name = trimSeparator(name); | ||||||||||||||
11 | dirEntries.put(name, r); | 17 | dirEntries.put(name, r); | ||||||||||||||
12 | if (match(name)) | 18 | if (match(name)) | ||||||||||||||
13 | matchDirEntries.put(name, r); | 19 | matchDirEntries.put(name, r); | ||||||||||||||
else | else | ||||||||||||||||
14 | fileEntries.put(name, r); | 20 | fileEntries.put(name, r); | ||||||||||||||
15 | if (match(name)) | 21 | if (match(name)) | ||||||||||||||
16 | matchFileEntries.put(name, r); | 22 | matchFileEntries.put(name, r); |
Row | Violation |
---|---|
1 | Unmatched statement entry=(ZipEntry)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type org.apache.tools.tar.TarEntry of variable entry does not match with type org.apache.tools.zip.ZipEntry of variable entry |
3 | Type org.apache.tools.tar.TarEntry of variable entry does not match with type org.apache.tools.zip.ZipEntry of variable entry |