if (_panel != null)
{
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);
}
}
if (_panel != null)
{
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/GotoPreviousResultsTabAction.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: 5
|
|
Number of AST nodes: 5
|
|
1 | if (_panel != null)↵ | | 1 | if (_panel != null)↵
|
2 | {↵ | | 2 | {↵
|
3 | if (_cmd == null)↵ | | 3 | if (_cmd == null)↵
|
4 | {↵ | | 4 | {↵
|
5 | _cmd = new GotoPreviousResultsTabCommand(_panel);↵ | | 5 | _cmd = new GotoNextResultsTabCommand(_panel);↵
|
6 | }↵ | | 6 | }↵
|
7 | try↵ | | 7 | try↵
|
8 | {↵ | | 8 | {↵
|
9 | _cmd.execute();↵ | | 9 | _cmd.execute();↵
|
10 | }↵ | | 10 | }↵
|
11 | catch (Throwable ex)↵ | | 11 | catch (Throwable ex)↵
|
12 | {↵ | | 12 | {↵
|
13 | final String msg = "Error occured seting current results tab";↵ | | 13 | final String msg = "Error occured seting current results tab";↵
|
14 | _panel.getSession().showErrorMessage(msg + ": " + ex);↵ | | 14 | _panel.getSession().showErrorMessage(msg + ": " + ex);↵
|
15 | s_log.error(msg, ex);↵ | | 15 | s_log.error(msg, ex);↵
|
16 | }↵ | | 16 | }↵
|
17 | } | | 17 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 11 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 7.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (_panel != null) | | 1 | if (_panel != null) |
2 | | | 2 | |
3 | _cmd = new GotoPreviousResultsTabCommand(_panel); | | 3 | _cmd = new GotoNextResultsTabCommand(_panel); |
4 | | | 4 | |
5 | | | 5 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression new GotoPreviousResultsTabCommand(_panel) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new GotoNextResultsTabCommand(_panel) cannot be parameterized, because it has dependencies to/from statements that will be extracted |