class InQuotesAction extends SquirrelAction implements ISQLPanelAction { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(InQuotesAction.class); /** Logger for this class. */ private static final ILogger s_log = LoggerController.createLogger(InQuotesAction.class); /** Current session. */ private ISession _session; private EditExtrasPlugin _plugin; InQuotesAction(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 InQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute(); new InQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); } catch (Throwable ex) { // i18n[editextras.errorQuoteSql=Error processing Quote SQL command: {0}] final String msg = s_stringMgr.getString("editextras.errorQuoteSql", 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/InQuotesAction.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 InQuotesAction 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(InQuotesAction.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(InQuotesAction.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
	InQuotesAction(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
         _session = panel.getSession();
23
         _session = panel.getSession();
25
      }
24
      
26
      else
25
  } else
27
   
26
 {
28
   {
27
   
29
         _session = null;
28
         _session = null;
30
      }
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 InQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute();
41
				new InQuotesCommand(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
				
41
 {
47
// i18n[editextras.errorQuoteSql=Error processing Quote
42
                // i18n[editextras.errorRemoveNewLines=Error processing Remove
48
 SQL command: {0}]
43
                // NewLines SQL command: {0}]
49
				final String msg = s_stringMgr.getString("editextras.errorQuoteSql", ex);
44
                final String msg = s_stringMgr.getString(
50
				
45
                        "editextras.errorRemoveNewLines", ex);
51
_session.showErrorMessage(msg);
46
                _session.showErrorMessage(msg);
52
				s_log.error(msg, ex);
47
                s_log.error(msg, ex);
53
			
48
            
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