public class CreateSelectScriptAction extends SquirrelAction implements IObjectTreeAction { /** * Current session. */ private ISession _session; /** * Current plugin. */ private final SQLScriptPlugin _plugin; public CreateSelectScriptAction(IApplication app, Resources rsrc, SQLScriptPlugin plugin) { super(app, rsrc); _plugin = plugin; } public void actionPerformed(ActionEvent evt) { if (_session != null) { new CreateSelectScriptCommand(_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/CreateSelectScriptAction.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 CreateSelectScriptAction extends SquirrelAction
1
public class DropTableScriptAction extends SquirrelAction
2
  implements IObjectTreeAction
2
                                   implements IObjectTreeAction
3
{
3
 {
4
   /**
5
    * Current session.
4
	/** Current session.
6
    */
5
 */
7
   private ISession _session;
6
    private ISession _session;
8
   /**
9
    * Current plugin.
7
	/** Current plugin.
10
    */
8
 */
11
   private final SQLScriptPlugin _plugin;
9
	private final SQLScriptPlugin _plugin;
12
   public CreateSelectScriptAction(IApplication app, Resources rsrc, 
10
    public DropTableScriptAction(IApplication app, Resources rsrc,
13
SQLScriptPlugin plugin)
11
    									SQLScriptPlugin plugin)
14
   {
12
 {
15
      super(app, rsrc);
13
        super(app, rsrc);
16
      _plugin = plugin;
14
        _plugin = plugin;
17
   }
15
    }
18
   public void actionPerformed(ActionEvent evt)
16
    public void actionPerformed(ActionEvent evt)
19
   {
17
 {
20
      if (_session != null)
18
        if (_session != null) {
21
      {
19
   
22
         new CreateSelectScriptCommand(_session, _plugin).execute();
20
         new DropTableScriptCommand(_session, _plugin).execute();
23
      }
21
        }
24
   }
22
    }
25
   /**
23
	/**
26
    * Set the current session.
24
	 * Set the current session.
27
    *
28
   
25
	 * 
29
 * @param   session      The current session.
26
	 * @param	session		The current session.
30
    */
27
	 */
31
   public void setSession(ISession session)
28
    public void setSession(ISession session) {
32
   {
29
  
33
      _session = session;
30
      _session = session;
34
   }
31
    }
35
   public void setObjectTree(IObjectTreeAPI tree)
32
   public void setObjectTree(IObjectTreeAPI tree)
36
   {
33
   {
37
      if (null != tree)
34
      if(null != tree)
38
      {
35
      {
39
         _session = tree.getSession();
36
         _session = tree.getSession();
40
      }
37
      }
41
      else
38
      else
42
      {
39
      {
43
         _session = null;
40
         _session = null;
44
      }
41
      }
45
      setEnabled(null != _session)
42
      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