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);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 85 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 15.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
168 | source = newCode.length; | | | |
169 | newCode.put1(Constants.LOOKUPSWITCH); | | 146 | newCode.put1(Constants.TABLESWITCH); |
170 | while (newCode.length % 4 != 0) | | 147 | while (newCode.length % 4 != 0) |
171 | | | 148 | |
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 |
1 | 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 |
2 | Clone fragment #1 returns variables u, j , while Clone fragment #2 returns variables j, u |