File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/types/PostgreSqlXmlTypeDataTypeComponent.java | File path: /sql12/plugins/db2/src/net/sourceforge/squirrel_sql/plugins/db2/types/DB2XmlTypeDataTypeComponent.java | |||
Method name: Object readResultSet(ResultSet, int, boolean)
|
Method name: Object readResultSet(ResultSet, int, boolean)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | Object result = null;↵ | 1 | String result = null;↵ | |
2 | try↵ | 2 | try↵ | |
3 | {↵ | 3 | {↵ | |
4 | result = rs.getString(idx);↵ | 4 | result = rs.getString(idx);↵ | |
5 | if (result == null || "".equals(result))↵ | 5 | if (r↵ | |
6 | {↵ | 6 | s.wasNull() || result == null) {↵ | |
7 | return NULL_VALUE_PATTERN;↵ | 7 | return NULL_VALUE_PATTERN;↵ | |
8 | } ↵ | 8 | }↵ | |
9 | } catch (Exception e) {↵ | 9 | } catch (Exception e) {↵ | |
10 | s_log.error("Unexpected exception while attempting to read PostgreSQL XML↵ | 10 | s_log.error("Unexpected exception while attempting to read "↵ | |
11 | column", e);↵ | 11 | + "SYS.XMLType column", e);↵ | |
12 | }↵ | 12 | }↵ | |
13 | if (result == null)↵ | 13 | if (result == null)↵ | |
14 | {↵ | 14 | {↵ | |
15 | result = i18n.CELL_ERROR_MSG;↵ | 15 | result = i18n.CELL_ERROR_MSG;↵ | |
16 | }↵ | 16 | }↵ | |
17 | return result; | 17 |
| |
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 16 |
Number of mapped statements | 4 |
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) | 10.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | String result = null; | |||||||||||||||||
1 | Object result = null; | | |||||||||||||||||
2 | try |
| 2 | try | |||||||||||||||
|
| 3 | result = rs.getString(idx); | ||||||||||||||||
3 | result = rs.getString(idx); |
| | ||||||||||||||||
4 | if (result == null || "".equals(result)) |
| 4 | if (rs.wasNull() || result == null) | |||||||||||||||
5 | return NULL_VALUE_PATTERN; | 5 | return NULL_VALUE_PATTERN; | ||||||||||||||||
6 | if (result == null) |
| 6 | if (result == null) | |||||||||||||||
|
| 7 | result = i18n.CELL_ERROR_MSG; | ||||||||||||||||
7 | result = i18n.CELL_ERROR_MSG; |
| | ||||||||||||||||
|
| 8 | return result; | ||||||||||||||||
8 | return result; |
| |
Row | Violation |
---|---|
1 | Unmatched statement result=rs.getString(idx); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement result=rs.getString(idx); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Expression result == null || "".equals(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression rs.wasNull() || result == null cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type java.lang.Object of variable result does not match with type java.lang.String of variable result |
6 | Unmatched statement result=i18n.CELL_ERROR_MSG; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement result=i18n.CELL_ERROR_MSG; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched return result; |
9 | Unmatched return result; |
10 | Not all possible execution flows end in a return statement |