if(b)
rhs = new Float(rnum.floatValue());
else
lhs = new Float(lnum.floatValue());
if((b = (lnum instanceof Long)) || (rnum instanceof Long))
{
if(b)
rhs = new Long(rnum.longValue());
else
lhs = new Long(lnum.longValue());
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/Primitive.java
|
|
File path: /jEdit-4.2/src/bsh/Primitive.java
|
Method name: Object[] promotePrimitives(Object, Object)
|
|
Method name: Object[] promotePrimitives(Object, Object)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
| | | 1 | if((b = (lnum instanceof Long)) || (rnum instanceof Long))↵
|
| | | 2 | {↵
|
1 | if(b)↵ | | 3 | if(b)↵
|
2 | rhs = new Float(rnum.floatValue());↵ | | 4 | rhs = new Long(rnum.longValue());↵
|
3 | else↵ | | 5 | else↵
|
4 | lhs = new Float(lnum.floatValue()); | | 6 | lhs = new Long(lnum.longValue());↵
|
| | | 7 | }
|
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.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | if (b) | | 16 | if (b) |
13 | rhs = new Float(rnum.floatValue()); | | | |
| | | | |
14 | lhs = new Float(lnum.floatValue()); | | | |
| | | 18 | lhs = new Long(lnum.longValue()); |
| | | 17 | rhs = new Long(rnum.longValue()); |
Precondition Violations (0)
Row |
Violation |