SessionPluginInfo spi = it.next();
try
{
spi.getSessionPlugin().sessionCreated(session);
} catch (Throwable th)
{
String msg =
s_stringMgr.getString("PluginManager.error.sessioncreated", spi.getPlugin()
.getDescriptiveName());
s_log.error(msg, th);
_app.showErrorDialog(msg, th);
}
SessionPluginInfo spi = it.next();
try
{
spi.getSessionPlugin().sessionEnding(session);
} catch (Throwable th)
{
String msg =
s_stringMgr.getString("PluginManager.error.sessionended", spi .getPlugin()
.getDescriptiveName());
s_log.error(msg, th);
_app.showErrorDialog(msg, th);
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/plugin/PluginManager.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/plugin/PluginManager.java
|
Method name: void sessionCreated(ISession)
|
|
Method name: void sessionEnding(ISession)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | SessionPluginInfo spi = it.next();↵ | | 1 | SessionPluginInfo spi = it.next();↵
|
2 | try↵ | | 2 | try↵
|
3 | {↵ | | 3 | {↵
|
4 | spi.getSessionPlugin().sessionCreated(session);↵ | | 4 | spi.getSessionPlugin().sessionEnding(session);↵
|
5 | } catch (Throwable th)↵ | | 5 | } catch (Throwable th)↵
|
6 | {↵ | | 6 | {↵
|
7 | String msg =↵ | | 7 | String msg =↵
|
8 | s_stringMgr.getString("PluginManager.error.sessioncreated", spi.getPlugin()↵ | | 8 | s_stringMgr.getString("PluginManager.error.sessionended", spi .getPlugin()↵
|
9 | .getDescriptiveName());↵ | | 9 | .getDescriptiveName());↵
|
10 | s_log.error(msg, th);↵ | | 10 | s_log.error(msg, th);↵
|
11 | _app.showErrorDialog(msg, th);↵ | | 11 | _app.showErrorDialog(msg, th);↵
|
12 | } | | 12 | }
|
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
-
{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) | 3.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | SessionPluginInfo spi = it.next(); | | 6 | SessionPluginInfo spi = it.next(); |
5 | try | | 7 | try |
6 | spi.getSessionPlugin().sessionCreated(session); | | 8 | spi.getSessionPlugin().sessionEnding(session); |
Precondition Violations (4)
Row |
Violation |
1 | Expression spi.getSessionPlugin().sessionCreated(session) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression spi.getSessionPlugin().sessionEnding(session) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression spi.getSessionPlugin().sessionCreated(session) is a void method call, and thus it cannot be parameterized |
4 | Expression spi.getSessionPlugin().sessionEnding(session) is a void method call, and thus it cannot be parameterized |