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());
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());
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(targets, datesel);
1
logFuture(sources, datesel);
2
        int neTargets = new NonExistent(targets).size();
2
        int neSources = new NonExistent(sources).size();
3
        if (neTargets > 0) {
3
        if (neSources > 0) {
4
            log(neTargets + " nonexistent targets", Project.MSG_VERBOSE);
4
            log(neSources + " nonexistent sources", Project.MSG_VERBOSE);
5
            return false;
5
            return false;
6
        }
6
        }
7
        FileResource oldestTarget = (FileResource) (new Oldest(targets).iterator().next());
7
        Resource newestSource = (Resource) (new Newest(sources).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)4.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    logFuture(targets, datesel);
    4
    logFuture(targets, datesel);
    11
    logFuture(sources, datesel);
    Differences
    Expression1Expression2Difference
    targetssourcesVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.Pathorg.apache.tools.ant.types.resources.UnionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression targets cannot be unified with expression sources , because common superclass type org.apache.tools.ant.types.DataType cannot be passed as an argument to private void logFuture(org.apache.tools.ant.types.ResourceCollection, org.apache.tools.ant.types.resources.selectors.ResourceSelector)
    11
    logFuture(sources, datesel);
    5
    int neTargets = new NonExistent(targets).size();
    5
    int neTargets = new NonExistent(targets).size();
    12
    int neSources = new NonExistent(sources).size();
    Differences
    Expression1Expression2Difference
    neTargetsneSourcesVARIABLE_NAME_MISMATCH
    targetssourcesVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.Pathorg.apache.tools.ant.types.resources.UnionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression targets cannot be unified with expression sources , because common superclass type org.apache.tools.ant.types.DataType cannot be passed as an argument to private void <init>(org.apache.tools.ant.types.ResourceCollection)
    12
    int neSources = new NonExistent(sources).size();
    6
    if (neTargets > 0)
    6
    if (neTargets > 0)
    13
    if (neSources > 0)
    Differences
    Expression1Expression2Difference
    neTargetsneSourcesVARIABLE_NAME_MISMATCH
    13
    if (neSources > 0)
    7
    log(neTargets + " nonexistent targets", Project.MSG_VERBOSE);
    7
    log(neTargets + " nonexistent targets", Project.MSG_VERBOSE);
    14
    log(neSources + " nonexistent sources", Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    neTargetsneSourcesVARIABLE_NAME_MISMATCH
    " nonexistent targets"" nonexistent sources"LITERAL_VALUE_MISMATCH
    14
    log(neSources + " nonexistent sources", Project.MSG_VERBOSE);
    8
    return false;
    15
    return false;
    9
    FileResource oldestTarget = (FileResource)(new Oldest(targets).iterator().next());
    9
    FileResource oldestTarget = (FileResource)(new Oldest(targets).iterator().next());
    16
    Resource newestSource = (Resource)(new Newest(sources).iterator().next());
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.resources.FileResourceorg.apache.tools.ant.types.ResourceSUBCLASS_TYPE_MISMATCH
    oldestTargetnewestSourceVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.resources.FileResourceorg.apache.tools.ant.types.ResourceSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.types.resources.FileResourceorg.apache.tools.ant.types.ResourceSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.taskdefs.DependSet.Oldestorg.apache.tools.ant.taskdefs.DependSet.NewestSUBCLASS_TYPE_MISMATCH
    targetssourcesVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.Pathorg.apache.tools.ant.types.resources.UnionSUBCLASS_TYPE_MISMATCH
    16
    Resource newestSource = (Resource)(new Newest(sources).iterator().next());
    Precondition Violations (4)
    Row Violation
    1Expression targets cannot be unified with expression sources , because common superclass type org.apache.tools.ant.types.DataType cannot be passed as an argument to private void logFuture(org.apache.tools.ant.types.ResourceCollection, org.apache.tools.ant.types.resources.selectors.ResourceSelector)
    2Expression targets cannot be unified with expression sources , because common superclass type org.apache.tools.ant.types.DataType cannot be passed as an argument to private void <init>(org.apache.tools.ant.types.ResourceCollection)
    3Clone fragment #1 returns variable oldestTarget with type org.apache.tools.ant.types.resources.FileResource , while Clone fragment #2 returns variable newestSource with type org.apache.tools.ant.types.Resource
    4Not all possible execution flows end in a return statement