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); } }
if (_cmd == null) { _cmd = new GotoPreviousResultsTabCommand(_panel); } try { _cmd.execute(); } catch (Throwable ex) { final String msg = "Error occured seting current results tab"; _panel.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/CopySimpleObjectNameAction.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/GotoPreviousResultsTabAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 3 Number of AST nodes: 4
1
if (_tree != null)
1
if (_cmd == null)
2
		{
2
		
3
			try
4
			{
5
				new CopyObjectNameCommand(_tree, SIMPLE_NAME)
3
	{
4
				_cmd = new GotoPreviousResultsTabCommand(_panel);
5
			}
6
			try
7
			{
6
.execute();
8
				_cmd.execute();
7
			}
9
			}
8
			catch (Throwable ex)
10
			catch (Throwable ex)
9
			{
11
			{
10
				final String msg = "Error occured copying object names";
12
				final String msg = "Error occured seting current results tab";
11
				_tree.getSession().showErrorMessage(msg + ": " + ex);
13
				_panel.getSession().showErrorMessage(msg + ": " + ex);
12
				s_log.error(msg, ex);
14
				s_log.error(msg, ex);
13
			}
15
			}
14
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in different classes having the same super class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    4
    try
    Differences
    Expression1Expression2Difference
    "Error occured copying object names""Error occured seting current results tab"LITERAL_VALUE_MISMATCH
    _tree_panelVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.session.IObjectTreeAPInet.sourceforge.squirrel_sql.client.session.ISQLPanelAPIVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.IObjectTreeAPI of variable _tree does not match with type net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI of variable _panel
    • Make classes net.sourceforge.squirrel_sql.client.session.IObjectTreeAPI and net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI extend a common superclass
    4
    try
    3
    new CopyObjectNameCommand(_tree, SIMPLE_NAME).execute();
    3
    new CopyObjectNameCommand(_tree, SIMPLE_NAME).execute();
    5
    _cmd.execute();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.session.action.CopyObjectNameCommandnet.sourceforge.squirrel_sql.fw.util.ICommandSUBCLASS_TYPE_MISMATCH
    new CopyObjectNameCommand(_tree,SIMPLE_NAME)_cmdTYPE_COMPATIBLE_REPLACEMENT
    5
    _cmd.execute();
    Precondition Violations (1)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.session.IObjectTreeAPI of variable _tree does not match with type net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI of variable _panel