public class CreateTableScriptAction extends SquirrelAction implements IObjectTreeAction{ /** Current session. */ private ISession _session; /** Current plugin. */ private final SQLScriptPlugin _plugin; public CreateTableScriptAction(IApplication app, Resources rsrc, SQLScriptPlugin plugin) { super(app, rsrc); _plugin = plugin; } public void actionPerformed(ActionEvent evt) { if (_session != null) { new CreateTableScriptCommand(_session, _plugin).execute(); } } /** * Set the current session. * * @param session The current session. */ public void setSession(ISession session) { _session = session; } public void setObjectTree(IObjectTreeAPI tree) { if(null != tree) { _session = tree.getSession(); } else { _session = null; } setEnabled(null != _session)
public class DropTableScriptAction extends SquirrelAction implements IObjectTreeAction { /** Current session. */ private ISession _session; /** Current plugin. */ private final SQLScriptPlugin _plugin; public DropTableScriptAction(IApplication app, Resources rsrc, SQLScriptPlugin plugin) { super(app, rsrc); _plugin = plugin; } public void actionPerformed(ActionEvent evt) { if (_session != null) { new DropTableScriptCommand(_session, _plugin).execute(); } } /** * Set the current session. * * @param session The current session. */ public void setSession(ISession session) { _session = session; } public void setObjectTree(IObjectTreeAPI tree) { if(null != tree) { _session = tree.getSession(); } else { _session = null; } setEnabled(null != _session)
Clone fragments detected by clone detection tool
File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableScriptAction.java File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/DropTableScriptAction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class CreateTableScriptAction 
1
public class DropTableScriptAction 
2
    extends SquirrelAction
2
extends SquirrelAction
3
    implements IObjectTreeAction{
3
                                   implements IObjectTreeAction {
4
	/** Current session. */
4
	/** Current session. */
5
    private ISession _session;
5
    private ISession _session;
6
	/** Current plugin. */
6
	/** Current plugin. */
7
	private final SQLScriptPlugin _plugin;
7
	private final SQLScriptPlugin _plugin;
8
    public CreateTableScriptAction(IApplication app, Resources rsrc,
8
    public DropTableScriptAction(IApplication app, Resources rsrc,
9
    									SQLScriptPlugin plugin) {
9
    									SQLScriptPlugin plugin) {
10
        super(app, rsrc);
10
        super(app, rsrc);
11
        _plugin = plugin;
11
        _plugin = plugin;
12
    }
12
    }
13
    public void actionPerformed(ActionEvent evt) {
13
    public void actionPerformed(ActionEvent evt) {
14
        if (_session != null) {
14
        if (_session != null) {
15
            new CreateTableScriptCommand(_session, _plugin).execute();
15
            new DropTableScriptCommand(_session, _plugin).execute();
16
        }
16
        }
17
    }
17
    }
18
	/**
18
	/**
19
	 * Set the current session.
19
	 * Set the current session.
20
	 * 
20
	 * 
21
	 * @param	session		The current session.
21
	 * @param	session		The current session.
22
	 */
22
	 */
23
    public void setSession(ISession session) {
23
    public void setSession(ISession session) {
24
        _session = session;
24
        _session = session;
25
    }
25
    }
26
   public void setObjectTree(IObjectTreeAPI tree)
26
   public void setObjectTree(IObjectTreeAPI tree)
27
   {
27
   {
28
      if(null != tree)
28
      if(null != tree)
29
      {
29
      {
30
         _session = tree.getSession();
30
         _session = tree.getSession();
31
      }
31
      }
32
      else
32
      else
33
      {
33
      {
34
         _session = null;
34
         _session = null;
35
      }
35
      }
36
      setEnabled(null != _session)
36
      setEnabled(null != _session)
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