switch(kind) { case PLUS: return operand; case MINUS: return -operand; default: throw new InterpreterError("bad float unaryOperation"); }
switch(kind) { case PLUS: return operand; case MINUS: return -operand; default: throw new InterpreterError("bad double 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: float floatUnaryOperation(Float, int) Method name: double doubleUnaryOperation(Double, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
switch(kind)
1
switch(kind)
2
        {
2
        {
3
            case PLUS:
3
            case PLUS:
4
                return operand;
4
                return operand;
5
            case MINUS:
5
            case MINUS:
6
                return -operand;
6
                return -operand;
7
            default:
7
            default:
8
                throw new InterpreterError("bad float unaryOperation");
8
                throw new InterpreterError("bad double unaryOperation");
9
        }
9
        }
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.1
Clones locationClones are declared in the same class
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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 float unaryOperation");
    8
    throw new InterpreterError("bad float unaryOperation");
    8
    throw new InterpreterError("bad double unaryOperation");
    Differences
    Expression1Expression2Difference
    "bad float unaryOperation""bad double unaryOperation"LITERAL_VALUE_MISMATCH
    8
    throw new InterpreterError("bad double unaryOperation");
    Precondition Violations (4)
    Row Violation
    1Unmatched return operand;
    2Unmatched return operand;
    3Unmatched return -operand;
    4Unmatched return -operand;