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: IObjectTreeAPI getObjectTreeAPIOfActiveSessionWindow()
|
Method name: ISQLPanelAPI getSQLPanelAPIOfActiveSessionWindow()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | IObjectTreeAPI objectTreeAPI;↵ | 1 | ISQLPanelAPI sqlPanelAPI;↵ | |
2 | if(_activeActiveSessionWindow instanceof SessionInternalFrame)↵ | 2 | if(_activeActiveSessionWindow instanceof SessionInternalFrame)↵ | |
3 | {↵ | 3 | {↵ | |
4 | objectTreeAPI = ((SessionInternalFrame)_activeActiveSessionWindow).getObjectTreeAPI();↵ | 4 | sqlPanelAPI = ((SessionInternalFrame)_activeActiveSessionWindow).getSQLPanelAPI();↵ | |
5 | }↵ | 5 | }↵ | |
6 | else if(_activeActiveSessionWindow instanceof ObjectTreeInternalFrame)↵ | 6 | else if(_activeActiveSessionWindow instanceof SQLInternalFrame)↵ | |
7 | {↵ | 7 | {↵ | |
8 | objectTreeAPI = ((ObjectTreeInternalFrame)_activeActiveSessionWindow).getObjectTreeAPI();↵ | 8 | sqlPanelAPI = ((SQLInternalFrame)_activeActiveSessionWindow).getSQLPanelAPI();↵ | |
9 | }↵ | 9 | }↵ | |
10 | else↵ | 10 | else↵ | |
11 | {↵ | 11 | {↵ | |
12 | throw new IllegalStateException("ObjectTreeApi can only be provided for SessionInternalFrame or ObjectTreeInternalFrame");↵ | 12 | throw new IllegalStateException("SQLPanelApi can only be provided for SessionInternalFrame or SQLInternalFrame");↵ | |
13 | }↵ | 13 | }↵ | |
14 | return objectTreeAPI; | 14 | return sqlPanelAPI; | |
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 24 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 9.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ISQLPanelAPI sqlPanelAPI; | ||||||||||||||
1 | IObjectTreeAPI objectTreeAPI; | | ||||||||||||||
2 | if (_activeActiveSessionWindow instanceof SessionInternalFrame) | 2 | if (_activeActiveSessionWindow instanceof SessionInternalFrame) | |||||||||||||
|
| 3 | sqlPanelAPI = ((SessionInternalFrame)_activeActiveSessionWindow).getSQLPanelAPI(); | |||||||||||||
3 | objectTreeAPI = ((SessionInternalFrame)_activeActiveSessionWindow).getObjectTreeAPI(); |
| | |||||||||||||
4 | else if (_activeActiveSessionWindow instanceof ObjectTreeInternalFrame) |
| 4 | else if (_activeActiveSessionWindow instanceof SQLInternalFrame) | ||||||||||||
|
| 5 | sqlPanelAPI = ((SQLInternalFrame)_activeActiveSessionWindow).getSQLPanelAPI(); | |||||||||||||
5 | objectTreeAPI = ((ObjectTreeInternalFrame)_activeActiveSessionWindow).getObjectTreeAPI(); |
| | |||||||||||||
else | else | |||||||||||||||
6 | throw new IllegalStateException("ObjectTreeApi can only be provided for SessionInternalFrame or ObjectTreeInternalFrame"); |
| 6 | throw new IllegalStateException("SQLPanelApi can only be provided for SessionInternalFrame or SQLInternalFrame"); | ||||||||||||
|
| 7 | return sqlPanelAPI; | |||||||||||||
7 | return objectTreeAPI; |
| |
Row | Violation |
---|---|
1 | Unmatched statement sqlPanelAPI=((SessionInternalFrame)_activeActiveSessionWindow).getSQLPanelAPI(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement objectTreeAPI=((SessionInternalFrame)_activeActiveSessionWindow).getObjectTreeAPI(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Expression _activeActiveSessionWindow instanceof ObjectTreeInternalFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression _activeActiveSessionWindow instanceof SQLInternalFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement sqlPanelAPI=((SQLInternalFrame)_activeActiveSessionWindow).getSQLPanelAPI(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement objectTreeAPI=((ObjectTreeInternalFrame)_activeActiveSessionWindow).getObjectTreeAPI(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched return sqlPanelAPI; |
8 | Unmatched return objectTreeAPI; |