if (!src.isExists()) { return false; } if (!target.isExists()) { return true; } if ((src.getLastModified() - granularity) > target.getLastModified()) { return true; } return false;
if (!src.exists()) { return false; } if (!target.exists()) { return true; } if ((src.lastModified() - granularity) > target.lastModified()) { 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(Resource, Resource, long) Method name: boolean isOutOfDate(File, File, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (!src.isExists()) {
1
if (!src.exists()) {
2
            return false;
2
            return false;
3
        }
3
        }
4
        if (!target.isExists()) {
4
        if (!target.exists()) {
5
            return true;
5
            return true;
6
        }
6
        }
7
        if ((src.getLastModified() - granularity) > target.getLastModified()) {
7
        if ((src.lastModified() - granularity) > target.lastModified()) {
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.8
Clones locationClones are declared in the same class
Number of node comparisons19
  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)11.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (!src.isExists())
    1
    if (!src.isExists())
    1
    if (!src.exists())
    Differences
    Expression1Expression2Difference
    isExistsexistsMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.types.Resourcejava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression src.exists() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.types.Resource of variable src does not match with type java.io.File of variable src
    • Make classes org.apache.tools.ant.types.Resource and java.io.File extend a common superclass
    1
    if (!src.exists())
    2
    return false;
    2
    return false;
    3
    if (!target.isExists())
    3
    if (!target.isExists())
    3
    if (!target.exists())
    Differences
    Expression1Expression2Difference
    isExistsexistsMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.types.Resourcejava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.exists() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.types.Resource of variable target does not match with type java.io.File of variable target
    • Make classes org.apache.tools.ant.types.Resource and java.io.File extend a common superclass
    3
    if (!target.exists())
    4
    return true;
    4
    return true;
    5
    if ((src.getLastModified() - granularity) > target.getLastModified())
    5
    if ((src.getLastModified() - granularity) > target.getLastModified())
    5
    if ((src.lastModified() - granularity) > target.lastModified())
    Differences
    Expression1Expression2Difference
    getLastModifiedlastModifiedMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.types.Resourcejava.io.FileVARIABLE_TYPE_MISMATCH
    longintVARIABLE_TYPE_MISMATCH
    getLastModifiedlastModifiedMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.types.Resourcejava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression src.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.types.Resource of variable src does not match with type java.io.File of variable src
    • Make classes org.apache.tools.ant.types.Resource and java.io.File extend a common superclass
    Type long of variable granularity does not match with type int of variable granularity
    Expression target.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.types.Resource of variable target does not match with type java.io.File of variable target
    • Make classes org.apache.tools.ant.types.Resource and java.io.File extend a common superclass
    5
    if ((src.lastModified() - granularity) > target.lastModified())
    6
    return true;
    6
    return true;
    7
    return false;
    7
    return false;
    Precondition Violations (9)
    Row Violation
    1Expression src.exists() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Type org.apache.tools.ant.types.Resource of variable src does not match with type java.io.File of variable src
    3Expression target.exists() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.apache.tools.ant.types.Resource of variable target does not match with type java.io.File of variable target
    5Expression src.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type org.apache.tools.ant.types.Resource of variable src does not match with type java.io.File of variable src
    7Type long of variable granularity does not match with type int of variable granularity
    8Expression target.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type org.apache.tools.ant.types.Resource of variable target does not match with type java.io.File of variable target