File path: /jEdit-4.2/src/bsh/Primitive.java | File path: /jEdit-4.2/src/bsh/Primitive.java | |||
Method name: long longUnaryOperation(Long, int)
|
Method name: int intUnaryOperation(Integer, int)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | long operand = L.longValue();↵ | 1 | int operand = I.intValue();↵ | |
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 | case TILDE:↵ | 8 | case TILDE:↵ | |
9 | return ~operand;↵ | 9 | return ~operand;↵ | |
10 | case INCR:↵ | 10 | case INCR:↵ | |
11 | return operand + 1;↵ | 11 | return operand + 1;↵ | |
12 | case DECR:↵ | 12 | case DECR:↵ | |
13 | return operand - 1;↵ | 13 | return operand - 1;↵ | |
14 | default:↵ | 14 | default:↵ | |
15 | throw new InterpreterError("bad long unaryOperation");↵ | 15 | throw new InterpreterError("bad integer unaryOperation");↵ | |
16 | } | 16 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 96 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 6 |
Number of unmapped statements in the second code fragment | 6 |
Time elapsed for statement mapping (ms) | 2.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | int operand = I.intValue(); | ||||||||||||
1 | long operand = L.longValue(); | | ||||||||||||
2 | switch (kind) | 2 | switch (kind) | |||||||||||
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 | case TILDE: | 7 | case TILDE: | |||||||||||
|
| 8 | return ~operand; | |||||||||||
8 | return ~operand; |
| | |||||||||||
9 | case INCR: | 9 | case INCR: | |||||||||||
|
| 10 | return operand + 1; | |||||||||||
10 | return operand + 1; |
| | |||||||||||
11 | case DECR: | 11 | case DECR: | |||||||||||
|
| 12 | return operand - 1; | |||||||||||
12 | return operand - 1; |
| | |||||||||||
13 | default: | 13 | default: | |||||||||||
14 | throw new InterpreterError("bad long unaryOperation"); |
| 14 | throw new InterpreterError("bad integer unaryOperation"); |
Row | Violation |
---|---|
1 | Unmatched return operand; |
2 | Unmatched return operand; |
3 | Unmatched return -operand; |
4 | Unmatched return -operand; |
5 | Unmatched return ~operand; |
6 | Unmatched return ~operand; |
7 | Unmatched return operand + 1; |
8 | Unmatched return operand + 1; |
9 | Unmatched return operand - 1; |
10 | Unmatched return operand - 1; |