AntTypeDefinition def = new AntTypeDefinition(); def.setName(typeName); def.setClass(typeClass); updateDataTypeDefinition(def); project.log(" +User datatype: " + typeName + " " + typeClass.getName(), Project.MSG_DEBUG);
PropertyRef r = new PropertyRef(); r.setName(name); addPropertyref(r);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/ComponentHelper.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/PropertySet.java
Method name: void addDataTypeDefinition(String, Class) Method name: void appendName(String)
Number of AST nodes: 5 Number of AST nodes: 3
1
AntTypeDefinition def = new AntTypeDefinition();
1
PropertyRef r = new PropertyRef();
2
        def.setName(typeName);
2
        r.setName(name);
3
        def.setClass(typeClass);
3
        
4
        updateDataTypeDefinition(def);
5
        project.log(" +User datatype: " + typeName + "     "
6
                + typeClass.getName(), Project.MSG_DEBUG);
4
addPropertyref(r);
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.0
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                          
    1
    PropertyRef r = new PropertyRef();
    1
    AntTypeDefinition def = new AntTypeDefinition();
                                                                                                      
    2
    def.setName(typeName);
    2
    def.setName(typeName);
    2
    r.setName(name);
    Differences
    Expression1Expression2Difference
    typeNamenameVARIABLE_NAME_MISMATCH
    defrVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.AntTypeDefinitionorg.apache.tools.ant.types.PropertySet.PropertyRefVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.AntTypeDefinition of variable def does not match with type org.apache.tools.ant.types.PropertySet.PropertyRef of variable r
    • Make classes org.apache.tools.ant.AntTypeDefinition and org.apache.tools.ant.types.PropertySet.PropertyRef extend a common superclass
    2
    r.setName(name);
    3
    def.setClass(typeClass);
                                                          
    4
    updateDataTypeDefinition(def);
    4
    updateDataTypeDefinition(def);
    Preondition Violations
    Unmatched statement updateDataTypeDefinition(def); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    5
    project.log(" +User datatype: " + typeName + "     " + typeClass.getName(), Project.MSG_DEBUG);
    5
    project.log(" +User datatype: " + typeName + " " + typeClass.getName(), Project.MSG_DEBUG);
    3
    addPropertyref(r);
    Differences
    Expression1Expression2Difference
    logaddPropertyrefMETHOD_INVOCATION_NAME_MISMATCH
    project.log(" +User datatype: " + typeName + " "+ typeClass.getName(),Project.MSG_DEBUG)addPropertyref(r)ARGUMENT_NUMBER_MISMATCH
    projectMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression project.log(" +User datatype: " + typeName + " "+ typeClass.getName(),Project.MSG_DEBUG) is a void method call, and thus it cannot be parameterized
    Expression addPropertyref(r) is a void method call, and thus it cannot be parameterized
    Expression project.log(" +User datatype: " + typeName + " "+ typeClass.getName(),Project.MSG_DEBUG) is a void method call, and thus it cannot be parameterized
    Expression addPropertyref(r) is a void method call, and thus it cannot be parameterized
    3
    addPropertyref(r);
    Precondition Violations (6)
    Row Violation
    1Type org.apache.tools.ant.AntTypeDefinition of variable def does not match with type org.apache.tools.ant.types.PropertySet.PropertyRef of variable r
    2Unmatched statement updateDataTypeDefinition(def); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression project.log(" +User datatype: " + typeName + " "+ typeClass.getName(),Project.MSG_DEBUG) is a void method call, and thus it cannot be parameterized
    4Expression addPropertyref(r) is a void method call, and thus it cannot be parameterized
    5Expression project.log(" +User datatype: " + typeName + " "+ typeClass.getName(),Project.MSG_DEBUG) is a void method call, and thus it cannot be parameterized
    6Expression addPropertyref(r) is a void method call, and thus it cannot be parameterized