File path: /sql12/plugins/sqlval/src/net/sourceforge/squirrel_sql/plugins/sqlval/cmd/DisconnectCommand.java | File path: /sql12/plugins/sqlval/src/net/sourceforge/squirrel_sql/plugins/sqlval/cmd/ConnectCommand.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | try↵ | 1 | try↵ | |
2 | {↵ | 2 | {↵ | |
3 | final WebServiceSession wss = _sessionProps.getWebServiceSession();↵ | 3 | final WebServiceSession wss = _sessionProps.getWebServiceSession();↵ | |
4 | if (wss.isOpen())↵ | 4 | if (!wss.isOpen())↵ | |
5 | {↵ | 5 | {↵ | |
6 | wss.close();↵ | 6 | wss.open();↵ | |
7 | // i18n[sqlval.disconnected=Disconnected from the SQL Validation web service]↵ | 7 | // i18n[sqlval.connected=Connected to the SQL Validation web service]↵ | |
8 | _session.showMessage(s_stringMgr.getString("sqlval.disconnected"));↵ | 8 | _session.showMessage(s_stringMgr.getString("sqlval.connected"));↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | catch (Throwable th)↵ | 11 | catch (Throwable th)↵ | |
12 | {↵ | 12 | {↵ | |
13 | throw new BaseException(th);↵ | 13 | throw new BaseException(th);↵ | |
14 | } | 14 |
| |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 5 |
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) | 6.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | try | 1 | try | |||||||||||||||
2 | final WebServiceSession wss = _sessionProps.getWebServiceSession(); | 2 | final WebServiceSession wss = _sessionProps.getWebServiceSession(); | |||||||||||||||
3 | if (wss.isOpen()) |
| 3 | if (!wss.isOpen()) | ||||||||||||||
4 | wss.close(); |
| 4 | wss.open(); | ||||||||||||||
5 | _session.showMessage(s_stringMgr.getString("sqlval.disconnected")); |
| 5 | _session.showMessage(s_stringMgr.getString("sqlval.connected")); |
Row | Violation |
---|---|
1 | Expression wss.isOpen() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression !wss.isOpen() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression wss.close() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression wss.open() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression wss.close() is a void method call, and thus it cannot be parameterized |
6 | Expression wss.open() is a void method call, and thus it cannot be parameterized |