if (result == null) {
pool.put1(UTF8).putUTF(value);
result = new Item(index++, key);
put(result);
}
if (result == null) {
pool.put1(INT).put4(value);
result = new Item(index++, key);
put(result);
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/objectweb/asm/ClassWriter.java
|
|
File path: /jEdit-4.2/src/org/objectweb/asm/ClassWriter.java
|
Method name: Item newUTF8(String)
|
|
Method name: Item newInteger(int)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (result == null) {↵ | | 1 | if (result == null) {↵
|
2 | pool.put1(UTF8).putUTF(value);↵ | | 2 | pool.put1(INT).put4(value);↵
|
3 | result = new Item(index++, key);↵ | | 3 | result = new Item(index++, key);↵
|
4 | put(result);↵ | | 4 | put(result);↵
|
5 | } | | 5 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 5.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (result == null) | | 3 | if (result == null) |
| | | 4 | pool.put1(INT).put4(value); |
4 | pool.put1(UTF8).putUTF(value); | | | |
5 | result = new Item(index++, key); | | 5 | result = new Item(index++, key); |
6 | | | 6 | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement pool.put1(INT).put4(value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement pool.put1(UTF8).putUTF(value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |