File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java | |||
Method name: void commit()
|
Method name: void rollback()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | try↵ | 1 | try↵ | |
2 | {↵ | 2 | {↵ | |
3 | getSQLConnection().commit();↵ | 3 | getSQLConnection().rollback();↵ | |
4 | final String msg = s_stringMgr.getString("Session.commit");↵ | 4 | final String msg = s_stringMgr.getString("Session.rollback");↵ | |
5 | _msgHandler.showMessage(msg);↵ | 5 | _msgHandler.showMessage(msg);↵ | |
6 | }↵ | 6 | }↵ | |
7 | catch (Throwable ex)↵ | 7 | catch (Exception ex)↵ | |
8 | {↵ | 8 | {↵ | |
9 | _msgHandler.showErrorMessage(ex, formatter);↵ | 9 | _msgHandler.showErrorMessage(ex, formatter);↵ | |
10 | } | 10 |
| |
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 | 16 |
Number of mapped statements | 4 |
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) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | try |
| 1 | try | ||||||||||||||||
2 | getSQLConnection().commit(); |
| 2 | getSQLConnection().rollback(); | ||||||||||||||||
3 | final String msg = s_stringMgr.getString("Session.commit"); |
| 3 | final String msg = s_stringMgr.getString("Session.rollback"); | ||||||||||||||||
4 | _msgHandler.showMessage(msg); | 4 | _msgHandler.showMessage(msg); |
Row | Violation |
---|---|
1 | Expression getSQLConnection().commit() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression getSQLConnection().rollback() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
3 | Expression getSQLConnection().commit() is a void method call, and thus it cannot be parameterized |
4 | Expression getSQLConnection().rollback() is a void method call, and thus it cannot be parameterized |