class ConvertToStringBufferAction extends SquirrelAction implements ISQLPanelAction { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(ConvertToStringBufferAction.class); /** Logger for this class. */ private static final ILogger s_log = LoggerController.createLogger(ConvertToStringBufferAction.class); /** Current session. */ private ISession _session; private EditExtrasPlugin _plugin; ConvertToStringBufferAction(IApplication app, EditExtrasPlugin plugin) { super(app, plugin.getResources()); _plugin = plugin; } public void setSQLPanel(ISQLPanelAPI panel) { if(null != panel) { _session = panel.getSession(); } else { _session = null; } setEnabled(null != _session); } public void actionPerformed(ActionEvent evt) { if (_session != null) { try { //new ConvertToStringBufferCommand(_session.getSQLPanelAPI(_plugin)).execute(); new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); } catch (Throwable ex) { // i18n[editextras.convertStringBufErr=Error executing convert to StringBuffer command: {0}] final String msg = s_stringMgr.getString("editextras.convertStringBufErr", ex); _session.showErrorMessage(msg); s_log.error(msg, ex)
class RemoveNewLinesAction extends SquirrelAction implements ISQLPanelAction { private static final StringManager s_stringMgr = StringManagerFactory .getStringManager(RemoveQuotesAction.class); /** Logger for this class. */ private static final ILogger s_log = LoggerController .createLogger(RemoveNewLinesAction.class); /** Current session. */ private ISession _session; private EditExtrasPlugin _plugin; RemoveNewLinesAction(IApplication app, EditExtrasPlugin plugin) { super(app, plugin.getResources()); _plugin = plugin; } public void setSQLPanel(ISQLPanelAPI panel) { if (null != panel) { _session = panel.getSession(); } else { _session = null; } setEnabled(null != _session); } public void actionPerformed(ActionEvent evt) { if (_session != null) { try { RemoveNewLinesCommand command = new RemoveNewLinesCommand( FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)); command.execute(); } catch (Throwable ex) { // i18n[editextras.errorRemoveNewLines=Error processing Remove // NewLines SQL command: {0}] final String msg = s_stringMgr.getString( "editextras.errorRemoveNewLines", ex); _session.showErrorMessage(msg); s_log.error(msg, ex)
Clone fragments detected by clone detection tool
File path: /sql12/plugins/editextras/src/net/sourceforge/squirrel_sql/plugins/editextras/ConvertToStringBufferAction.java File path: /sql12/plugins/editextras/src/net/sourceforge/squirrel_sql/plugins/editextras/RemoveNewLlinesAction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
class ConvertToStringBufferAction extends SquirrelAction
1
class RemoveNewLinesAction extends SquirrelAction
2
					implements ISQLPanelAction
2
 implements ISQLPanelAction
3
{
3
 {
4
	private static final StringManager s_stringMgr =
4
    private static final StringManager s_stringMgr =
5
		StringManagerFactory
5
 StringManagerFactory
6
.getStringManager(ConvertToStringBufferAction.class);
6
            .getStringManager(RemoveQuotesAction.class);
7
	/** Logger for this class. */
7
    /** Logger for this class. */
8
	private static final ILogger s_log =
8
    private static final ILogger s_log =
9
		LoggerController
9
 LoggerController
10
.createLogger(ConvertToStringBufferAction.class);
10
            .createLogger(RemoveNewLinesAction.class);
11
	/** Current session. */
11
    /** Current session. */
12
	private ISession _session;
12
    private ISession _session;
13
	private EditExtrasPlugin _plugin;
13
    private EditExtrasPlugin _plugin;
14
	ConvertToStringBufferAction(IApplication app, EditExtrasPlugin plugin)
14
    RemoveNewLinesAction(IApplication app, EditExtrasPlugin plugin)
15
	{
16
		
15
 {
17
super(app, plugin.getResources());
16
        super(app, plugin.getResources());
18
		_plugin = plugin;
17
        _plugin = plugin;
19
	}
18
    }
20
   public void setSQLPanel(ISQLPanelAPI panel)
19
    public void setSQLPanel(ISQLPanelAPI panel)
21
   {
20
 {
22
      if(null != panel)
21
        if (null != panel)
23
   
22
 {
24
   {
23
   
25
         _session = panel.getSession();
24
         _session = panel.getSession();
26
      }
25
      
27
      else
28
      {
26
  } else {
29
         _session = null;
27
            _session = null;
30
      }
28
      
29
  }
31
      setEnabled(null != _session);
30
        setEnabled(null != _session);
32
   }
31
    }
33
	public void actionPerformed(ActionEvent evt)
32
    public void actionPerformed(ActionEvent evt)
34
	{
35
		
33
 {
36
if (_session != null)
34
        if (_session != null)
37
		{
38
			try
39
			{
40
				//new ConvertToStringBufferCommand(_session.getSQLPanelAPI(_plugin)).execute();
41
				new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();
42
			}
43
			
35
 {
36
            try {
37
                RemoveNewLinesCommand command = new RemoveNewLinesCommand(
38
                        FrameWorkAcessor.getSQLPanelAPI(_session, _plugin));
39
                command.execute();
44
catch (Throwable ex)
40
            } catch (Throwable ex)
45
			{
46
				// i18n[editextras.convertStringBufErr=Error executing convert to StringBuffer command: {0}]
47
				
41
 {
42
                // i18n[editextras.errorRemoveNewLines=Error processing Remove
43
                // NewLines SQL command: {0}]
48
final String msg = s_stringMgr.getString("editextras.convertStringBufErr", ex);
44
                final String msg = s_stringMgr.getString(
49
				
45
                        "editextras.errorRemoveNewLines", ex);
50
_session.showErrorMessage(msg);
46
                _session.showErrorMessage(msg);
51
				s_log.error(msg, ex)
47
                s_log.error(msg, ex)
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