File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/ResultSetReader.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/ResultSetReader.java | |||
Method name: Object readNumeric(int)
|
Method name: Object readFloat(int)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | Object result = _rs.getObject(columnIdx);↵ | 1 | Object result = _rs.getObject(columnIdx);↵ | |
2 | if (result != null && !(result instanceof BigDecimal)) {↵ | 2 | if (result != null && !(result instanceof Double)) {↵ | |
3 | if (result instanceof Number) {↵ | 3 | if (result instanceof Number) {↵ | |
4 | Number nbr = (Number) result;↵ | 4 | Number nbr = (Number) result;↵ | |
5 | result = new BigDecimal(nbr.doubleValue());↵ | 5 | result = new Double(nbr.doubleValue());↵ | |
6 | } else {↵ | 6 | } else {↵ | |
7 | result = new BigDecimal(result.toString());↵ | 7 | result = new Double(result.toString());↵ | |
8 | }↵ | 8 | }↵ | |
9 | }↵ | 9 | }↵ | |
10 | return result; | 10 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 21 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Object result = _rs.getObject(columnIdx); | 1 | Object result = _rs.getObject(columnIdx); | |||||||||||||
2 | if (result != null && !(result instanceof BigDecimal)) |
| 2 | if (result != null && !(result instanceof Double)) | ||||||||||||
3 | if (result instanceof Number) | 3 | if (result instanceof Number) | |||||||||||||
4 | Number nbr = (Number)result; | 4 | Number nbr = (Number)result; | |||||||||||||
5 | result = new BigDecimal(nbr.doubleValue()); |
| 5 | result = new Double(nbr.doubleValue()); | ||||||||||||
else | else | |||||||||||||||
6 | result = new BigDecimal(result.toString()); |
| 6 | result = new Double(result.toString()); | ||||||||||||
7 | return result; | 7 | return result; |
Row | Violation |
---|---|
1 | Expression result instanceof BigDecimal cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression result instanceof Double cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new BigDecimal(nbr.doubleValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new Double(nbr.doubleValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression new BigDecimal(result.toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression new Double(result.toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |