File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/commands/DropTablesCommand.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/DeleteTablesCommand.java | |||
Method name: void initMatViewLookup(ISession, String)
|
Method name: void initMatViewLookup(ISession, String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | stmt = session.getSQLConnection().prepareStatement(sql);↵ | 1 | stmt = session.getSQLConnection().prepareStatement(sql);↵ | |
2 | stmt.setString(1, schema);↵ | 2 | stmt.setString(1, schema);↵ | |
3 | rs = stmt.executeQuery();↵ | 3 | rs = stmt.executeQuery();↵ | |
4 | if (rs.next())↵ | 4 | if (rs.next())↵ | |
5 | {↵ | 5 | {↵ | |
6 | final String tableName = rs.getString(1);↵ | 6 | String tableName = rs.getString(1);↵ | |
7 | matViewLookup.add(tableName);↵ | 7 | matViewLookup.add(tableName);↵ | |
8 | } | 8 |
| |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 19 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
6 | stmt = session.getSQLConnection().prepareStatement(sql); | 6 | stmt = session.getSQLConnection().prepareStatement(sql); | |||||
7 | stmt.setString(1, schema); | 7 | stmt.setString(1, schema); | |||||
8 | rs = stmt.executeQuery(); | 8 | rs = stmt.executeQuery(); | |||||
9 | if (rs.next()) | 9 | if (rs.next()) | |||||
|
| 10 | String tableName = rs.getString(1); | |||||
10 | final String tableName = rs.getString(1); |
| | |||||
11 | matViewLookup.add(tableName); | 11 | matViewLookup.add(tableName); |
Row | Violation |
---|---|
1 | Unmatched statement String tableName=rs.getString(1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement String tableName=rs.getString(1); 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 | Unmatched statement final String tableName=rs.getString(1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement final String tableName=rs.getString(1); 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 |
5 | Clone fragment #1 returns variables stmt, rs , while Clone fragment #2 returns variables rs |
6 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.refactoring.commands.DropTablesCommand and net.sourceforge.squirrel_sql.client.session.action.DeleteTablesCommand do not have a common superclass |