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/AbstractSessionAction.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 (_session != null) { ↵ | |
2 | {↵ | 2 | ↵ | |
3 | try↵ | 3 | try↵ | |
4 | {↵ | 4 | { ↵ | |
5 | _conn.close();↵ | 5 | getCommand().execute(); ↵ | |
6 | }↵ | 6 | ↵ | |
7 | finally↵ | 7 | ↵ | |
8 | ↵ | 8 | } catch (Exception e) {↵ | |
9 | {↵ | 9 | ↵ | |
10 | _conn = null;↵ | 10 | _↵ | |
11 | session.showMessage(e);↵ | |||
11 | }↵ | 12 | }↵ | |
12 | } | 13 | } | |
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 (_session != 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.ISession of variable _session |
2 | Unmatched statement getCommand().execute(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | 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 |
4 | Unmatched statement _conn.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | 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 |
6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |