public class ActivateIndexAction extends SquirrelAction implements ISessionAction { /** Current session. */ private ISession _session; /** Current plugin. */ private final IPlugin _plugin; /** * Ctor. * * @param app Application API. * @param rsrc Plugins resources. * @param plugin This plugin. * * @throws IllegalArgumentException * Thrown if a<TT>null</TT> <TT>IApplication</TT>, * <TT>Resources</TT> or <TT>IPlugin</TT> passed. */ public ActivateIndexAction(IApplication app, Resources rsrc, IPlugin plugin) { super(app, rsrc); if (app == null) { throw new IllegalArgumentException("IApplication == null"); } if (rsrc == null) { throw new IllegalArgumentException("Resources == null"); } if (plugin == null) { throw new IllegalArgumentException("IPlugin == null"); } _plugin = plugin; } public void actionPerformed(ActionEvent evt) { if (_session != null) { try { new AlterIndexCommand(_session, _plugin, true).execute(); } catch (Throwable th) { _session.showErrorMessage(th); } } } /** * Set the current session. * * @param session The current session. */ public void setSession(ISession session) { _session = session
public class AnalyzeTableAction extends SquirrelAction implements ISessionAction { /** Current session. */ private ISession _session; /** Current plugin. */ private final MysqlPlugin _plugin; /** * Ctor. * * @param app Application API. * @param rsrc Plugins resources. * @param plugin This plugin. * * @throws IllegalArgumentException * Thrown if a?<TT>null</TT> <TT>IApplication</TT>, * <TT>Resources</TT> or <TT>MysqlPlugin</TT> passed. * * @throws IllegalArgumentException * Thrown if an invalid <TT>checktype</TT> passed. */ public AnalyzeTableAction(IApplication app, Resources rsrc, MysqlPlugin plugin) { super(app, rsrc); if (app == null) { throw new IllegalArgumentException("IApplication == null"); } if (rsrc == null) { throw new IllegalArgumentException("Resources == null"); } if (plugin == null) { throw new IllegalArgumentException("MysqlPlugin == null"); } _plugin = plugin; } public void actionPerformed(ActionEvent evt) { if (_session != null) { try { new AnalyzeTableCommand(_session, _plugin).execute(); } catch (Throwable th) { _session.showErrorMessage(th); } } } /** * Set the current session. * * @param session The current session. */ public void setSession(ISession session) { _session = session
Clone fragments detected by clone detection tool
File path: /sql12/plugins/firebird/src/org/firebirdsql/squirrel/act/ActivateIndexAction.java File path: /sql12/plugins/mysql/src/net/sourceforge/squirrel_sql/plugins/mysql/action/AnalyzeTableAction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class ActivateIndexAction extends SquirrelAction implements ISessionAction 
1
public class AnalyzeTableAction extends SquirrelAction implements ISessionAction 
2
{
2
{
3
	/** Current session. */
3
	/** Current session. */
4
	private ISession _session;
4
	private ISession _session;
5
	/** Current plugin. */
5
	/** Current plugin. */
6
	private final IPlugin _plugin;
6
	private final MysqlPlugin _plugin;
7
	/**
7
	/**
8
	 * Ctor.
8
	 * Ctor.
9
	 *
9
	 *
10
	 * @param	app			Application API.
10
	 * @param	app			Application API.
11
	 * @param	rsrc		Plugins resources.
11
	 * @param	rsrc		Plugins resources.
12
	 * @param	plugin		This plugin.
12
	 * @param	plugin		This plugin.
13
	 *
13
	 *
14
	 * @throws	IllegalArgumentException
14
	 * @throws	IllegalArgumentException
15
	 * 			Thrown if a<TT>null</TT> <TT>IApplication</TT>,
15
	 * 			Thrown if a?<TT>null</TT> <TT>IApplication</TT>,
16
	 * 			<TT>Resources</TT> or <TT>IPlugin</TT> passed.
16
	 * 			<TT>Resources</TT> or <TT>MysqlPlugin</TT> passed.
17
	 */
17
	 *
18
	public ActivateIndex
18
	 * @throws	IllegalArgumentException
19
	 * 			Thrown if an invalid <TT>checktype</TT> passed.
20
	 */
19
Action(IApplication app, Resources rsrc,
21
	public AnalyzeTableAction(IApplication app, Resources rsrc,
20
							IPlugin plugin)
22
							MysqlPlugin plugin)
21
	{
23
	{
22
		super(app, rsrc);
24
		super(app, rsrc);
23
		if (app == null)
25
		if (app == null)
24
		{
26
		{
25
			throw new IllegalArgumentException("IApplication == null");
27
			throw new IllegalArgumentException("IApplication == null");
26
		}
28
		}
27
		if (rsrc == null)
29
		if (rsrc == null)
28
		{
30
		{
29
			throw new IllegalArgumentException("Resources == null");
31
			throw new IllegalArgumentException("Resources == null");
30
		}
32
		}
31
		if (plugin == null)
33
		if (plugin == null)
32
		{
34
		{
33
			throw new IllegalArgumentException("IPlugin == null");
35
			throw new IllegalArgumentException("MysqlPlugin == null");
34
		}
36
		}
35
		_plugin = plugin;
37
		_plugin = plugin;
36
	}
38
	}
37
	public void actionPerformed(ActionEvent evt)
39
	public void actionPerformed(ActionEvent evt)
38
	{
40
	{
39
		if (_session != null)
41
		if (_session != null)
40
		{
42
		{
41
			try
43
			try
42
			{
44
			{
43
				new AlterIndexCommand(_session, _plugin, true).execute();
45
				new AnalyzeTableCommand(_session, _plugin).execute();
44
			}
46
			}
45
			catch (Throwable th)
47
			catch (Throwable th)
46
			{
48
			{
47
				_session.showErrorMessage(th);
49
				_session.showErrorMessage(th);
48
			}
50
			}
49
		}
51
		}
50
	}
52
	}
51
	/**
53
	/**
52
	 * Set the current session.
54
	 * Set the current session.
53
	 * 
55
	 * 
54
	 * @param	session		The current session.
56
	 * @param	session		The current session.
55
	 */
57
	 */
56
	public void setSession(ISession session)
58
	public void setSession(ISession session)
57
	{
59
	{
58
		_session = session
60
		_session = 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