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][];
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 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];
    18
    Resource[][] newerResources = new Resource[filesets.length];
    8
    Resource[][] newerResources = new Resource[rcs.length];
    Differences
    Expression1Expression2Difference
    filesetsrcsVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.FileSet[]org.apache.tools.ant.types.ResourceCollection[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.types.FileSet[] of variable filesets does not match with type org.apache.tools.ant.types.ResourceCollection[] of variable rcs
    • Make classes org.apache.tools.ant.types.FileSet[] and org.apache.tools.ant.types.ResourceCollection[] extend a common superclass
    8
    Resource[][] newerResources = new Resource[rcs.length];
    Precondition Violations (1)
    Row Violation
    1Type org.apache.tools.ant.types.FileSet[] of variable filesets does not match with type org.apache.tools.ant.types.ResourceCollection[] of variable rcs