if (!isPluginSession(session)) { return null; }
GUIUtils.processOnSwingEventThread(new Runnable()
{
public void run()
{
updateTreeApi(session);
}
});
installMysqlQueryTokenizer(session);
return new PluginSessionCallbackAdaptor(this);
if (!isPluginSession(session)) { return null; }
GUIUtils.processOnSwingEventThread(new Runnable()
{
public void run()
{
updateTreeApi(session);
}
});
return new PluginSessionCallbackAdaptor(this);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/mysql/src/net/sourceforge/squirrel_sql/plugins/mysql/MysqlPlugin.java
|
|
File path: /sql12/plugins/h2/src/net/sourceforge/squirrel_sql/plugins/h2/H2Plugin.java
|
Method name: PluginSessionCallback sessionStarted(ISession)
|
|
Method name: PluginSessionCallback sessionStarted(ISession)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | if (!isPluginSession(session)) { return null; }↵ | | 1 | if (!isPluginSession(session)) { return null; }↵
|
|
2 | GUIUtils.processOnSwingEventThread(new Runnable()↵ | | 2 | GUIUtils.processOnSwingEventThread(new Runnable()↵
|
3 | {↵ | | 3 | {↵
|
4 | public void run()↵ | | 4 | public void run()↵
|
5 | {↵ | | 5 | {↵
|
6 | updateTreeApi(session);↵ | | 6 | updateTreeApi(session);↵
|
7 | }↵ | | 7 | }↵
|
8 | });↵ | | 8 | });↵
|
|
9 | installMysqlQueryTokenizer(session);↵ | | |
|
|
10 | return new PluginSessionCallbackAdaptor(this); | | 9 | return new PluginSessionCallbackAdaptor(this);
|
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.8 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (!isPluginSession(session)) | | 1 | if (!isPluginSession(session)) |
2 | | | 2 | |
3 | GUIUtils.processOnSwingEventThread(new Runnable() {...}); | | 3 | GUIUtils.processOnSwingEventThread(new Runnable() {...}); |
4 | installMysqlQueryTokenizer(session); | | | |
5 | return new PluginSessionCallbackAdaptor(this); | | 4 | return new PluginSessionCallbackAdaptor(this); |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement installMysqlQueryTokenizer(session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |