StringBuffer buf = new StringBuffer("{depthselector min: "); buf.append(min); buf.append(" max: "); buf.append(max); buf.append("}"); return buf.toString();
StringBuffer buf = new StringBuffer("{sizeselector value: "); buf.append(sizelimit); buf.append("compare: ").append(when.getValue()); buf.append("}"); return buf.toString();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/DepthSelector.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SizeSelector.java
Method name: String toString() Method name: String toString()
Number of AST nodes: 6 Number of AST nodes: 5
1
StringBuffer buf = new StringBuffer("{depthselector min: ");
1
StringBuffer buf = new StringBuffer("{sizeselector value: ");
2
        buf.append(min);
2
        buf.append(sizelimit);
3
        buf.append(" max: ");
3
        buf.append("
4
        buf.append(max);
4
compare: ").append(when.getValue());
5
        buf.append("}");
5
        buf.append("}");
6
        return buf.toString();
6
        return buf.toString();
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 having the same super class
Number of node comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    StringBuffer buf = new StringBuffer("{depthselector min: ");
    1
    StringBuffer buf = new StringBuffer("{depthselector min: ");
    1
    StringBuffer buf = new StringBuffer("{sizeselector value: ");
    Differences
    Expression1Expression2Difference
    "{depthselector min: ""{sizeselector value: "LITERAL_VALUE_MISMATCH
    1
    StringBuffer buf = new StringBuffer("{sizeselector value: ");
    2
    buf.append(min);
    2
    buf.append(min);
    2
    buf.append(sizelimit);
    Differences
    Expression1Expression2Difference
    minsizelimitVARIABLE_NAME_MISMATCH
    intlongVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable min does not match with type long of variable sizelimit
    2
    buf.append(sizelimit);
    3
    buf.append(" max: ");
    3
    buf.append(" max: ");
    3
    buf.append("compare: ").append(when.getValue());
    Differences
    Expression1Expression2Difference
    " max: "when.getValue()TYPE_COMPATIBLE_REPLACEMENT
    bufbuf.append("compare: ")TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression buf cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression buf.append("compare: ") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    buf.append("compare: ").append(when.getValue());
    4
    buf.append(max);
    4
    buf.append(max);
    Preondition Violations
    Unmatched statement buf.append(max); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                          
    5
    buf.append("}");
    4
    buf.append("}");
    6
    return buf.toString();
    5
    return buf.toString();
    Precondition Violations (5)
    Row Violation
    1Type int of variable min does not match with type long of variable sizelimit
    2Expression buf cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression buf.append("compare: ") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched statement buf.append(max); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Clone fragment #1 returns variables buf , while Clone fragment #2 returns variables