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)
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/RemoveNewLlinesAction.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 RemoveNewLinesAction 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
5
		StringManagerFactory
6
            .getStringManager(RemoveQuotesAction.class);
6
.getStringManager(RemoveQuotesAction.class);
7
    
8
/** Logger for this class. */
7
	/** Logger for this class. */
9
    private static final ILogger s_log = 
8
	private static final ILogger s_log =
10
LoggerController
9
		LoggerController
11
            .createLogger(RemoveNewLinesAction.class);
10
.createLogger(RemoveQuotesAction.class);
12
    /** Current session. */
11
	/** Current session. */
13
    private ISession _session;
12
	private ISession _session;
14
    private EditExtrasPlugin _plugin;
13
	private EditExtrasPlugin _plugin;
15
    RemoveNewLinesAction(IApplication app, EditExtrasPlugin plugin) {
14
	RemoveQuotesAction(IApplication app, EditExtrasPlugin plugin)
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
         _session = null;
27
         _session = null;
29
        }
28
      }
30
        setEnabled(null != _session);
29
      setEnabled(null != _session);
31
    }
30
   }
32
    
33
public void actionPerformed(ActionEvent evt) {
31
	public void actionPerformed(ActionEvent evt)
34
        
32
	{
35
if (_session != null) {
33
		if (_session != null)
36
            try {
37
               
34
		{
35
			try
36
			{
38
 RemoveNewLinesCommand command = 
37
				//new RemoveQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute();
39
new RemoveNewLinesCommand(
38
				new RemoveQuotesCommand(
40
                        FrameWorkAcessor.getSQLPanelAPI(_session, _plugin));
39
FrameWorkAcessor.getSQLPanelAPI(_session, _plugin))
41
                command.execute();
42
            } 
40
.execute();
41
			}
43
catch (Throwable ex) {
42
			catch (Throwable ex)
44
                
43
			{
45
// i18n[editextras.errorRemoveNewLines=Error processing Remove
44
				// i18n[editextras.errorRemoveQuotes=Error processing Remove
46
                // NewLines SQL command: {0}]
45
 Quotes SQL command: {0}]
47
                final String msg = s_stringMgr.getString(
46
				final String msg = s_stringMgr.getString(
48
                        "editextras.errorRemoveNewLines", ex);
47
"editextras.errorRemoveQuotes", ex);
49
                _session.showErrorMessage(msg);
48
				_session.showErrorMessage(msg);
50
                s_log.error(msg, ex)
49
				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