class FormatSQLAction extends SquirrelAction implements ISQLPanelAction { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(FormatSQLAction.class); /** Logger for this class. */ private static final ILogger s_log = LoggerController.createLogger(FormatSQLAction.class); /** Current session. */ private ISession _session; private EditExtrasPlugin _plugin; FormatSQLAction(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 FormatSQLCommand(_session, _plugin).execute(); } catch (Throwable ex) { // i18n[editextras.errorProcessingFormat=Error processing Format SQL command: {0}] final String msg = s_stringMgr.getString("editextras.errorProcessingFormat", ex); _session.showErrorMessage(msg); s_log.error(msg, ex)
class RemoveQuotesAction 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(RemoveQuotesAction.class); /** Current session. */ private ISession _session; private EditExtrasPlugin _plugin; RemoveQuotesAction(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 RemoveQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute(); new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); } catch (Throwable ex) { // i18n[editextras.errorRemoveQuotes=Error processing Remove Quotes SQL command: {0}] final String msg = s_stringMgr.getString("editextras.errorRemoveQuotes", 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/FormatSQLAction.java File path: /sql12/plugins/editextras/src/net/sourceforge/squirrel_sql/plugins/editextras/RemoveQuotesAction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
class FormatSQLAction extends SquirrelAction
1
class RemoveQuotesAction 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.getStringManager(FormatSQLAction.class);
5
		StringManagerFactory.getStringManager(RemoveQuotesAction.class);
6
	/** Logger for this class. */
6
	/** Logger for this class. */
7
	private static final ILogger s_log =
7
	private static final ILogger s_log =
8
		LoggerController.createLogger(FormatSQLAction.class);
8
		LoggerController.createLogger(RemoveQuotesAction.class);
9
	/** Current session. */
9
	/** Current session. */
10
	private ISession _session;
10
	private ISession _session;
11
	private EditExtrasPlugin _plugin;
11
	private EditExtrasPlugin _plugin;
12
	FormatSQLAction(IApplication app, EditExtrasPlugin plugin)
12
	RemoveQuotesAction(IApplication app, EditExtrasPlugin plugin)
13
	{
13
	{
14
		super(app, plugin.getResources());
14
		super(app, plugin.getResources());
15
		_plugin = plugin;
15
		_plugin = plugin;
16
	}
16
	}
17
   
18
   public void setSQLPanel(ISQLPanelAPI panel)
17
   public void setSQLPanel(ISQLPanelAPI panel)
19
   {
18
   {
20
      if(null != panel)
19
      if(null != panel)
21
      {
20
      {
22
         _session = panel.getSession();
21
         _session = panel.getSession();
23
      }
22
      }
24
      else
23
      else
25
      {
24
      {
26
         _session = null;
25
         _session = null;
27
      }
26
      }
28
      setEnabled(null != _session);
27
      setEnabled(null != _session);
29
   }
28
   }
30
	public void actionPerformed(ActionEvent evt)
29
	public void actionPerformed(ActionEvent evt)
31
	{
30
	{
32
		if (_session != null)
31
		if (_session != null)
33
		{
32
		{
34
			try
33
			try
35
			{
34
			{
36
				new FormatSQLCommand
35
				//new RemoveQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute();
37
(_session, _plugin).execute();
36
				new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();
38
			}
37
			}
39
			catch (Throwable ex)
38
			catch (Throwable ex)
40
			{
39
			{
41
				// i18n[editextras.errorProcessingFormat=Error processing Format SQL command: {0}]
40
				// i18n[editextras.errorRemoveQuotes=Error processing Remove Quotes SQL command: {0}]
42
				final String msg = s_stringMgr.getString("editextras.errorProcessingFormat", ex);
41
				final String msg = s_stringMgr.getString("editextras.errorRemoveQuotes", ex);
43
				_session.showErrorMessage(msg);
42
				_session.showErrorMessage(msg);
44
				s_log.error(msg, ex)
43
				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