File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java | File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/actions/AbstractSQLPanelAction.java | |||
Method name: void closeSQLConnection()
|
Method name: void actionPerformed(ActionEvent)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if (_conn != null)↵ | 1 | if (_panel != null) { ↵ | |
2 | {↵ | 2 | ↵ | |
3 | try↵ | 3 | try↵ | |
4 | {↵ | |||
5 | _conn.clos↵ | 4 | {↵ | |
6 | e();↵ | 5 | getCommand().execute(); ↵ | |
7 | }↵ | 6 | ↵ | |
8 | finally↵ | 7 | ↵ | |
9 | {↵ | |||
10 | _conn = null;↵ | |||
8 | } catch (Exception e) {↵ | |||
9 | _panel.getSession().showMessage(e);↵ | |||
11 | }↵ | 10 | ↵ | |
11 | }↵ | |||
12 | } | 12 | } | |
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 2 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (_conn != null) |
| 1 | if (_panel != null) | ||||||||||||||
| 2 | try | ||||||||||||||||
|
| 3 | getCommand().execute(); | |||||||||||||||
2 | try | | ||||||||||||||||
3 | _conn.close(); |
| |
Row | Violation |
---|---|
1 | Type net.sourceforge.squirrel_sql.fw.sql.SQLConnection of variable _conn does not match with type net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI of variable _panel |
2 | Unmatched statement getCommand().execute(); 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 _conn.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement _conn.close(); 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 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |