double operand = D.doubleValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; default: throw new InterpreterError("bad double unaryOperation"); }
float operand = F.floatValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; default: throw new InterpreterError("bad float unaryOperation"); }
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: double doubleUnaryOperation(Double, int) Method name: float floatUnaryOperation(Float, int)
Number of AST nodes: 8 Number of AST nodes: 8
1
double operand = D.doubleValue();
1
float operand = F.floatValue();
2
        switch(kind)
2
        switch(kind)
3
        {
3
        {
4
            case PLUS:
4
            case PLUS:
5
                return operand;
5
                return operand;
6
            case MINUS:
6
            case MINUS:
7
                return -operand;
7
                return -operand;
8
            default:
8
            default:
9
                throw new InterpreterError("bad double unaryOperation");
9
                throw new InterpreterError("bad float unaryOperation");
10
        }
10
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                    
    1
    float operand = F.floatValue();
    1
    double operand = D.doubleValue();
                                                                        
    2
    switch (kind)
    2
    switch (kind)
    3
    case PLUS:
    3
    case PLUS:
                                        
    4
    return operand;
    Preondition Violations
    Unmatched return operand;
    4
    return operand;
    4
    return operand;
    4
    return operand;
    Preondition Violations
    Unmatched return operand;
                                        
    5
    case MINUS:
    5
    case MINUS:
                                          
    6
    return -operand;
    Preondition Violations
    Unmatched return -operand;
    6
    return -operand;
    6
    return -operand;
    6
    return -operand;
    Preondition Violations
    Unmatched return -operand;
                                          
    7
    default:
    7
    default:
    8
    throw new InterpreterError("bad double unaryOperation");
    8
    throw new InterpreterError("bad double unaryOperation");
    8
    throw new InterpreterError("bad float unaryOperation");
    Differences
    Expression1Expression2Difference
    "bad double unaryOperation""bad float unaryOperation"LITERAL_VALUE_MISMATCH
    8
    throw new InterpreterError("bad float unaryOperation");
    Precondition Violations (4)
    Row Violation
    1Unmatched return operand;
    2Unmatched return operand;
    3Unmatched return -operand;
    4Unmatched return -operand;