File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeUnknown.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeOther.java | |||
Method name: Object readResultSet(ResultSet, int, boolean)
|
Method name: Object readResultSet(ResultSet, int, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | String data = null;↵ | 1 | String data = null;↵ | |
2 | if (_readUnknown)↵ | 2 | if (_readSQLOther)↵ | |
3 | {↵ | 3 | {↵ | |
4 | // Running getObject on a java class attempts↵ | 4 | // Running getObject on a java class attempts↵ | |
5 | // to load the class in memory which we don't want.↵ | 5 | // to load the class in memory which we don't want.↵ | |
6 | // getString() just gets the value without loading↵ | 6 | // getString() just gets the value without loading↵ | |
7 | // the class (at least under PostgreSQL).↵ | 7 | // the class (at least under PostgreSQL).↵ | |
8 | //row[i] = _rs.getObject(index);↵ | 8 | //row[i] = _rs.getObject(index);↵ | |
9 | data = rs.getString(index);↵ | 9 | data = rs.getString(index);↵ | |
10 | }↵ | 10 | }↵ | |
11 | else↵ | 11 | else↵ | |
12 | {↵ | 12 | {↵ | |
13 | data = s_stringMgr.getString("DataTypeUnknown.unknown",↵ | 13 | data = s_stringMgr.getString("DataType↵ | |
14 | _colDef.getSqlType() );↵ | 14 | Other.other");↵ | |
15 | }↵ | 15 | }↵ | |
16 | ↵ | 16 | ↵ | |
17 | if (rs.wasNull())↵ | 17 | if (rs.wasNull())↵ | |
18 | return null;↵ | 18 | return null;↵ | |
19 | else return data; | 19 |
| |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 29 |
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) | 20.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String data = null; | 1 | String data = null; | |||||||||||||
2 | if (_readUnknown) |
| 2 | if (_readSQLOther) | ||||||||||||
3 | data = rs.getString(index); | 3 | data = rs.getString(index); | |||||||||||||
else | else | |||||||||||||||
4 | data = s_stringMgr.getString("DataTypeUnknown.unknown", _colDef.getSqlType()); |
| 4 | data = s_stringMgr.getString("DataTypeOther.other"); | ||||||||||||
5 | if (rs.wasNull()) | 5 | if (rs.wasNull()) | |||||||||||||
6 | return null; | 6 | return null; | |||||||||||||
else | else | |||||||||||||||
7 | return data; | 7 | return data; |
Row | Violation |
---|---|
1 | Expression s_stringMgr.getString("DataTypeUnknown.unknown",_colDef.getSqlType()) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression s_stringMgr.getString("DataTypeOther.other") is a method call throwing exception(s) that should be caught by a try block that will be extracted |