File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/SQLDatabaseMetaData.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/SQLDatabaseMetaData.java | |||
Method name: IDataSet getPrimaryKey(ITableInfo, int[], boolean)
|
Method name: ResultSetDataSet getIndexInfo(ITableInfo, int[], boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | ResultSet rs = null;↵ | 1 | ResultSet rs = null;↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | rs = privateGetJDBCMetaData().getPrimaryKeys(ti.getCatalogName(),↵ | 3 | rs = privateGetJDBCMetaData().getIndexInfo(ti.getCatalogName(),↵ | |
4 | ti.getSchemaName(),↵ | 4 | ti.getSchemaName(),↵ | |
5 | ti.getSimpleName()↵ | 5 | ti.getSimpleName(),↵ | |
6 | false,↵ | |||
6 | );↵ | 7 | true);↵ | |
7 | ResultSetDataSet rsds = new ResultSetDataSet();↵ | 8 | ResultSetDataSet rsds = new ResultSetDataSet();↵ | |
8 | rsds.setResultSet(rs,↵ | 9 | rsds.setResultSet(rs,↵ | |
9 | columnIndices,↵ | 10 | columnIndices,↵ | |
10 | computeWidths,↵ | 11 | computeWidths,↵ | |
11 | DialectFactory.getDialectType(this));↵ | 12 | DialectFactory.getDialectType(this));↵ | |
12 | return rsds;↵ | 13 | return rsds;↵ | |
13 | } catch (SQLException e) {↵ | 14 | } catch (SQLException e) {↵ | |
14 | throw new DataSetException(e);↵ | 15 | throw new DataSetException(e);↵ | |
15 | } finally {↵ | 16 | } finally {↵ | |
16 | SQLUtilities.closeResultSet(rs);↵ | 17 | SQLUtilities.closeResultSet(rs);↵ | |
17 | } | 18 |
| |
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 declared in the same class |
Number of node comparisons | 26 |
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) | 4.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ResultSet rs = null; | 1 | ResultSet rs = null; | ||||||||||||||||||
2 | try | 2 | try | ||||||||||||||||||
3 | rs = privateGetJDBCMetaData().getPrimaryKeys(ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName()); |
| 3 | rs = privateGetJDBCMetaData().getIndexInfo(ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(), false, true); | |||||||||||||||||
4 | ResultSetDataSet rsds = new ResultSetDataSet(); | 4 | ResultSetDataSet rsds = new ResultSetDataSet(); | ||||||||||||||||||
5 | rsds.setResultSet(rs, columnIndices, computeWidths, DialectFactory.getDialectType(this)); | 5 | rsds.setResultSet(rs, columnIndices, computeWidths, DialectFactory.getDialectType(this)); | ||||||||||||||||||
6 | return rsds; | 6 | return rsds; |
Row | Violation |
---|---|
1 | Expression privateGetJDBCMetaData().getPrimaryKeys(ti.getCatalogName(),ti.getSchemaName(),ti.getSimpleName()) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression privateGetJDBCMetaData().getIndexInfo(ti.getCatalogName(),ti.getSchemaName(),ti.getSimpleName(),false,true) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
3 | Expression privateGetJDBCMetaData().getPrimaryKeys(ti.getCatalogName(),ti.getSchemaName(),ti.getSimpleName()) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
4 | Expression privateGetJDBCMetaData().getIndexInfo(ti.getCatalogName(),ti.getSchemaName(),ti.getSimpleName(),false,true) is a method call throwing exception(s) that should be caught by a try block that will be extracted |