File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/WindowManager.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/WindowManager.java | |||
Method name: void activateNextSessionWindow()
|
Method name: void activatePreviousSessionWindow()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | final SessionManager sessMgr = _app.getSessionManager();↵ | 1 | final SessionManager sessMgr = _app.getSessionManager();↵ | |
2 | final ISession sess = sessMgr.getActiveSession();↵ | 2 | final ISession sess = sessMgr.getActiveSession();↵ | |
3 | if (sess == null)↵ | 3 | if (sess == null)↵ | |
4 | {↵ | 4 | {↵ | |
5 | return;↵ | 5 | return;↵ | |
6 | }↵ | 6 | }↵ | |
7 | ISessionWidget activeSessionWindow = sess.getActiveSessionWindow();↵ | 7 | ISessionWidget activeSessionWindow = sess.getActiveSessionWindow();↵ | |
8 | if(null == activeSessionWindow)↵ | 8 | if(null == activeSessionWindow)↵ | |
9 | {↵ | 9 | {↵ | |
10 | throw new IllegalStateException("Active Session with no active window ???");↵ | 10 | throw new IllegalStateException("Active Session with no active window ???");↵ | |
11 | }↵ | 11 | }↵ | |
12 | ISessionWidget nextSessionWindow = _sessionWindows.getNextSessionWindow(activeSessionWindow);↵ | 12 | ISessionWidget previousSessionWindow = _sessionWindows.getPreviousSessionWindow(activeSessionWindow);↵ | |
13 | if (false == activeSessionWindow.equals(nextSessionWindow))↵ | 13 | if (false == activeSessionWindow.equals(previousSessionWindow))↵ | |
14 | {↵ | |||
15 | ↵ | 14 | {↵ | |
16 | new SelectWidgetCommand(nextSessionWindow).execute();↵ | 15 | new SelectWidgetCommand(previousSessionWindow).execute();↵ | |
17 | } | 16 | } | |
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 37 |
Number of mapped statements | 10 |
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.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final SessionManager sessMgr = _app.getSessionManager(); | 1 | final SessionManager sessMgr = _app.getSessionManager(); | ||||||||||||||||
2 | final ISession sess = sessMgr.getActiveSession(); | 2 | final ISession sess = sessMgr.getActiveSession(); | ||||||||||||||||
3 | if (sess == null) | 3 | if (sess == null) | ||||||||||||||||
4 | return; | 4 | return; | ||||||||||||||||
5 | ISessionWidget activeSessionWindow = sess.getActiveSessionWindow(); | 5 | ISessionWidget activeSessionWindow = sess.getActiveSessionWindow(); | ||||||||||||||||
6 | if (null == activeSessionWindow) | 6 | if (null == activeSessionWindow) | ||||||||||||||||
7 | throw new IllegalStateException("Active Session with no active window ???"); | 7 | throw new IllegalStateException("Active Session with no active window ???"); | ||||||||||||||||
8 | ISessionWidget nextSessionWindow = _sessionWindows.getNextSessionWindow(activeSessionWindow); |
| 8 | ISessionWidget previousSessionWindow = _sessionWindows.getPreviousSessionWindow(activeSessionWindow); | |||||||||||||||
9 | if (false == activeSessionWindow.equals(nextSessionWindow)) |
| 9 | if (false == activeSessionWindow.equals(previousSessionWindow)) | |||||||||||||||
10 | new SelectWidgetCommand(nextSessionWindow).execute(); |
| 10 | new SelectWidgetCommand(previousSessionWindow).execute(); |
Row | Violation |
---|---|
1 | Expression _sessionWindows.getNextSessionWindow(activeSessionWindow) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression _sessionWindows.getPreviousSessionWindow(activeSessionWindow) cannot be parameterized, because it has dependencies to/from statements that will be extracted |