File path: /jEdit-4.2/src/bsh/Primitive.java | File path: /jEdit-4.2/src/bsh/Primitive.java | |||
Method name: Object intBinaryOperation(Integer, Integer, int)
|
Method name: Object longBinaryOperation(Long, Long, int)
|
|||
Number of AST nodes: 48 | Number of AST nodes: 48 | |||
1 | int lhs = I1.intValue();↵ | 1 | long lhs = L1.longValue();↵ | |
2 | int rhs = I2.intValue();↵ | 2 | long rhs = L2.longValue();↵ | |
3 | switch(kind)↵ | 3 | switch(kind)↵ | |
4 | {↵ | 4 | {↵ | |
5 | // boolean↵ | 5 | // boolean↵ | |
6 | case LT:↵ | 6 | case LT:↵ | |
7 | case LTX:↵ | 7 | case LTX:↵ | |
8 | return new Boolean(lhs < rhs);↵ | 8 | return new Boolean(lhs < rhs);↵ | |
9 | case GT:↵ | 9 | case GT:↵ | |
10 | case GTX:↵ | 10 | case GTX:↵ | |
11 | return new Boolean(lhs > rhs);↵ | 11 | return new Boolean(lhs > rhs);↵ | |
12 | case EQ:↵ | 12 | case EQ:↵ | |
13 | return new Boolean(lhs == rhs);↵ | 13 | return new Boolean(lhs == rhs);↵ | |
14 | case LE:↵ | 14 | case LE:↵ | |
15 | case LEX:↵ | 15 | case LEX:↵ | |
16 | return new Boolean(lhs <= rhs);↵ | 16 | return new Boolean(lhs <= rhs);↵ | |
17 | case GE:↵ | 17 | case GE:↵ | |
18 | case GEX:↵ | 18 | case GEX:↵ | |
19 | return new Boolean(lhs >= rhs);↵ | 19 | return new Boolean(lhs >= rhs);↵ | |
20 | case NE:↵ | 20 | case NE:↵ | |
21 | return new Boolean(lhs != rhs);↵ | 21 | return new Boolean(lhs != rhs);↵ | |
22 | // arithmetic↵ | 22 | // arithmetic↵ | |
23 | case PLUS:↵ | 23 | case PLUS:↵ | |
24 | return new Integer(lhs + rhs);↵ | 24 | return new Long(lhs + rhs);↵ | |
25 | case MINUS:↵ | 25 | case MINUS:↵ | |
26 | return new Integer(lhs - rhs);↵ | 26 | return new Long(lhs - rhs);↵ | |
27 | case STAR:↵ | 27 | case STAR:↵ | |
28 | return new Integer(lhs * rhs);↵ | 28 | return new Long(lhs * rhs);↵ | |
29 | case SLASH:↵ | 29 | case SLASH:↵ | |
30 | return new Integer(lhs / rhs);↵ | 30 | return new Long(lhs / rhs);↵ | |
31 | case MOD:↵ | 31 | case MOD:↵ | |
32 | return new Integer(lhs % rhs);↵ | 32 | return new Long(lhs % rhs);↵ | |
33 | // bitwise↵ | 33 | // bitwise↵ | |
34 | case LSHIFT:↵ | 34 | case LSHIFT:↵ | |
35 | case LSHIFTX:↵ | 35 | case LSHIFTX:↵ | |
36 | return new Integer(lhs << rhs);↵ | 36 | return new Long(lhs << rhs);↵ | |
37 | case RSIGNEDSHIFT:↵ | 37 | case RSIGNEDSHIFT:↵ | |
38 | case RSIGNEDSHIFTX:↵ | 38 | case RSIGNEDSHIFTX:↵ | |
39 | return new Integer(lhs >> rhs);↵ | 39 | return new Long(lhs >> rhs);↵ | |
40 | case RUNSIGNEDSHIFT:↵ | 40 | case RUNSIGNEDSHIFT:↵ | |
41 | case RUNSIGNEDSHIFTX:↵ | 41 | case RUNSIGNEDSHIFTX:↵ | |
42 | return new Integer(lhs >>> rhs);↵ | 42 | return new Long(lhs >>> rhs);↵ | |
43 | case BIT_AND:↵ | 43 | case BIT_AND:↵ | |
44 | case BIT_ANDX:↵ | 44 | case BIT_ANDX:↵ | |
45 | return new Integer(lhs & rhs);↵ | 45 | return new Long(lhs & rhs);↵ | |
46 | case BIT_OR:↵ | 46 | case BIT_OR:↵ | |
47 | case BIT_ORX:↵ | 47 | case BIT_ORX:↵ | |
48 | return new Integer(lhs | rhs);↵ | 48 | return new Long(lhs | rhs);↵ | |
49 | case XOR:↵ | 49 | case XOR:↵ | |
50 | return new Integer(lhs ^ rhs);↵ | 50 | return new Long(lhs ^ rhs);↵ | |
51 | default:↵ | 51 | default:↵ | |
52 | throw new InterpreterError(↵ | 52 | throw new InterpreterError(↵ | |
53 | "Unimplemented binary integer operator");↵ | 53 | "Unimplemented binary long operator");↵ | |
54 | } | 54 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 1058 |
Number of mapped statements | 46 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 178.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | long lhs = L1.longValue(); | ||||||||||||||||||||||
1 | int lhs = I1.intValue(); | | ||||||||||||||||||||||
| 2 | long rhs = L2.longValue(); | ||||||||||||||||||||||
2 | int rhs = I2.intValue(); | | ||||||||||||||||||||||
3 | switch (kind) | 3 | switch (kind) | |||||||||||||||||||||
4 | case LT: | 4 | case LT: | |||||||||||||||||||||
5 | case LTX: | 5 | case LTX: | |||||||||||||||||||||
6 | return new Boolean(lhs < rhs); |
| 6 | return new Boolean(lhs < rhs); | ||||||||||||||||||||
7 | case GT: | 7 | case GT: | |||||||||||||||||||||
8 | case GTX: | 8 | case GTX: | |||||||||||||||||||||
9 | return new Boolean(lhs > rhs); |
| 9 | return new Boolean(lhs > rhs); | ||||||||||||||||||||
10 | case EQ: | 10 | case EQ: | |||||||||||||||||||||
11 | return new Boolean(lhs == rhs); |
| 11 | return new Boolean(lhs == rhs); | ||||||||||||||||||||
12 | case LE: | 12 | case LE: | |||||||||||||||||||||
13 | case LEX: | 13 | case LEX: | |||||||||||||||||||||
14 | return new Boolean(lhs <= rhs); |
| 14 | return new Boolean(lhs <= rhs); | ||||||||||||||||||||
15 | case GE: | 15 | case GE: | |||||||||||||||||||||
16 | case GEX: | 16 | case GEX: | |||||||||||||||||||||
17 | return new Boolean(lhs >= rhs); |
| 17 | return new Boolean(lhs >= rhs); | ||||||||||||||||||||
18 | case NE: | 18 | case NE: | |||||||||||||||||||||
19 | return new Boolean(lhs != rhs); |
| 19 | return new Boolean(lhs != rhs); | ||||||||||||||||||||
20 | case PLUS: | 20 | case PLUS: | |||||||||||||||||||||
21 | return new Integer(lhs + rhs); |
| 21 | return new Long(lhs + rhs); | ||||||||||||||||||||
22 | case MINUS: | 22 | case MINUS: | |||||||||||||||||||||
23 | return new Integer(lhs - rhs); |
| 23 | return new Long(lhs - rhs); | ||||||||||||||||||||
24 | case STAR: | 24 | case STAR: | |||||||||||||||||||||
25 | return new Integer(lhs * rhs); |
| 25 | return new Long(lhs * rhs); | ||||||||||||||||||||
26 | case SLASH: | 26 | case SLASH: | |||||||||||||||||||||
27 | return new Integer(lhs / rhs); |
| 27 | return new Long(lhs / rhs); | ||||||||||||||||||||
28 | case MOD: | 28 | case MOD: | |||||||||||||||||||||
29 | return new Integer(lhs % rhs); |
| 29 | return new Long(lhs % rhs); | ||||||||||||||||||||
30 | case LSHIFT: | 30 | case LSHIFT: | |||||||||||||||||||||
31 | case LSHIFTX: | 31 | case LSHIFTX: | |||||||||||||||||||||
32 | return new Integer(lhs << rhs); |
| 32 | return new Long(lhs << rhs); | ||||||||||||||||||||
33 | case RSIGNEDSHIFT: | 33 | case RSIGNEDSHIFT: | |||||||||||||||||||||
34 | case RSIGNEDSHIFTX: | 34 | case RSIGNEDSHIFTX: | |||||||||||||||||||||
35 | return new Integer(lhs >> rhs); |
| 35 | return new Long(lhs >> rhs); | ||||||||||||||||||||
36 | case RUNSIGNEDSHIFT: | 36 | case RUNSIGNEDSHIFT: | |||||||||||||||||||||
37 | case RUNSIGNEDSHIFTX: | 37 | case RUNSIGNEDSHIFTX: | |||||||||||||||||||||
38 | return new Integer(lhs >>> rhs); |
| 38 | return new Long(lhs >>> rhs); | ||||||||||||||||||||
39 | case BIT_AND: | 39 | case BIT_AND: | |||||||||||||||||||||
40 | case BIT_ANDX: | 40 | case BIT_ANDX: | |||||||||||||||||||||
41 | return new Integer(lhs & rhs); |
| 41 | return new Long(lhs & rhs); | ||||||||||||||||||||
42 | case BIT_OR: | 42 | case BIT_OR: | |||||||||||||||||||||
43 | case BIT_ORX: | 43 | case BIT_ORX: | |||||||||||||||||||||
44 | return new Integer(lhs | rhs); |
| 44 | return new Long(lhs | rhs); | ||||||||||||||||||||
45 | case XOR: | 45 | case XOR: | |||||||||||||||||||||
46 | return new Integer(lhs ^ rhs); |
| 46 | return new Long(lhs ^ rhs); | ||||||||||||||||||||
47 | default: | 47 | default: | |||||||||||||||||||||
48 | throw new InterpreterError("Unimplemented binary integer operator"); |
| 48 | throw new InterpreterError("Unimplemented binary long operator"); |
Row | Violation |
---|---|
1 | Type int of variable lhs does not match with type long of variable lhs |
2 | Type int of variable rhs does not match with type long of variable rhs |
3 | Type int of variable lhs does not match with type long of variable lhs |
4 | Type int of variable rhs does not match with type long of variable rhs |
5 | Type int of variable lhs does not match with type long of variable lhs |
6 | Type int of variable rhs does not match with type long of variable rhs |
7 | Type int of variable lhs does not match with type long of variable lhs |
8 | Type int of variable rhs does not match with type long of variable rhs |
9 | Type int of variable lhs does not match with type long of variable lhs |
10 | Type int of variable rhs does not match with type long of variable rhs |
11 | Type int of variable lhs does not match with type long of variable lhs |
12 | Type int of variable rhs does not match with type long of variable rhs |
13 | Expression new Integer(lhs + rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression new Long(lhs + rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Type int of variable lhs does not match with type long of variable lhs |
16 | Type int of variable rhs does not match with type long of variable rhs |
17 | Expression new Integer(lhs - rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression new Long(lhs - rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Type int of variable lhs does not match with type long of variable lhs |
20 | Type int of variable rhs does not match with type long of variable rhs |
21 | Expression new Integer(lhs * rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression new Long(lhs * rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Type int of variable lhs does not match with type long of variable lhs |
24 | Type int of variable rhs does not match with type long of variable rhs |
25 | Expression new Integer(lhs / rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
26 | Expression new Long(lhs / rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
27 | Type int of variable lhs does not match with type long of variable lhs |
28 | Type int of variable rhs does not match with type long of variable rhs |
29 | Expression new Integer(lhs % rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
30 | Expression new Long(lhs % rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
31 | Type int of variable lhs does not match with type long of variable lhs |
32 | Type int of variable rhs does not match with type long of variable rhs |
33 | Expression new Integer(lhs << rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
34 | Expression new Long(lhs << rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
35 | Type int of variable lhs does not match with type long of variable lhs |
36 | Type int of variable rhs does not match with type long of variable rhs |
37 | Expression new Integer(lhs >> rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
38 | Expression new Long(lhs >> rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
39 | Type int of variable lhs does not match with type long of variable lhs |
40 | Type int of variable rhs does not match with type long of variable rhs |
41 | Expression new Integer(lhs >>> rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
42 | Expression new Long(lhs >>> rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
43 | Type int of variable lhs does not match with type long of variable lhs |
44 | Type int of variable rhs does not match with type long of variable rhs |
45 | Expression new Integer(lhs & rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
46 | Expression new Long(lhs & rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
47 | Type int of variable lhs does not match with type long of variable lhs |
48 | Type int of variable rhs does not match with type long of variable rhs |
49 | Expression new Integer(lhs | rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
50 | Expression new Long(lhs | rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
51 | Type int of variable lhs does not match with type long of variable lhs |
52 | Type int of variable rhs does not match with type long of variable rhs |
53 | Expression new Integer(lhs ^ rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
54 | Expression new Long(lhs ^ rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
55 | Type int of variable lhs does not match with type long of variable lhs |
56 | Type int of variable rhs does not match with type long of variable rhs |