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
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in the same method
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (b)
    16
    if (b)
    13
    rhs = new Float(rnum.floatValue());
                                                                              
    else
            
    14
    lhs = new Float(lnum.floatValue());
                                                                              
                                                                          
    18
    lhs = new Long(lnum.longValue());
                                                                          
    17
    rhs = new Long(rnum.longValue());
    Precondition Violations (0)
    Row Violation