key.set(value);
Item result = get(key);
if (result == null) {
pool.put1(DOUBLE).put8(Double.doubleToLongBits(value));
result = new Item(index, key);
put(result);
index += 2;
}
return result;
key.set(value);
Item result = get(key);
if (result == null) {
pool.put1(LONG).put8(value);
result = new Item(index, key);
put(result);
index += 2;
}
return 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 newDouble(double)
|
|
Method name: Item newLong(long)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | key.set(value);↵ | | 1 | key.set(value);↵
|
2 | Item result = get(key);↵ | | 2 | Item result = get(key);↵
|
3 | if (result == null) {↵ | | 3 | if (result == null) {↵
|
4 | pool.put1(DOUBLE).put8(Double.doubleToLongBits(value));↵ | | 4 | pool.put1(LONG).put8(value);↵
|
5 | result = new Item(index, key);↵ | | 5 | result = new Item(index, key);↵
|
6 | put(result);↵ | | 6 | put(result);↵
|
7 | index += 2;↵ | | 7 | index += 2;↵
|
8 | }↵ | | 8 | }↵
|
9 | return result; | | 9 | return result;
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 34 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 3.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | key.set(value); | | 1 | key.set(value); |
2 | Item result = get(key); | | 2 | Item result = get(key); |
3 | if (result == null) | | 3 | if (result == null) |
4 | pool.put1(DOUBLE).put8(Double.doubleToLongBits(value)); | | 4 | pool.put1(LONG).put8(value); |
5 | result = new Item(index, key); | | 5 | result = new Item(index, key); |
6 | | | 6 | |
7 | | | 7 | |
8 | return result; | | 8 | return result; |
Precondition Violations (1)
Row |
Violation |
1 | Type double of variable value does not match with type long of variable value |