_session.getApplication().getThreadPool().addTask(new Runnable()
{
public void run()
{
final String script = createSelectScriptString(dbObjs);
if (null != script)
{
GUIUtils.processOnSwingEventThread(new Runnable()
{
public void run()
{
ISQLPanelAPI api = FrameWorkAcessor.getSQLPanelAPI(_session, _plugin);
api.appendSQLScript(script, true);
_session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);
}
});
}
}
});
_session.getApplication().getThreadPool().addTask(new Runnable() {
public void run() {
final String script = createTableScriptString(dbObjs);
if(null != script)
{
GUIUtils.processOnSwingEventThread(new Runnable() {
public void run() {
ISQLPanelAPI api =
FrameWorkAcessor.getSQLPanelAPI(_session, _plugin);
api.appendSQLScript(script, true);
_session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);
}
});
}
}
});
Clone fragments detected by clone detection tool
File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateSelectScriptCommand.java
|
|
File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableScriptCommand.java
|
Method name: void scriptSelectsToSQLEntryArea(IDatabaseObjectInfo[])
|
|
Method name: void scriptTablesToSQLEntryArea(IDatabaseObjectInfo[])
|
Number of AST nodes: 1
|
|
Number of AST nodes: 1
|
|
1 | _session.getApplication().getThreadPool().addTask(new Runnable()↵ | | 1 | _session.getApplication().getThreadPool().addTask(new Runnable()↵
|
2 | {↵ | | 2 | {↵
|
3 | public void run()↵ | | 3 | public void run() {↵
|
4 | {↵ | | 4 | ↵
|
5 | final String script = createSelectScriptString(dbObjs);↵ | | 5 | final String script = createTableScriptString(dbObjs);↵
|
6 | if (null != script)↵ | | 6 | if(null != script)↵
|
7 | {↵ | | 7 | {↵
|
8 | GUIUtils.processOnSwingEventThread(new Runnable()↵ | | 8 | GUIUtils.processOnSwingEventThread(new Runnable()↵
|
9 | ↵ | | 9 | {↵
|
10 | {↵ | | 10 | ↵
|
11 | public void run()↵ | | 11 | public void run()↵
|
12 | ↵ | | 12 | {↵
|
13 | {↵ | | 13 | ↵
|
14 | ISQLPanelAPI api = ↵ | | 14 | ISQLPanelAPI api = ↵
|
15 | FrameWorkAcessor.getSQLPanelAPI(_session, _plugin);↵ | | 15 | FrameWorkAcessor.getSQLPanelAPI(_session, _plugin);↵
|
16 | api.appendSQLScript(script, true);↵ | | 16 | api.appendSQLScript(script, true);↵
|
17 | _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);↵ | | 17 | _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);↵
|
| | | 18 | ↵
|
18 | }↵ | | 19 | }↵
|
19 | });↵ | | 20 | });↵
|
20 | }↵ | | 21 | ↵
|
| | | 22 | } ↵
|
21 | }↵ | | 23 | }↵
|
22 | }); | | 24 | });
|
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
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) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | _session.getApplication().getThreadPool().addTask(new Runnable() {...}); | | 1 | _session.getApplication().getThreadPool().addTask(new Runnable() {...}); |
Precondition Violations (2)
Row |
Violation |
1 | Expression createSelectScriptString(dbObjs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression createTableScriptString(dbObjs) cannot be parameterized, because it has dependencies to/from statements that will be extracted |