if (computeMaxs && opcode == Constants.NEW) { // updates current and max stack sizes only if opcode == NEW // (stack size variation = 0 for ANEWARRAY, CHECKCAST, INSTANCEOF) int size = stackSize + 1; if (size > maxStackSize) { maxStackSize = size; } stackSize = size; }
if (computeMaxs) { // updates max locals only (no stack change) int n = var + 1; if (n > maxLocals) { maxLocals = n; } }
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/CodeWriter.java
Method name: void visitTypeInsn(int, String) Method name: void visitIincInsn(int, int)
Number of AST nodes: 5 Number of AST nodes: 4
1
if (computeMaxs && opcode == Constants.NEW) {
1
if (computeMaxs) {
2
      // updates current and max stack sizes only if opcode == NEW
2
      // updates 
3
      // (stack size variation = 0 for ANEWARRAY, CHECKCAST, INSTANCEOF)
3
max locals only (no stack change)
4
      int size = stackSize + 1;
4
      int n = var + 1;
5
      if (size > maxStackSize) {
5
      if (n > maxLocals) {
6
        maxStackSize = size;
6
        max
7
      }
8
      stackSize = size;
7
Locals = n;
8
      }
9
    }
9
    }
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.2
Clones locationClones are declared in the same class
Number of node comparisons6
  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)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    int size = stackSize + 1;
    2
    int size = stackSize + 1;
    2
    int n = var + 1;
    Differences
    Expression1Expression2Difference
    sizenVARIABLE_NAME_MISMATCH
    stackSizevarVARIABLE_NAME_MISMATCH
    2
    int n = var + 1;
    3
    if (size > maxStackSize)
    3
    if (size > maxStackSize)
    3
    if (n > maxLocals)
    Differences
    Expression1Expression2Difference
    sizenVARIABLE_NAME_MISMATCH
    maxStackSizemaxLocalsVARIABLE_NAME_MISMATCH
    3
    if (n > maxLocals)
    4
    maxStackSize = size;
    4
    maxStackSize = size;
    4
    maxLocals = n;
    Differences
    Expression1Expression2Difference
    maxStackSizemaxLocalsVARIABLE_NAME_MISMATCH
    sizenVARIABLE_NAME_MISMATCH
    4
    maxLocals = n;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables size , while Clone fragment #2 returns variables