if (from.getValue() != null) { to.setValue(from.getValue()); } if (from.getFile() != null) { to.setFile(from.getFile()); }
if (from.getEnvironment() != null) { to.setEnvironment(from.getEnvironment()); } if (from.getClasspath() != null) { to.setClasspath(from.getClasspath()); }
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: 4 Number of AST nodes: 4
1
if (from.getValue() != null) {
1
if (from.getEnvironment() != null) {
2
            to.setValue(from.getValue());
2
            to.setEnvironment(from.getEnvironment());
3
        }
3
        }
4
        if (from.getFile() != null) {
4
        if (from.getClasspath() != null) {
5
            to.setFile(from.getFile());
5
            to.setClasspath(from.getClasspath());
6
        }
6
        }
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.6
Clones locationClones are in the same method
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)18.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (from.getValue() != null)
    2
    if (from.getValue() != null)
    14
    if (from.getClasspath() != null)
    Differences
    Expression1Expression2Difference
    getValuegetClasspathMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringorg.apache.tools.ant.types.PathVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable from.getValue() does not match with type org.apache.tools.ant.types.Path of variable from.getClasspath()
    • Make classes java.lang.String and org.apache.tools.ant.types.Path extend a common superclass
    14
    if (from.getClasspath() != null)
    3
    to.setValue(from.getValue());
    3
    to.setValue(from.getValue());
    15
    to.setClasspath(from.getClasspath());
    Differences
    Expression1Expression2Difference
    getValuegetClasspathMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringorg.apache.tools.ant.types.PathVARIABLE_TYPE_MISMATCH
    setValuesetClasspathMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression from.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression from.getClasspath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable from.getValue() does not match with type org.apache.tools.ant.types.Path of variable from.getClasspath()
    • Make classes java.lang.String and org.apache.tools.ant.types.Path extend a common superclass
    Expression to.setValue(from.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setClasspath(from.getClasspath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setValue(from.getValue()) is a void method call, and thus it cannot be parameterized
    Expression to.setClasspath(from.getClasspath()) is a void method call, and thus it cannot be parameterized
    15
    to.setClasspath(from.getClasspath());
    4
    if (from.getFile() != null)
    4
    if (from.getFile() != null)
    12
    if (from.getEnvironment() != null)
    Differences
    Expression1Expression2Difference
    getFilegetEnvironmentMETHOD_INVOCATION_NAME_MISMATCH
    java.io.Filejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.File of variable from.getFile() does not match with type java.lang.String of variable from.getEnvironment()
    • Make classes java.io.File and java.lang.String extend a common superclass
    12
    if (from.getEnvironment() != null)
    5
    to.setFile(from.getFile());
    5
    to.setFile(from.getFile());
    13
    to.setEnvironment(from.getEnvironment());
    Differences
    Expression1Expression2Difference
    getFilegetEnvironmentMETHOD_INVOCATION_NAME_MISMATCH
    java.io.Filejava.lang.StringVARIABLE_TYPE_MISMATCH
    setFilesetEnvironmentMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression from.getFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression from.getEnvironment() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.io.File of variable from.getFile() does not match with type java.lang.String of variable from.getEnvironment()
    • Make classes java.io.File and java.lang.String extend a common superclass
    Expression to.setFile(from.getFile()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setEnvironment(from.getEnvironment()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression to.setFile(from.getFile()) is a void method call, and thus it cannot be parameterized
    Expression to.setEnvironment(from.getEnvironment()) is a void method call, and thus it cannot be parameterized
    13
    to.setEnvironment(from.getEnvironment());
    Precondition Violations (16)
    Row Violation
    1Type java.lang.String of variable from.getValue() does not match with type org.apache.tools.ant.types.Path of variable from.getClasspath()
    2Expression from.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression from.getClasspath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.lang.String of variable from.getValue() does not match with type org.apache.tools.ant.types.Path of variable from.getClasspath()
    5Expression to.setValue(from.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression to.setClasspath(from.getClasspath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression to.setValue(from.getValue()) is a void method call, and thus it cannot be parameterized
    8Expression to.setClasspath(from.getClasspath()) is a void method call, and thus it cannot be parameterized
    9Type java.io.File of variable from.getFile() does not match with type java.lang.String of variable from.getEnvironment()
    10Expression from.getFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression from.getEnvironment() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type java.io.File of variable from.getFile() does not match with type java.lang.String of variable from.getEnvironment()
    13Expression to.setFile(from.getFile()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression to.setEnvironment(from.getEnvironment()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression to.setFile(from.getFile()) is a void method call, and thus it cannot be parameterized
    16Expression to.setEnvironment(from.getEnvironment()) is a void method call, and thus it cannot be parameterized