source = newCode.length; newCode.put1(Constants.LOOKUPSWITCH); while (newCode.length % 4 != 0) { newCode.put1(0); } label = v + readInt(b, u); u += 4; newOffset = getNewOffset(allIndexes, allSizes, v, label); newCode.put4(newOffset); j = readInt(b, u); u += 4; newCode.put4(j);
newCode.put1(Constants.TABLESWITCH); while (newCode.length % 4 != 0) { newCode.put1(0); } label = v + readInt(b, u); u += 4; newOffset = getNewOffset(allIndexes, allSizes, v, label); newCode.put4(newOffset); j = readInt(b, u); u += 4; newCode.put4(j);
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: int[] resizeInstructions(int[], int[], int) Method name: int[] resizeInstructions(int[], int[], int)
Number of AST nodes: 11 Number of AST nodes: 10
1
source = newCode.length;
2
          newCode.put1(Constants.LOOKUPSWITCH);
1
newCode.put1(Constants.TABLESWITCH);
3
          while (newCode.length % 4 != 0) {
2
          while (newCode.length % 4 != 0) {
4
            newCode.put1(0);
3
            newCode.put1(0);
5
          }
4
          }
6
          label = v + readInt(b, u); u += 4;
5
          label = v + readInt(b, u); u += 4;
7
          newOffset = getNewOffset(allIndexes, allSizes, v, label);
6
          newOffset = getNewOffset(allIndexes, allSizes, v, label);
8
          newCode.put4(newOffset);
7
          newCode.put4(newOffset);
9
          j = readInt(b, u); u += 4;
8
          j = readInt(b, u); u += 4;
10
          newCode.put4(j);
9
          newCode.put4(j);
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.3
Clones locationClones are in the same method
Number of node comparisons85
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)15.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    168
    source = newCode.length;
    168
    source = newCode.length;
    Preondition Violations
    Unmatched statement source=newCode.length; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                          
    169
    newCode.put1(Constants.LOOKUPSWITCH);
    169
    newCode.put1(Constants.LOOKUPSWITCH);
    146
    newCode.put1(Constants.TABLESWITCH);
    Differences
    Expression1Expression2Difference
    LOOKUPSWITCHTABLESWITCHVARIABLE_NAME_MISMATCH
    146
    newCode.put1(Constants.TABLESWITCH);
    170
    while (newCode.length % 4 != 0)
    147
    while (newCode.length % 4 != 0)
    171
    newCode.put1(0);
    148
    newCode.put1(0);
    172
    label = v + readInt(b, u);
    149
    label = v + readInt(b, u);
    173
    u += 4;
    150
    u += 4;
    174
    newOffset = getNewOffset(allIndexes, allSizes, v, label);
    151
    newOffset = getNewOffset(allIndexes, allSizes, v, label);
    175
    newCode.put4(newOffset);
    152
    newCode.put4(newOffset);
    176
    j = readInt(b, u);
    153
    j = readInt(b, u);
    177
    u += 4;
    154
    u += 4;
    178
    newCode.put4(j);
    155
    newCode.put4(j);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement source=newCode.length; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Clone fragment #1 returns variables u, j , while Clone fragment #2 returns variables j, u