if (from.getRefid() != null) { to.setRefid(from.getRefid()); } if (from.getEnvironment() != null) { to.setEnvironment(from.getEnvironment()); } if (from.getClasspath() != null) { to.setClasspath(from.getClasspath()); }
if (from.getValue() != null) { to.setValue(from.getValue()); } if (from.getFile() != null) { to.setFile(from.getFile()); } if (from.getResource() != null) { to.setResource(from.getResource()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/SubAnt.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/SubAnt.java
Method name: void copyProperty(Property, Property) Method name: void copyProperty(Property, Property)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (from.getRefid() != null) {
1
if (from.getValue() != null) {
2
            to.setRefid(from.getRefid());
2
            to.setValue(from.getValue());
3
        }
3
        }
4
        if (from.getEnvironment() != null) {
4
        if (from.getFile() != null) {
5
            to.setEnvironment(from.getEnvironment());
5
            to.setFile(from.getFile());
6
        }
6
        }
7
        if (from.getClasspath() != null) {
7
        if (from.getResource() != null) {
8
            to.setClasspath(from.getClasspath());
8
            to.setResource(from.getResource());
9
        }
9
        }
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)1.0
Clones locationClones are in the same method
Number of node comparisons27
  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)19.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    if (from.getRefid() != null)
    10
    if (from.getRefid() != null)
    2
    if (from.getValue() != null)
    Differences
    Expression1Expression2Difference
    getRefidgetValueMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.types.Referencejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.types.Reference of variable from.getRefid() does not match with type java.lang.String of variable from.getValue()
    • Make classes org.apache.tools.ant.types.Reference and java.lang.String extend a common superclass
    2
    if (from.getValue() != null)
    11
    to.setRefid(from.getRefid());
    11
    to.setRefid(from.getRefid());
    3
    to.setValue(from.getValue());
    Differences
    Expression1Expression2Difference
    getRefidgetValueMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.types.Referencejava.lang.StringVARIABLE_TYPE_MISMATCH
    setRefidsetValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression from.getRefid() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression from.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.types.Reference of variable from.getRefid() does not match with type java.lang.String of variable from.getValue()
    • Make classes org.apache.tools.ant.types.Reference and java.lang.String extend a common superclass
    Expression to.setRefid(from.getRefid()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setValue(from.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setRefid(from.getRefid()) is a void method call, and thus it cannot be parameterized
    Expression to.setValue(from.getValue()) is a void method call, and thus it cannot be parameterized
    3
    to.setValue(from.getValue());
    12
    if (from.getEnvironment() != null)
    12
    if (from.getEnvironment() != null)
    4
    if (from.getFile() != null)
    Differences
    Expression1Expression2Difference
    getEnvironmentgetFileMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable from.getEnvironment() does not match with type java.io.File of variable from.getFile()
    • Make classes java.lang.String and java.io.File extend a common superclass
    4
    if (from.getFile() != null)
    13
    to.setEnvironment(from.getEnvironment());
    13
    to.setEnvironment(from.getEnvironment());
    5
    to.setFile(from.getFile());
    Differences
    Expression1Expression2Difference
    getEnvironmentgetFileMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    setEnvironmentsetFileMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression from.getEnvironment() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression from.getFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable from.getEnvironment() does not match with type java.io.File of variable from.getFile()
    • Make classes java.lang.String and java.io.File extend a common superclass
    Expression to.setEnvironment(from.getEnvironment()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setFile(from.getFile()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setEnvironment(from.getEnvironment()) is a void method call, and thus it cannot be parameterized
    Expression to.setFile(from.getFile()) is a void method call, and thus it cannot be parameterized
    5
    to.setFile(from.getFile());
    14
    if (from.getClasspath() != null)
    14
    if (from.getClasspath() != null)
    6
    if (from.getResource() != null)
    Differences
    Expression1Expression2Difference
    getClasspathgetResourceMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.types.Pathjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.types.Path of variable from.getClasspath() does not match with type java.lang.String of variable from.getResource()
    • Make classes org.apache.tools.ant.types.Path and java.lang.String extend a common superclass
    6
    if (from.getResource() != null)
    15
    to.setClasspath(from.getClasspath());
    15
    to.setClasspath(from.getClasspath());
    7
    to.setResource(from.getResource());
    Differences
    Expression1Expression2Difference
    getClasspathgetResourceMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.types.Pathjava.lang.StringVARIABLE_TYPE_MISMATCH
    setClasspathsetResourceMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression from.getClasspath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression from.getResource() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.types.Path of variable from.getClasspath() does not match with type java.lang.String of variable from.getResource()
    • Make classes org.apache.tools.ant.types.Path and java.lang.String extend a common superclass
    Expression to.setClasspath(from.getClasspath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setResource(from.getResource()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setClasspath(from.getClasspath()) is a void method call, and thus it cannot be parameterized
    Expression to.setResource(from.getResource()) is a void method call, and thus it cannot be parameterized
    7
    to.setResource(from.getResource());
    Precondition Violations (24)
    Row Violation
    1Type org.apache.tools.ant.types.Reference of variable from.getRefid() does not match with type java.lang.String of variable from.getValue()
    2Expression from.getRefid() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression from.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.apache.tools.ant.types.Reference of variable from.getRefid() does not match with type java.lang.String of variable from.getValue()
    5Expression to.setRefid(from.getRefid()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression to.setValue(from.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression to.setRefid(from.getRefid()) is a void method call, and thus it cannot be parameterized
    8Expression to.setValue(from.getValue()) is a void method call, and thus it cannot be parameterized
    9Type java.lang.String of variable from.getEnvironment() does not match with type java.io.File of variable from.getFile()
    10Expression from.getEnvironment() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression from.getFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type java.lang.String of variable from.getEnvironment() does not match with type java.io.File of variable from.getFile()
    13Expression to.setEnvironment(from.getEnvironment()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression to.setFile(from.getFile()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression to.setEnvironment(from.getEnvironment()) is a void method call, and thus it cannot be parameterized
    16Expression to.setFile(from.getFile()) is a void method call, and thus it cannot be parameterized
    17Type org.apache.tools.ant.types.Path of variable from.getClasspath() does not match with type java.lang.String of variable from.getResource()
    18Expression from.getClasspath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression from.getResource() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type org.apache.tools.ant.types.Path of variable from.getClasspath() does not match with type java.lang.String of variable from.getResource()
    21Expression to.setClasspath(from.getClasspath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression to.setResource(from.getResource()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression to.setClasspath(from.getClasspath()) is a void method call, and thus it cannot be parameterized
    24Expression to.setResource(from.getResource()) is a void method call, and thus it cannot be parameterized