StringBuffer sb = new StringBuffer(); dump(sb); return sb.toString();
StringBuffer buf = new StringBuffer(); getDescriptor(buf); return buf.toString();
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/gnu/regexp/RE.java File path: /jEdit-4.2/src/org/objectweb/asm/Type.java
Method name: String toString() Method name: String getDescriptor()
Number of AST nodes: 3 Number of AST nodes: 3
1
StringBuffer sb = new StringBuffer();
1
StringBuffer buf = new StringBuffer();
2
     dump(sb);
2
    getDescriptor(buf);
3
     return sb.toString();
3
    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
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    StringBuffer sb = new StringBuffer();
    1
    StringBuffer sb = new StringBuffer();
    1
    StringBuffer buf = new StringBuffer();
    Differences
    Expression1Expression2Difference
    sbbufVARIABLE_NAME_MISMATCH
    1
    StringBuffer buf = new StringBuffer();
    2
    dump(sb);
    2
    dump(sb);
    2
    getDescriptor(buf);
    Differences
    Expression1Expression2Difference
    dumpgetDescriptorMETHOD_INVOCATION_NAME_MISMATCH
    sbbufVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression dump(sb) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getDescriptor(buf) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method getDescriptor
    Expression dump(sb) is a void method call, and thus it cannot be parameterized
    Expression getDescriptor(buf) is a void method call, and thus it cannot be parameterized
    2
    getDescriptor(buf);
    3
    return sb.toString();
    3
    return sb.toString();
    3
    return buf.toString();
    Differences
    Expression1Expression2Difference
    sbbufVARIABLE_NAME_MISMATCH
    3
    return buf.toString();
    Precondition Violations (4)
    Row Violation
    1Expression dump(sb) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getDescriptor(buf) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression dump(sb) is a void method call, and thus it cannot be parameterized
    4Expression getDescriptor(buf) is a void method call, and thus it cannot be parameterized