Parameter p = new Parameter(); p.setName(name); p.setValue(value); return p;
TargetOs to = new TargetOs(); to.setValue(target); setTargetos(to);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/PathConvert.java
Method name: Parameter createParam(String, String) Method name: void setTargetos(String)
Number of AST nodes: 4 Number of AST nodes: 3
1
Parameter p = new Parameter();
1
TargetOs to = new TargetOs();
2
        p.setName(name);
2
        to.setValue(target);
3
        p.setValue(value);
3
        set
4
        return p;
4
Targetos(to);
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                
    1
    TargetOs to = new TargetOs();
    1
    Parameter p = new Parameter();
                                                                  
    2
    p.setName(name);
                                          
    3
    p.setValue(value);
    3
    p.setValue(value);
    2
    to.setValue(target);
    Differences
    Expression1Expression2Difference
    valuetargetVARIABLE_NAME_MISMATCH
    ptoVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.Parameterorg.apache.tools.ant.taskdefs.PathConvert.TargetOsVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.types.Parameter of variable p does not match with type org.apache.tools.ant.taskdefs.PathConvert.TargetOs of variable to
    • Make classes org.apache.tools.ant.types.Parameter and org.apache.tools.ant.taskdefs.PathConvert.TargetOs extend a common superclass
    2
    to.setValue(target);
                                          
    3
    setTargetos(to);
    Preondition Violations
    Unmatched statement setTargetos(to); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    setTargetos(to);
    4
    return p;
    4
    return p;
    Preondition Violations
    Unmatched return p;
                            
    Precondition Violations (3)
    Row Violation
    1Type org.apache.tools.ant.types.Parameter of variable p does not match with type org.apache.tools.ant.taskdefs.PathConvert.TargetOs of variable to
    2Unmatched statement setTargetos(to); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return p;