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 GotoNextResultsTabCommand(_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/GotoNextResultsTabAction.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 GotoNextResultsTabCommand(_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 | } | | | |
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | try | | 4 | try |
3 | new CopyObjectNameCommand(_tree, SIMPLE_NAME).execute(); | | 5 | |
Precondition Violations (1)
Row |
Violation |
1 | 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 |