File path: /jEdit-4.2/src/bsh/Primitive.java | File path: /jEdit-4.2/src/bsh/Primitive.java | |||
Method name: Object doubleBinaryOperation(Double, Double, int)
|
Method name: Object floatBinaryOperation(Float, Float, int)
|
|||
Number of AST nodes: 38 | Number of AST nodes: 38 | |||
1 | double lhs = D1.doubleValue();↵ | 1 | float lhs = F1.floatValue();↵ | |
2 | double rhs = D2.doubleValue();↵ | 2 | float rhs = F2.floatValue();↵ | |
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 Double(lhs + rhs);↵ | 24 | return new Float(lhs + rhs);↵ | |
25 | case MINUS:↵ | 25 | case MINUS:↵ | |
26 | return new Double(lhs - rhs);↵ | 26 | return new Float(lhs - rhs);↵ | |
27 | case STAR:↵ | 27 | case STAR:↵ | |
28 | return new Double(lhs * rhs);↵ | 28 | return new Float(lhs * rhs);↵ | |
29 | case SLASH:↵ | 29 | case SLASH:↵ | |
30 | return new Double(lhs / rhs);↵ | 30 | return new Float(lhs / rhs);↵ | |
31 | case MOD:↵ | 31 | case MOD:↵ | |
32 | return new Double(lhs % rhs);↵ | 32 | return new Float(lhs % rhs);↵ | |
33 | // can't shift floating-point values↵ | 33 | // can't shift floats↵ | |
34 | case LSHIFT:↵ | 34 | case LSHIFT:↵ | |
35 | case LSHIFTX:↵ | 35 | case LSHIFTX:↵ | |
36 | case RSIGNEDSHIFT:↵ | 36 | case RSIGNEDSHIFT:↵ | |
37 | case RSIGNEDSHIFTX:↵ | 37 | case RSIGNEDSHIFTX:↵ | |
38 | case RUNSIGNEDSHIFT:↵ | 38 | case RUNSIGNEDSHIFT:↵ | |
39 | case RUNSIGNEDSHIFTX:↵ | 39 | case RUNSIGNEDSHIFTX:↵ | |
40 | throw new UtilEvalError("Can't shift doubles");↵ | 40 | throw new UtilEvalError("Can't shift floats ");↵ | |
41 | default:↵ | 41 | default:↵ | |
42 | throw new InterpreterError(↵ | 42 | throw new InterpreterError(↵ | |
43 | "Unimplemented binary double operator");↵ | 43 | "Unimplemented binary float operator");↵ | |
44 | } | 44 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 648 |
Number of mapped statements | 36 |
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) | 53.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | float lhs = F1.floatValue(); | ||||||||||||||||||||||
1 | double lhs = D1.doubleValue(); | | ||||||||||||||||||||||
| 2 | float rhs = F2.floatValue(); | ||||||||||||||||||||||
2 | double rhs = D2.doubleValue(); | | ||||||||||||||||||||||
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 Double(lhs + rhs); |
| 21 | return new Float(lhs + rhs); | ||||||||||||||||||||
22 | case MINUS: | 22 | case MINUS: | |||||||||||||||||||||
23 | return new Double(lhs - rhs); |
| 23 | return new Float(lhs - rhs); | ||||||||||||||||||||
24 | case STAR: | 24 | case STAR: | |||||||||||||||||||||
25 | return new Double(lhs * rhs); |
| 25 | return new Float(lhs * rhs); | ||||||||||||||||||||
26 | case SLASH: | 26 | case SLASH: | |||||||||||||||||||||
27 | return new Double(lhs / rhs); |
| 27 | return new Float(lhs / rhs); | ||||||||||||||||||||
28 | case MOD: | 28 | case MOD: | |||||||||||||||||||||
29 | return new Double(lhs % rhs); |
| 29 | return new Float(lhs % rhs); | ||||||||||||||||||||
30 | case LSHIFT: | 30 | case LSHIFT: | |||||||||||||||||||||
31 | case LSHIFTX: | 31 | case LSHIFTX: | |||||||||||||||||||||
32 | case RSIGNEDSHIFT: | 32 | case RSIGNEDSHIFT: | |||||||||||||||||||||
33 | case RSIGNEDSHIFTX: | 33 | case RSIGNEDSHIFTX: | |||||||||||||||||||||
34 | case RUNSIGNEDSHIFT: | 34 | case RUNSIGNEDSHIFT: | |||||||||||||||||||||
35 | case RUNSIGNEDSHIFTX: | 35 | case RUNSIGNEDSHIFTX: | |||||||||||||||||||||
36 | throw new UtilEvalError("Can't shift doubles"); |
| 36 | throw new UtilEvalError("Can't shift floats "); | ||||||||||||||||||||
37 | default: | 37 | default: | |||||||||||||||||||||
38 | throw new InterpreterError("Unimplemented binary double operator"); |
| 38 | throw new InterpreterError("Unimplemented binary float operator"); |
Row | Violation |
---|---|
1 | Type double of variable lhs does not match with type float of variable lhs |
2 | Type double of variable rhs does not match with type float of variable rhs |
3 | Type double of variable lhs does not match with type float of variable lhs |
4 | Type double of variable rhs does not match with type float of variable rhs |
5 | Type double of variable lhs does not match with type float of variable lhs |
6 | Type double of variable rhs does not match with type float of variable rhs |
7 | Type double of variable lhs does not match with type float of variable lhs |
8 | Type double of variable rhs does not match with type float of variable rhs |
9 | Type double of variable lhs does not match with type float of variable lhs |
10 | Type double of variable rhs does not match with type float of variable rhs |
11 | Type double of variable lhs does not match with type float of variable lhs |
12 | Type double of variable rhs does not match with type float of variable rhs |
13 | Expression new Double(lhs + rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression new Float(lhs + rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Type double of variable lhs does not match with type float of variable lhs |
16 | Type double of variable rhs does not match with type float of variable rhs |
17 | Expression new Double(lhs - rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression new Float(lhs - rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Type double of variable lhs does not match with type float of variable lhs |
20 | Type double of variable rhs does not match with type float of variable rhs |
21 | Expression new Double(lhs * rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression new Float(lhs * rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Type double of variable lhs does not match with type float of variable lhs |
24 | Type double of variable rhs does not match with type float of variable rhs |
25 | Expression new Double(lhs / rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
26 | Expression new Float(lhs / rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
27 | Type double of variable lhs does not match with type float of variable lhs |
28 | Type double of variable rhs does not match with type float of variable rhs |
29 | Expression new Double(lhs % rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
30 | Expression new Float(lhs % rhs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
31 | Type double of variable lhs does not match with type float of variable lhs |
32 | Type double of variable rhs does not match with type float of variable rhs |