public class CopyQualifiedObjectNameAction extends SquirrelAction implements IObjectTreeAction, CopyObjectNameCommand.ICopyTypes { /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(CopyQualifiedObjectNameAction.class); /** API for the current tree. */ private IObjectTreeAPI _tree; /** * Ctor. * * @param app Application API. */ public CopyQualifiedObjectNameAction(IApplication app) { super(app); } /** * Set the current object tree API. * * @param tree Current ObjectTree */ public void setObjectTree(IObjectTreeAPI tree) { _tree = tree; setEnabled(null != _tree); } /** * Perform this action. Use the <TT>CopyObjectNameCommand</TT>. * * @param evt The current event. */ public void actionPerformed(ActionEvent evt) { if (_tree != null) { try { new CopyObjectNameCommand(_tree, QUALIFIED_NAME).execute(); } catch (Throwable ex) { final String msg = "Error occured copying object names"; _tree.getSession().showErrorMessage(msg + ": " + ex); s_log.error(msg, ex);
public class CopySimpleObjectNameAction extends SquirrelAction implements IObjectTreeAction, CopyObjectNameCommand.ICopyTypes { /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(CopySimpleObjectNameAction.class); /** API for the current tree. */ private IObjectTreeAPI _tree; /** * Ctor. * * @param app Application API. */ public CopySimpleObjectNameAction(IApplication app) { super(app); } /** * Set the current object tree API. * * @param tree Current ObjectTree */ public void setObjectTree(IObjectTreeAPI tree) { _tree = tree; setEnabled(null != _tree); } /** * Perform this action. Use the <TT>CopyObjectNameCommand</TT>. * * @param evt The current event. */ public void actionPerformed(ActionEvent evt) { if (_tree != null) { try { new CopyObjectNameCommand(_tree, SIMPLE_NAME).execute(); } catch (Throwable ex) { final String msg = "Error occured copying object names"; _tree.getSession().showErrorMessage(msg + ": " + ex); s_log.error(msg, ex);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/CopyQualifiedObjectNameAction.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/CopySimpleObjectNameAction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class CopyQualifiedObjectNameAction
1
public class CopySimpleObjectNameAction
2
	extends SquirrelAction
2
				extends SquirrelAction
3
	implements IObjectTreeAction, CopyObjectNameCommand.ICopyTypes
3
				implements IObjectTreeAction, CopyObjectNameCommand.ICopyTypes
4
{
4
{
5
	/** Logger for this class. */
5
	/** Logger for this class. */
6
	private final static ILogger s_log =
6
	private final static ILogger s_log =
7
		LoggerController.createLogger(CopyQualifiedObjectNameAction.class);
7
		LoggerController.createLogger(CopySimpleObjectNameAction.class);
8
	/** API for the current tree. */
8
	/** API for the current tree. */
9
	private IObjectTreeAPI _tree;
9
	private IObjectTreeAPI _tree;
10
	/**
10
	/**
11
	 * Ctor.
11
	 * Ctor.
12
	 *
12
	 *
13
	 * @param	app		Application API.
13
	 * @param	app		Application API.
14
	 */
14
	 */
15
	public CopyQualifiedObjectNameAction(IApplication app)
15
	public CopySimpleObjectNameAction(IApplication app)
16
	{
16
	{
17
		super(app);
17
		super(app);
18
	}
18
	}
19
	/**
19
	/**
20
	 * Set the current object tree API.
20
	 * Set the current object tree API.
21
	 *
21
	 *
22
	 * @param	tree	Current ObjectTree
22
	 * @param	tree	Current ObjectTree
23
	 */
23
	 */
24
	public void setObjectTree(IObjectTreeAPI tree)
24
	public void setObjectTree(IObjectTreeAPI tree)
25
	{
25
	{
26
		_tree = tree;
26
		_tree = tree;
27
      setEnabled(null != _tree);
27
      setEnabled(null != _tree);
28
	}
28
	}
29
	/**
29
	/**
30
	 * Perform this action. Use the <TT>CopyObjectNameCommand</TT>.
30
	 * Perform this action. Use the <TT>CopyObjectNameCommand</TT>.
31
	 *
31
	 *
32
	 * @param	evt	The current event.
32
	 * @param	evt	The current event.
33
	 */
33
	 */
34
	public void actionPerformed(ActionEvent evt)
34
	public void actionPerformed(ActionEvent evt)
35
	{
35
	{
36
		if (_tree != null)
36
		if (_tree != null)
37
		{
37
		{
38
			try
38
			try
39
			{
39
			{
40
				new CopyObjectNameCommand(_tree, QUALIFIED_NAME).execute();
40
				new CopyObjectNameCommand(_tree, SIMPLE_NAME).execute();
41
			}
41
			}
42
			catch (Throwable ex)
42
			catch (Throwable ex)
43
			{
43
			{
44
				final String msg = "Error occured copying object names";
44
				final String msg = "Error occured copying object names";
45
				_tree.getSession().showErrorMessage(msg + ": " + ex);
45
				_tree.getSession().showErrorMessage(msg + ": " + ex);
46
				s_log.error(msg, ex);
46
				s_log.error(msg, ex);
47
			
47
			
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