if (computeMaxs && opcode != Constants.NEWARRAY) {
// updates current and max stack sizes only if opcode == NEWARRAY
// (stack size variation = 0 for BIPUSH or SIPUSH)
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 visitIntInsn(int, int)
|
|
Method name: void visitIincInsn(int, int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | if (computeMaxs && opcode != Constants.NEWARRAY) {↵ | | 1 | if (computeMaxs) {↵
|
2 | // updates current and max stack sizes only if opcode == NEWARRAY↵ | | 2 | // updates ↵
|
3 | // (stack size variation = 0 for BIPUSH or SIPUSH)↵ | | 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 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | int size = stackSize + 1; | | 2 | int n = var + 1; |
3 | if (size > maxStackSize) | | 3 | if (n > maxLocals) |
4 | | | 4 | |
Precondition Violations (3)
Row |
Violation |
1 | Expression maxStackSize is a field being modified, and thus it cannot be parameterized |
2 | Expression maxLocals is a field being modified, and thus it cannot be parameterized |
3 | Clone fragment #1 returns variables size , while Clone fragment #2 returns variables |