File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeFloat.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeShort.java | |||
Method name: void setPreparedStatementValue(PreparedStatement, Object, int)
|
Method name: void setPreparedStatementValue(PreparedStatement, Object, int)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if (value == null) {↵ | 1 | if (value == null) {↵ | |
2 | pstmt.setNull(position, _colDef.getSqlType());↵ | 2 | pstmt.setNull(position, _colDef.getSqlType());↵ | |
3 | }↵ | |||
4 | else {↵ | |||
5 | ↵ | 3 | }↵ | |
4 | else {↵ | |||
6 | pstmt.setFloat(position, ((Float)value).floatValue());↵ | 5 | pstmt.setInt(position, ((Short)value).intValue());↵ | |
7 | } | 6 | } | |
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 in different classes having the same super class |
Number of node comparisons | 9 |
Number of mapped statements | 3 |
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) | 11.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (value == null) | 1 | if (value == null) | |||||||||||||||||||||||||||||
2 | pstmt.setNull(position, _colDef.getSqlType()); | 2 | pstmt.setNull(position, _colDef.getSqlType()); | |||||||||||||||||||||||||||||
else | else | |||||||||||||||||||||||||||||||
3 | pstmt.setFloat(position, ((Float)value).floatValue()); |
| 3 | pstmt.setInt(position, ((Short)value).intValue()); |
Row | Violation |
---|---|
1 | Expression ((Float)value).floatValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ((Short)value).intValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type float of variable ((Float)value).floatValue() does not match with type int of variable ((Short)value).intValue() |
4 | Expression (Float)value cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression (Short)value cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression pstmt.setFloat(position,((Float)value).floatValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression pstmt.setInt(position,((Short)value).intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression pstmt.setFloat(position,((Float)value).floatValue()) is a void method call, and thus it cannot be parameterized |
9 | Expression pstmt.setInt(position,((Short)value).intValue()) is a void method call, and thus it cannot be parameterized |