if (exceptions != null && exceptions.length > 0) { exceptionCount = exceptions.length; this.exceptions = new int[exceptionCount]; for (int i = 0; i < exceptionCount; ++i) { this.exceptions[i] = cw.newClass(exceptions[i]).index; } }
if (interfaces != null && interfaces.length > 0) { interfaceCount = interfaces.length; this.interfaces = new int[interfaceCount]; for (int i = 0; i < interfaceCount; ++i) { this.interfaces[i] = newClass(interfaces[i]).index; } }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/objectweb/asm/CodeWriter.java File path: /jEdit-4.2/src/org/objectweb/asm/ClassWriter.java
Method name: void init(int, String, String, String[]) Method name: void visit(int, String, String, String[], String)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (exceptions != null && exceptions.length > 0) {
1
if (interfaces != null && interfaces.length > 0) {
2
      exceptionCount = exceptions.length;
2
      interfaceCount = interfaces.length;
3
      this.exceptions = new int[exceptionCount];
3
      this.interfaces = new int[interfaceCount];
4
      for (int i = 0; i < exceptionCount; ++i) {
4
      for (int i = 0; i < interfaceCount; ++i) {
5
        this.exceptions[i] = cw.newClass(exceptions[i]).index;
5
        this.interfaces[i] = newClass(interfaces[i]).index;
6
      }
6
      }
7
    }
7
    }
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.5
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (exceptions != null && exceptions.length > 0)
    4
    if (exceptions != null && exceptions.length > 0)
    4
    if (interfaces != null && interfaces.length > 0)
    Differences
    Expression1Expression2Difference
    exceptionsinterfacesVARIABLE_NAME_MISMATCH
    exceptionsinterfacesVARIABLE_NAME_MISMATCH
    4
    if (interfaces != null && interfaces.length > 0)
    5
    exceptionCount = exceptions.length;
    5
    exceptionCount = exceptions.length;
    5
    interfaceCount = interfaces.length;
    Differences
    Expression1Expression2Difference
    exceptionCountinterfaceCountVARIABLE_NAME_MISMATCH
    exceptionsinterfacesVARIABLE_NAME_MISMATCH
    5
    interfaceCount = interfaces.length;
    6
    this.exceptions = new int[exceptionCount];
    6
    this.exceptions = new int[exceptionCount];
    6
    this.interfaces = new int[interfaceCount];
    Differences
    Expression1Expression2Difference
    exceptionsinterfacesVARIABLE_NAME_MISMATCH
    exceptionCountinterfaceCountVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.exceptions is a field being modified, and thus it cannot be parameterized
    Expression this.interfaces is a field being modified, and thus it cannot be parameterized
    6
    this.interfaces = new int[interfaceCount];
    7
    for (int i = 0; i < exceptionCount; ++i)
    7
    for (int i = 0; i < exceptionCount; ++i)
    7
    for (int i = 0; i < interfaceCount; ++i)
    Differences
    Expression1Expression2Difference
    exceptionCountinterfaceCountVARIABLE_NAME_MISMATCH
    7
    for (int i = 0; i < interfaceCount; ++i)
    8
    this.exceptions[i] = cw.newClass(exceptions[i]).index;
    8
    this.exceptions[i] = cw.newClass(exceptions[i]).index;
    8
    this.interfaces[i] = newClass(interfaces[i]).index;
    Differences
    Expression1Expression2Difference
    exceptionsinterfacesVARIABLE_NAME_MISMATCH
    exceptionsinterfacesVARIABLE_NAME_MISMATCH
    cwMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression this.exceptions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.interfaces cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cw.newClass(exceptions[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression newClass(interfaces[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    this.interfaces[i] = newClass(interfaces[i]).index;
    Precondition Violations (7)
    Row Violation
    1Expression this.exceptions is a field being modified, and thus it cannot be parameterized
    2Expression this.interfaces is a field being modified, and thus it cannot be parameterized
    3Expression this.exceptions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.interfaces cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression cw.newClass(exceptions[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression newClass(interfaces[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7The refactoring of the clones is infeasible, because classes org.objectweb.asm.CodeWriter and org.objectweb.asm.ClassWriter do not have a common superclass