File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java | File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java | |||
Method name: String bindClobVar(PreparedStatement, int, ResultSet, int)
|
Method name: String bindBlobVar(PreparedStatement, int, ResultSet, int)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | String result = "null";↵ | 1 | String result = "null";↵ | |
2 | if (_prefs.isUseFileCaching())↵ | 2 | if (_prefs.isUseFileCaching())↵ | |
3 | {↵ | 3 | {↵ | |
4 | try↵ | 4 | try↵ | |
5 | {↵ | 5 | {↵ | |
6 | bindClobVarInFile(ps, index, rs, type);↵ | 6 | bindBlobVarInFile(ps, index, rs, type);↵ | |
7 | } catch (Exception e)↵ | 7 | } catch (Exception e)↵ | |
8 | {↵ | 8 | {↵ | |
9 | // i18n[DBUtil.error.bindclobfailure=bindBlobVar: failed to↵ | 9 | // i18n[DBUtil.error.bindblobfailure=bindBlobVar: failed to↵ | |
10 | // bind blob using filesystem - attempting to bind blob using↵ | 10 | // bind blob using filesystem - attempting to bind blob using↵ | |
11 | // memory]↵ | 11 | // memory]↵ | |
12 | String msg = s_stringMgr.getString("DBUtil.error.bindclobfailure");↵ | 12 | String msg = s_stringMgr.getString("DBUtil.error.bindblobfailure");↵ | |
13 | log.error(msg, e);↵ | 13 | log.error(msg, e);↵ | |
14 | // if we failed to bind the blob in a file, try memory.↵ | 14 | // if we failed to bind the blob in a file, try memory.↵ | |
15 | result = bindClobVarInMemory(ps, index, rs, type);↵ | 15 | result = bindBlobVarInMemory(ps, index, rs, type);↵ | |
16 | }↵ | 16 | }↵ | |
17 | } else↵ | 17 | } else↵ | |
18 | {↵ | 18 | {↵ | |
19 | result = bindClobVarInMemory(ps, index, rs, type);↵ | 19 | result = bindBlobVarInMemory(ps, index, rs, type);↵ | |
20 | }↵ | 20 | }↵ | |
21 | return result; | 21 |
| |
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 12 |
Number of mapped statements | 6 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String result = "null"; | 1 | String result = "null"; | |||||||||||||||
2 | if (_prefs.isUseFileCaching()) | 2 | if (_prefs.isUseFileCaching()) | |||||||||||||||
3 | try |
| 3 | try | ||||||||||||||
4 | bindClobVarInFile(ps, index, rs, type); |
| 4 | bindBlobVarInFile(ps, index, rs, type); | ||||||||||||||
else | else | |||||||||||||||||
5 | result = bindClobVarInMemory(ps, index, rs, type); |
| 5 | result = bindBlobVarInMemory(ps, index, rs, type); | ||||||||||||||
6 | return result; | 6 | return result; |
Row | Violation |
---|---|
1 | Expression bindClobVarInFile(ps,index,rs,type) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression bindBlobVarInFile(ps,index,rs,type) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression bindClobVarInFile(ps,index,rs,type) is a void method call, and thus it cannot be parameterized |
4 | Expression bindBlobVarInFile(ps,index,rs,type) is a void method call, and thus it cannot be parameterized |
5 | Expression bindClobVarInMemory(ps,index,rs,type) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
6 | Expression bindBlobVarInMemory(ps,index,rs,type) is a method call throwing exception(s) that should be caught by a try block that will be extracted |