File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/FirebirdManagerPlugin.java | File path: /sql12/plugins/smarttools/src/net/sourceforge/squirrel_sql/plugins/smarttools/SmarttoolsPlugin.java | |||
Method name: PluginSessionCallback sessionStarted(ISession)
|
Method name: PluginSessionCallback sessionStarted(ISession)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | try {↵ | 1 | try {↵ | |
2 | // Add context menu items to the object tree's session node.↵ | 2 | // Add context menu items to the object tree's session node.↵ | |
3 | // as popup menu↵ | 3 | // as popup menu↵ | |
4 | IObjectTreeAPI objectTreeApi = session↵ | 4 | IObjectTreeAPI objectTreeApi = session↵ | |
5 | .getSessionInternalFrame()↵ | 5 | .getSessionInternalFrame()↵ | |
6 | .getObjectTreeAPI();↵ | 6 | .getObjectTreeAPI();↵ | |
7 | objectTreeApi.addToPopup(DatabaseObjectType.SESSION,↵ | 7 | objectTreeApi.addToPopup(DatabaseObjectType.SESSION,↵ | |
8 | getFirebirdManagerMenu(getApplication(), session, true));↵ | 8 | getSmarttoolsMenu(getApplication(), session, true));↵ | |
9 | return new PluginSessionCallback() {↵ | 9 | return new PluginSessionCallback() {↵ | |
10 | public void sqlInternalFrameOpened(↵ | 10 | public void sqlInternalFrameOpened(↵ | |
11 | SQLInternalFrame sqlInternalFrame, ISession sess) {↵ | 11 | SQLInternalFrame sqlInternalFrame, ISession sess) {↵ | |
12 | // plugin supports Session main window only↵ | 12 | // plugin supports Session main window only↵ | |
13 | }↵ | 13 | }↵ | |
14 | public void objectTreeInternalFrameOpened(↵ | 14 | public void objectTreeInternalFrameOpened(↵ | |
15 | ObjectTreeInternalFrame objectTreeInternalFrame,↵ | 15 | ObjectTreeInternalFrame objectTreeInternalFrame,↵ | |
16 | ISession sess) {↵ | 16 | ISession sess) {↵ | |
17 | // plugin supports Session main window only↵ | 17 | // plugin supports Session main window only↵ | |
18 | }↵ | 18 | }↵ | |
19 | };↵ | 19 | };↵ | |
20 | } catch (Exception e) {↵ | 20 | } catch (Exception e) {↵ | |
21 | throw new RuntimeException(e);↵ | 21 | throw new RuntimeException(e);↵ | |
22 | } | 22 | } | |
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 in different classes having the same super 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) | 11.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | try | 1 | try | |||||||||||||
3 | IObjectTreeAPI objectTreeApi = session.getSessionInternalFrame().getObjectTreeAPI(); | 2 | IObjectTreeAPI objectTreeApi = session.getSessionInternalFrame().getObjectTreeAPI(); | |||||||||||||
4 | objectTreeApi.addToPopup(DatabaseObjectType.SESSION, getFirebirdManagerMenu(getApplication(), session, true)); |
| 3 | objectTreeApi.addToPopup(DatabaseObjectType.SESSION, getSmarttoolsMenu(getApplication(), session, true)); | ||||||||||||
5 | return new PluginSessionCallback() {...}; | 4 | return new PluginSessionCallback() {...}; |
Row | Violation |
---|---|
1 | Expression getFirebirdManagerMenu(getApplication(),session,true) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression getSmarttoolsMenu(getApplication(),session,true) is a method call throwing exception(s) that should be caught by a try block that will be extracted |