if (!src.exists()) { return false; } if (!target.exists()) { return true; } if ((src.lastModified() - granularity) > target.lastModified()) { return true; } return false;
if (!src.isExists()) { return false; } if (!target.isExists()) { return true; } if ((src.getLastModified() - granularity) > target.getLastModified()) { return true; } return false;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java
Method name: boolean isOutOfDate(File, File, int) Method name: boolean isOutOfDate(Resource, Resource, long)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (!src.exists()) {
1
if (!src.isExists()) {
2
            return false;
2
            return false;
3
        }
3
        }
4
        if (!target.exists()) {
4
        if (!target.isExists()) {
5
            return true;
5
            return true;
6
        }
6
        }
7
        if ((src.lastModified() - granularity) > target.lastModified()) {
7
        if ((src.getLastModified() - granularity) > target.getLastModified()) {
8
            return true;
8
            return true;
9
        }
9
        }
10
        return false;
10
        return false;
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.5
Clones locationClones are declared in the same class
Number of node comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    1
    if (!src.exists())
    1
    if (!src.exists())
    1
    if (!src.isExists())
    Differences
    Expression1Expression2Difference
    existsisExistsMETHOD_INVOCATION_NAME_MISMATCH
    java.io.Fileorg.apache.tools.ant.types.ResourceVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.File of variable src does not match with type org.apache.tools.ant.types.Resource of variable src
    • Make classes java.io.File and org.apache.tools.ant.types.Resource extend a common superclass
    1
    if (!src.isExists())
    2
    return false;
    2
    return false;
    3
    if (!target.exists())
    3
    if (!target.exists())
    3
    if (!target.isExists())
    Differences
    Expression1Expression2Difference
    existsisExistsMETHOD_INVOCATION_NAME_MISMATCH
    java.io.Fileorg.apache.tools.ant.types.ResourceVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.File of variable target does not match with type org.apache.tools.ant.types.Resource of variable target
    • Make classes java.io.File and org.apache.tools.ant.types.Resource extend a common superclass
    3
    if (!target.isExists())
    4
    return true;
    4
    return true;
    5
    if ((src.lastModified() - granularity) > target.lastModified())
    5
    if ((src.lastModified() - granularity) > target.lastModified())
    5
    if ((src.getLastModified() - granularity) > target.getLastModified())
    Differences
    Expression1Expression2Difference
    lastModifiedgetLastModifiedMETHOD_INVOCATION_NAME_MISMATCH
    java.io.Fileorg.apache.tools.ant.types.ResourceVARIABLE_TYPE_MISMATCH
    intlongVARIABLE_TYPE_MISMATCH
    lastModifiedgetLastModifiedMETHOD_INVOCATION_NAME_MISMATCH
    java.io.Fileorg.apache.tools.ant.types.ResourceVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression src.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.io.File of variable src does not match with type org.apache.tools.ant.types.Resource of variable src
    • Make classes java.io.File and org.apache.tools.ant.types.Resource extend a common superclass
    Type int of variable granularity does not match with type long of variable granularity
    Expression target.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.io.File of variable target does not match with type org.apache.tools.ant.types.Resource of variable target
    • Make classes java.io.File and org.apache.tools.ant.types.Resource extend a common superclass
    5
    if ((src.getLastModified() - granularity) > target.getLastModified())
    6
    return true;
    6
    return true;
    7
    return false;
    7
    return false;
    Precondition Violations (7)
    Row Violation
    1Type java.io.File of variable src does not match with type org.apache.tools.ant.types.Resource of variable src
    2Type java.io.File of variable target does not match with type org.apache.tools.ant.types.Resource of variable target
    3Expression src.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.io.File of variable src does not match with type org.apache.tools.ant.types.Resource of variable src
    5Type int of variable granularity does not match with type long of variable granularity
    6Expression target.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type java.io.File of variable target does not match with type org.apache.tools.ant.types.Resource of variable target