logFuture(sources, datesel); int neSources = new NonExistent(sources).size(); if (neSources > 0) { log(neSources + " nonexistent sources", Project.MSG_VERBOSE); return false; } Resource newestSource = (Resource) (new Newest(sources).iterator().next());
logFuture(targets, datesel); int neTargets = new NonExistent(targets).size(); if (neTargets > 0) { log(neTargets + " nonexistent targets", Project.MSG_VERBOSE); return false; } FileResource oldestTarget = (FileResource) (new Oldest(targets).iterator().next());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/DependSet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/DependSet.java
Method name: boolean uptodate(ResourceCollection, ResourceCollection) Method name: boolean uptodate(ResourceCollection, ResourceCollection)
Number of AST nodes: 6 Number of AST nodes: 6
1
logFuture(sources, datesel);
1
logFuture(targets, datesel);
2
        int neSources = new NonExistent(sources).size();
2
        int neTargets = new NonExistent(targets).size();
3
        if (neSources > 0) {
3
        if (neTargets > 0) {
4
            log(neSources + " nonexistent sources", Project.MSG_VERBOSE);
4
            log(neTargets + " nonexistent targets", Project.MSG_VERBOSE);
5
            return false;
5
            return false;
6
        }
6
        }
7
        Resource newestSource = (Resource) (new Newest(sources).iterator().next());
7
        FileResource oldestTarget = (FileResource) (new Oldest(targets).iterator().next());
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.1
Clones locationClones are in the same method
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    logFuture(sources, datesel);
    11
    logFuture(sources, datesel);
    4
    logFuture(targets, datesel);
    Differences
    Expression1Expression2Difference
    sourcestargetsVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.resources.Unionorg.apache.tools.ant.types.PathSUBCLASS_TYPE_MISMATCH
    4
    logFuture(targets, datesel);
    12
    int neSources = new NonExistent(sources).size();
    12
    int neSources = new NonExistent(sources).size();
    5
    int neTargets = new NonExistent(targets).size();
    Differences
    Expression1Expression2Difference
    neSourcesneTargetsVARIABLE_NAME_MISMATCH
    sourcestargetsVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.resources.Unionorg.apache.tools.ant.types.PathSUBCLASS_TYPE_MISMATCH
    5
    int neTargets = new NonExistent(targets).size();
    13
    if (neSources > 0)
    13
    if (neSources > 0)
    6
    if (neTargets > 0)
    Differences
    Expression1Expression2Difference
    neSourcesneTargetsVARIABLE_NAME_MISMATCH
    6
    if (neTargets > 0)
    14
    log(neSources + " nonexistent sources", Project.MSG_VERBOSE);
    14
    log(neSources + " nonexistent sources", Project.MSG_VERBOSE);
    7
    log(neTargets + " nonexistent targets", Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    neSourcesneTargetsVARIABLE_NAME_MISMATCH
    " nonexistent sources"" nonexistent targets"LITERAL_VALUE_MISMATCH
    7
    log(neTargets + " nonexistent targets", Project.MSG_VERBOSE);
    15
    return false;
    15
    return false;
    8
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    8
    return false;
    16
    Resource newestSource = (Resource)(new Newest(sources).iterator().next());
    16
    Resource newestSource = (Resource)(new Newest(sources).iterator().next());
    9
    FileResource oldestTarget = (FileResource)(new Oldest(targets).iterator().next());
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.Resourceorg.apache.tools.ant.types.resources.FileResourceSUBCLASS_TYPE_MISMATCH
    newestSourceoldestTargetVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.Resourceorg.apache.tools.ant.types.resources.FileResourceSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.types.Resourceorg.apache.tools.ant.types.resources.FileResourceSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.taskdefs.DependSet.Newestorg.apache.tools.ant.taskdefs.DependSet.OldestSUBCLASS_TYPE_MISMATCH
    sourcestargetsVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.resources.Unionorg.apache.tools.ant.types.PathSUBCLASS_TYPE_MISMATCH
    9
    FileResource oldestTarget = (FileResource)(new Oldest(targets).iterator().next());
    Precondition Violations (3)
    Row Violation
    1Clone fragment #1 returns variable newestSource with type org.apache.tools.ant.types.Resource , while Clone fragment #2 returns variable oldestTarget with type org.apache.tools.ant.types.resources.FileResource
    2Conditional return false;
    3Conditional return false;