if (computeMaxs) { // updates current stack size (max stack size unchanged) --stackSize; // ends current block (with many new successors) if (currentBlock != null) { currentBlock.maxStackSize = maxStackSize; addSuccessor(stackSize, dflt); for (int i = 0; i < labels.length; ++i) { addSuccessor(stackSize, labels[i]); } currentBlock = null; } } // adds the instruction to the bytecode of the method int source = code.length; code.put1(Constants.TABLESWITCH); while (code.length % 4 != 0) { code.put1(0); } dflt.put(this, code, source, true);
if (computeMaxs) { // updates current stack size (max stack size unchanged) --stackSize; // ends current block (with many new successors) if (currentBlock != null) { currentBlock.maxStackSize = maxStackSize; addSuccessor(stackSize, dflt); for (int i = 0; i < labels.length; ++i) { addSuccessor(stackSize, labels[i]); } currentBlock = null; } } // adds the instruction to the bytecode of the method int source = code.length; code.put1(Constants.LOOKUPSWITCH); while (code.length % 4 != 0) { code.put1(0); } dflt.put(this, code, source, true);
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 visitTableSwitchInsn(int, int, Label, Label[]) Method name: void visitLookupSwitchInsn(Label, int[], Label[])
Number of AST nodes: 13 Number of AST nodes: 13
1
if (computeMaxs) {
1
if (computeMaxs) {
2
      // updates current stack size (max stack size unchanged)
2
      // updates current stack size (max stack size unchanged)
3
      --stackSize;
3
      --stackSize;
4
      // ends current block (with many new successors)
4
      // ends current block (with many new successors)
5
      if (currentBlock != null) {
5
      if (currentBlock != null) {
6
        currentBlock.maxStackSize = maxStackSize;
6
        currentBlock.maxStackSize = maxStackSize;
7
        addSuccessor(stackSize, dflt);
7
        addSuccessor(stackSize, dflt);
8
        for (int i = 0; i < labels.length; ++i) {
8
        for (int i = 0; i < labels.length; ++i) {
9
          addSuccessor(stackSize, labels[i]);
9
          addSuccessor(stackSize, labels[i]);
10
        }
10
        }
11
        currentBlock = null;
11
        currentBlock = null;
12
      }
12
      }
13
    }
13
    }
14
    // adds the instruction to the bytecode of the method
14
    // adds the instruction to the bytecode of the method
15
    int source = code.length;
15
    int source = code.length;
16
    code.put1(Constants.TABLESWITCH);
16
    code.put1(Constants.LOOKUPSWITCH);
17
    while (code.length % 4 != 0) {
17
    while (code.length % 4 != 0) {
18
      code.put1(0);
18
      code.put1(0);
19
    }
19
    }
20
    dflt.put(this, code, source, true);
20
    dflt.put(this, code, source, true);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are declared in the same class
Number of node comparisons37
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements13
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (computeMaxs)
    1
    if (computeMaxs)
    2
    --stackSize;
    2
    --stackSize;
    3
    if (currentBlock != null)
    3
    if (currentBlock != null)
    4
    currentBlock.maxStackSize = maxStackSize;
    4
    currentBlock.maxStackSize = maxStackSize;
    5
    addSuccessor(stackSize, dflt);
    5
    addSuccessor(stackSize, dflt);
    6
    for (int i = 0; i < labels.length; ++i)
    6
    for (int i = 0; i < labels.length; ++i)
    7
    addSuccessor(stackSize, labels[i]);
    7
    addSuccessor(stackSize, labels[i]);
    8
    currentBlock = null;
    8
    currentBlock = null;
    9
    int source = code.length;
    9
    int source = code.length;
    10
    code.put1(Constants.TABLESWITCH);
    10
    code.put1(Constants.TABLESWITCH);
    10
    code.put1(Constants.LOOKUPSWITCH);
    Differences
    Expression1Expression2Difference
    TABLESWITCHLOOKUPSWITCHVARIABLE_NAME_MISMATCH
    10
    code.put1(Constants.LOOKUPSWITCH);
    11
    while (code.length % 4 != 0)
    11
    while (code.length % 4 != 0)
    12
    code.put1(0);
    12
    code.put1(0);
    13
    dflt.put(this, code, source, true);
    13
    dflt.put(this, code, source, true);
    Precondition Violations (0)
    Row Violation