if (entry.isDirectory()) {
name = trimSeparator(name);
dirEntries.put(name, r);
if (match(name)) {
matchDirEntries.put(name, r);
}
} else {
fileEntries.put(name, r);
if (match(name)) {
matchFileEntries.put(name, r);
}
}
if (entry.isDirectory()) {
name = trimSeparator(name);
dirEntries.put(name, r);
if (match(name)) {
matchDirEntries.put(name, r);
}
} else {
fileEntries.put(name, r);
if (match(name)) {
matchFileEntries.put(name, r);
}
}
Clone fragments detected by clone detection tool
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: 8
|
|
Number of AST nodes: 8
|
|
1 | if (entry.isDirectory()) {↵ | | 1 | if (entry.isDirectory()) {↵
|
2 | name = trimSeparator(name);↵ | | 2 | name = trimSeparator(name);↵
|
3 | dirEntries.put(name, r);↵ | | 3 | dirEntries.put(name, r);↵
|
4 | if (match(name)) {↵ | | 4 | if (match(name)) {↵
|
5 | matchDirEntries.put(name, r);↵ | | 5 | matchDirEntries.put(name, r);↵
|
6 | }↵ | | 6 | }↵
|
7 | } else {↵ | | 7 | } else {↵
|
8 | fileEntries.put(name, r);↵ | | 8 | fileEntries.put(name, r);↵
|
9 | if (match(name)) {↵ | | 9 | if (match(name)) {↵
|
10 | matchFileEntries.put(name, r);↵ | | 10 | matchFileEntries.put(name, r);↵
|
11 | }↵ | | 11 | }↵
|
12 | } | | 12 | }
|
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 30 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 6.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | if (entry.isDirectory()) | | 15 | if (entry.isDirectory()) |
10 | name = trimSeparator(name); | | 16 | name = trimSeparator(name); |
11 | | | 17 | |
12 | | | 18 | |
13 | matchDirEntries.put(name, r); | | 19 | matchDirEntries.put(name, r); |
| | | | |
14 | fileEntries.put(name, r); | | 20 | fileEntries.put(name, r); |
15 | | | 21 | |
16 | matchFileEntries.put(name, r); | | 22 | matchFileEntries.put(name, r); |
Precondition Violations (1)
Row |
Violation |
1 | Type org.apache.tools.tar.TarEntry of variable entry does not match with type org.apache.tools.zip.ZipEntry of variable entry |