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)2.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
    Preondition Violations
    Expression exceptionCount is a field being modified, and thus it cannot be parameterized
    Expression interfaceCount is a field being modified, and thus it cannot be parameterized
    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
    Expression exceptionCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression interfaceCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    Preondition Violations
    Expression exceptionCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression interfaceCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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 (12)
    Row Violation
    1Expression exceptionCount is a field being modified, and thus it cannot be parameterized
    2Expression interfaceCount is a field being modified, and thus it cannot be parameterized
    3Expression this.exceptions is a field being modified, and thus it cannot be parameterized
    4Expression this.interfaces is a field being modified, and thus it cannot be parameterized
    5Expression exceptionCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression interfaceCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression exceptionCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression interfaceCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression this.exceptions cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression this.interfaces cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression cw.newClass(exceptions[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression newClass(interfaces[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted