_session.getApplication().getThreadPool().addTask(new Runnable() { public void run() { final String script = dropTableScriptString(dbObjs); if (script != null) { GUIUtils.processOnSwingEventThread(new Runnable() { public void run() { ISQLPanelAPI api = FrameWorkAcessor.getSQLPanelAPI( _session, _plugin); api.appendSQLScript(script, true); int tabIdx = ISession.IMainPanelTabIndexes.SQL_TAB; _session.selectMainTab(tabIdx); } }); } } });
_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/DropTableScriptCommand.java File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableScriptCommand.java
Method name: void scriptTablesToSQLEntryArea(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
            public void run() {
2
           public void run() {
3
                final String script = dropTableScriptString(dbObjs);
3
               final String script = createTableScriptString(dbObjs);
4
                if (script != null)
4
                if(null != script)
5
 {
5
                {
6
                    GUIUtils.processOnSwingEventThread(new Runnable() {
6
                    GUIUtils.processOnSwingEventThread(new Runnable() {
7
                        public void run() {
7
                        public void run() {
8
                            ISQLPanelAPI api = FrameWorkAcessor.getSQLPanelAPI(
8
                            ISQLPanelAPI api = 
9
                                    _session, _plugin);
9
                                FrameWorkAcessor.getSQLPanelAPI(_session, _plugin);
10
                            api.appendSQLScript(script, true);
10
                            api.appendSQLScript(script, true);
11
                            int tabIdx = ISession.IMainPanelTabIndexes.SQL_TAB;
11
                            _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);
12
                            _session.selectMainTab(tabIdx);
12
                            
13
                        }
13
                        }
14
                    });
14
                    });
15
                }
15
                }
16
 
16
               
17
           }
17
           }
18
        });
18
       });
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons1
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    _session.getApplication().getThreadPool().addTask(new Runnable() {...});
    1
    _session.getApplication().getThreadPool().addTask(new Runnable() {...});
    1
    _session.getApplication().getThreadPool().addTask(new Runnable() {...});
    Differences
    Expression1Expression2Difference
    dropTableScriptStringcreateTableScriptStringMETHOD_INVOCATION_NAME_MISMATCH
    scriptnullTYPE_COMPATIBLE_REPLACEMENT
    nullscriptTYPE_COMPATIBLE_REPLACEMENT
    { public void run(){ ISQLPanelAPI api=FrameWorkAcessor.getSQLPanelAPI(_session,_plugin); api.appendSQLScript(script,true); int tabIdx=ISession.IMainPanelTabIndexes.SQL_TAB; _session.selectMainTab(tabIdx); } } { public void run(){ ISQLPanelAPI api=FrameWorkAcessor.getSQLPanelAPI(_session,_plugin); api.appendSQLScript(script,true); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } } ANONYMOUS_CLASS_DECLARATION_MISMATCH
    Preondition Violations
    Expression createTableScriptString(dbObjs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression script cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression script cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Runnable(){ public void run(){ ISQLPanelAPI api=FrameWorkAcessor.getSQLPanelAPI(_session,_plugin); api.appendSQLScript(script,true); int tabIdx=ISession.IMainPanelTabIndexes.SQL_TAB; _session.selectMainTab(tabIdx); } } cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Runnable(){ public void run(){ ISQLPanelAPI api=FrameWorkAcessor.getSQLPanelAPI(_session,_plugin); api.appendSQLScript(script,true); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } } cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    _session.getApplication().getThreadPool().addTask(new Runnable() {...});
    Precondition Violations (5)
    Row Violation
    1Expression createTableScriptString(dbObjs) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression script cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression script cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new Runnable(){ public void run(){ ISQLPanelAPI api=FrameWorkAcessor.getSQLPanelAPI(_session,_plugin); api.appendSQLScript(script,true); int tabIdx=ISession.IMainPanelTabIndexes.SQL_TAB; _session.selectMainTab(tabIdx); } } cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression new Runnable(){ public void run(){ ISQLPanelAPI api=FrameWorkAcessor.getSQLPanelAPI(_session,_plugin); api.appendSQLScript(script,true); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } } cannot be parameterized, because it has dependencies to/from statements that will be extracted