File path: /jEdit-4.2/src/bsh/Primitive.java | File path: /jEdit-4.2/src/bsh/BSHUnaryExpression.java | |||
Method name: Primitive unaryOperation(Primitive, int)
|
Method name: Object primitiveWrapperUnaryOperation(Object, int)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | int result = intUnaryOperation((Integer)operand, kind);↵ | 1 | int result = Primitive.intUnaryOperation((Integer)operand, kind);↵ | |
2 | // ++ and -- must be cast back the original type↵ | 2 | // ++ and -- must be cast back the original type↵ | |
3 | if(kind == INCR || kind == DECR)↵ | 3 | if(kind == INCR || kind == DECR)↵ | |
4 | {↵ | 4 | {↵ | |
5 | if(operandType == Byte.TYPE)↵ | 5 | if(operandType == Byte.TYPE)↵ | |
6 | return new Primitive((byte)result);↵ | 6 | return new Byte((byte)result);↵ | |
7 | if(operandType == Short.TYPE)↵ | 7 | if(operandType == Short.TYPE)↵ | |
8 | return new Primitive((short)result);↵ | 8 | return new Short((short)result);↵ | |
9 | if(operandType == Character.TYPE)↵ | 9 | if(operandType == Character.TYPE)↵ | |
10 | return new Primitive((char)result);↵ | 10 | return new Character((char)result);↵ | |
11 | }↵ | 11 | }↵ | |
12 | return new Primitive(result); | 12 | return new Integer(result); | |
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) | 1.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 33 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 3.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | int result = intUnaryOperation((Integer)operand, kind); |
| 6 | int result = Primitive.intUnaryOperation((Integer)operand, kind); | |||||||||||||||
11 | if (kind == INCR || kind == DECR) | 7 | if (kind == INCR || kind == DECR) | ||||||||||||||||
12 | if (operandType == Byte.TYPE) |
| 12 | if (operandType == Character.TYPE) | |||||||||||||||
| 13 | return new Character((char)result); | |||||||||||||||||
13 | return new Primitive((byte)result); | | |||||||||||||||||
14 | if (operandType == Short.TYPE) | 10 | if (operandType == Short.TYPE) | ||||||||||||||||
| 11 | return new Short((short)result); | |||||||||||||||||
15 | return new Primitive((short)result); | | |||||||||||||||||
16 | if (operandType == Character.TYPE) |
| 8 | if (operandType == Byte.TYPE) | |||||||||||||||
| 9 | return new Byte((byte)result); | |||||||||||||||||
17 | return new Primitive((char)result); | | |||||||||||||||||
| 14 | return new Integer(result); | |||||||||||||||||
18 | return new Primitive(result); | |
Row | Violation |
---|---|
1 | Type java.lang.Byte of variable Byte does not match with type java.lang.Character of variable Character |
2 | Type java.lang.Class<java.lang.Byte> of variable Byte.TYPE does not match with type java.lang.Class<java.lang.Character> of variable Character.TYPE |
3 | Type java.lang.Character of variable Character does not match with type java.lang.Byte of variable Byte |
4 | Type java.lang.Class<java.lang.Character> of variable Character.TYPE does not match with type java.lang.Class<java.lang.Byte> of variable Byte.TYPE |