static int intUnaryOperation(Integer I, int kind) { int operand = I.intValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; case TILDE: return ~operand; case INCR: return operand + 1; case DECR: return operand - 1; default: throw new InterpreterError("bad integer unaryOperation");
static long longUnaryOperation(Long L, int kind) { long operand = L.longValue(); switch(kind) { case PLUS: return operand; case MINUS: return -operand; case TILDE: return ~operand; case INCR: return operand + 1; case DECR: return operand - 1; default: throw new InterpreterError("bad long 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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
static int intUnaryOperation(Integer I, int kind)
1
static long longUnaryOperation(Long L, int kind)
2
    {
2
    {
3
        int operand = I.intValue();
3
        long operand = L.longValue();
4
        switch(kind)
4
        switch(kind)
5
        {
5
        {
6
            case PLUS:
6
            case PLUS:
7
                return operand;
7
                return operand;
8
            case MINUS:
8
            case MINUS:
9
                return -operand;
9
                return -operand;
10
            case TILDE:
10
            case TILDE:
11
                return ~operand;
11
                return ~operand;
12
            case INCR:
12
            case INCR:
13
                return operand + 1;
13
                return operand + 1;
14
            case DECR:
14
            case DECR:
15
                return operand - 1;
15
                return operand - 1;
16
            default:
16
            default:
17
                throw new InterpreterError("bad integer unaryOperation");
17
                throw new InterpreterError("bad long unaryOperation");
18
        
18
        
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0