public abstract class AbstractSQLPanelAction extends SquirrelAction implements ISQLPanelAction { /** Current sql panel */ protected ISQLPanelAPI _panel; public AbstractSQLPanelAction(IApplication app, Resources rsrc) { super(app, rsrc); } public void actionPerformed(ActionEvent evt) { if (_panel != null) { try { getCommand().execute(); } catch (Exception e) { _panel.getSession().showMessage(e); } } } protected abstract ICommand getCommand(); /** * Set the current sql panel. * * @param panel The current sql panel. */ public void setSQLPanel(ISQLPanelAPI panel) { _panel = panel; setEnabled(_panel != null)
public abstract class AbstractSessionAction extends SquirrelAction implements ISessionAction { /** Current session. */ protected ISession _session; public AbstractSessionAction(IApplication app, Resources rsrc) { super(app, rsrc); } public void actionPerformed(ActionEvent evt) { if (_session != null) { try { getCommand().execute(); } catch (Exception e) { _session.showMessage(e); } } } protected abstract ICommand getCommand(); /** * Set the current session. * * @param session The current session. */ public void setSession(ISession session) { _session = session; setEnabled(_session != null)
Clone fragments detected by clone detection tool
File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/actions/AbstractSQLPanelAction.java File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/actions/AbstractSessionAction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public abstract class AbstractSQLPanelAction extends SquirrelAction implements ISQLPanelAction {
1
public abstract class AbstractSessionAction extends SquirrelAction implements ISessionAction {
2
    /** Current sql panel */
2
    /** Current session. */
3
    protected ISQLPanelAPI _panel;
3
    protected ISession _session;
4
    public AbstractSQLPanelAction(IApplication app, Resources rsrc) {
4
    public AbstractSessionAction(IApplication app, Resources rsrc) {
5
        super(app, rsrc);
5
        super(app, rsrc);
6
    }
6
    }
7
    public void actionPerformed(ActionEvent evt) {
7
    public void actionPerformed(ActionEvent evt) {
8
        if (_panel != null) {
8
        if (_session != null) {
9
            try {
9
            try {
10
                getCommand().execute();
10
                getCommand().execute();
11
            } catch (Exception e) {
11
            } catch (Exception e) {
12
                _panel.getSession().showMessage(e);
12
                _session.showMessage(e);
13
            }
13
            }
14
        }
14
        }
15
    }
15
    }
16
    protected abstract ICommand getCommand();
16
    protected abstract ICommand getCommand();
17
    /**
17
    /**
18
     * Set the current sql panel.
18
     * Set the current session.
19
     *
19
     *
20
     * @param panel The current sql panel.
20
     * @param session The current session.
21
     */
21
     */
22
    public void setSQLPanel(ISQLPanelAPI panel) {
22
    public void setS
23
        _panel = panel
23
ession(ISession session) {
24
;
24
        _session = session;
25
        setEnabled(_panel != null)
25
        setEnabled(_session != null)
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0