if (_session != null)
{
try
{
new CloseSessionCommand(_session).execute();
}
catch (Throwable ex)
{
final String msg = "Error occured closing session";
_session.showErrorMessage(msg + ": " + ex);
s_log.error(msg, ex);
}
}
if (_session != null)
{
try
{
new CloseSessionWindowCommand(_session).execute();
}
catch (Throwable ex)
{
final String msg = "Error occured closing session";
_session.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/CloseSessionAction.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/CloseSessionWindowAction.java
|
Method name: void actionPerformed(ActionEvent)
|
|
Method name: void actionPerformed(ActionEvent)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (_session != null)↵ | | 1 | if (_session != null)↵
|
2 | {↵ | | 2 | {↵
|
3 | try↵ | | 3 | try↵
|
4 | {↵ | | 4 | {↵
|
5 | new CloseSessionCommand(_session).execute();↵ | | 5 | new CloseSessionWindowCommand(_session).execute();↵
|
6 | }↵ | | 6 | }↵
|
7 | catch (Throwable ex)↵ | | 7 | catch (Throwable ex)↵
|
8 | {↵ | | 8 | {↵
|
9 | final String msg = "Error occured closing session";↵ | | 9 | final String msg = "Error occured closing session";↵
|
10 | _session.showErrorMessage(msg + ": " + ex);↵ | | 10 | _session.showErrorMessage(msg + ": " + ex);↵
|
11 | s_log.error(msg, ex);↵ | | 11 | s_log.error(msg, ex);↵
|
12 | }↵ | | 12 | }↵
|
13 | } | | 13 | }
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 2.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (_session != null) | | 1 | if (_session != null) |
2 | | | 2 | |
3 | new CloseSessionCommand(_session).execute(); | | 3 | new CloseSessionWindowCommand(_session).execute(); |
Precondition Violations (2)
Row |
Violation |
1 | Expression new CloseSessionCommand(_session) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new CloseSessionWindowCommand(_session) cannot be parameterized, because it has dependencies to/from statements that will be extracted |