if (!zipFile.exists()) {
return new ArchiveState(true, initialResources);
}
if (needsUpdate && !doUpdate) {
// we are recreating the archive, need all resources
return new ArchiveState(true, initialResources);
}
Resource[][] newerResources = new Resource[filesets.length][];
if (!zipFile.exists()) {
return new ArchiveState(true, initialResources);
}
if (needsUpdate && !doUpdate) {
// we are recreating the archive, need all resources
return new ArchiveState(true, initialResources);
}
Resource[][] newerResources = new Resource[rcs.length][];
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Zip.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Zip.java
|
Method name: ArchiveState getResourcesToAdd(FileSet[], File, boolean)
|
|
Method name: ArchiveState getNonFileSetResourcesToAdd(ResourceCollection[], File, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (!zipFile.exists()) {↵ | | 1 | if (!zipFile.exists()) {↵
|
2 | return new ArchiveState(true, initialResources);↵ | | 2 | return new ArchiveState(true, initialResources);↵
|
3 | }↵ | | 3 | }↵
|
|
4 | if (needsUpdate && !doUpdate) {↵ | | 4 | if (needsUpdate && !doUpdate) {↵
|
5 | // we are recreating the archive, need all resources↵ | | 5 | // we are recreating the archive, need all resources↵
|
6 | return new ArchiveState(true, initialResources);↵ | | 6 | return new ArchiveState(true, initialResources);↵
|
7 | }↵ | | 7 | }↵
|
|
8 | Resource[][] newerResources = new Resource[filesets.length][]; | | 8 | Resource[][] newerResources = new Resource[rcs.length][];
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
-
{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) | 0.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
14 | if (!zipFile.exists()) | | 4 | if (!zipFile.exists()) |
15 | return new ArchiveState(true, initialResources); | | 5 | return new ArchiveState(true, initialResources); |
16 | if (needsUpdate && !doUpdate) | | 6 | if (needsUpdate && !doUpdate) |
17 | return new ArchiveState(true, initialResources); | | 7 | return new ArchiveState(true, initialResources); |
18 | Resource[][] newerResources = new Resource[filesets.length]; | | 8 | Resource[][] newerResources = new Resource[rcs.length]; |
Precondition Violations (1)
Row |
Violation |
1 | Type org.apache.tools.ant.types.FileSet[] of variable filesets does not match with type org.apache.tools.ant.types.ResourceCollection[] of variable rcs |