final MessageDialog messageDialog = new MessageDialog(); messageDialog.setTitle("SQL Execution Output"); messageDialog.setLocationRelativeTo(_session.getApplication().getMainFrame()); final VacuumTableSQLExecuterHandler handler = new VacuumTableSQLExecuterHandler(_session, messageDialog, i18n.PROGRESS_DIALOG_TITLE, i18n.COMMAND_PREFIX); final SQLExecuterTask executer = new SQLExecuterTask(_session, script, handler); executer.setSchemaCheck(false); _session.getApplication().getThreadPool().addTask(new Runnable() { public void run() { GUIUtils.processOnSwingEventThread(new Runnable() { public void run() { _mainDialog.setVisible(false); messageDialog.setVisible(true); } }); executer.run(); } });
final MessageDialog messageDialog = new MessageDialog(); messageDialog.setTitle("SQL Execution Output"); messageDialog.setLocationRelativeTo(_session.getApplication().getMainFrame()); final VacuumDatabaseSQLExecuterHandler handler = new VacuumDatabaseSQLExecuterHandler(_session, messageDialog, i18n.PROGRESS_DIALOG_TITLE, i18n.COMMAND_PREFIX); final SQLExecuterTask executer = new SQLExecuterTask(_session, script, handler); executer.setSchemaCheck(false); _session.getApplication().getThreadPool().addTask(new Runnable() { public void run() { GUIUtils.processOnSwingEventThread(new Runnable() { public void run() { _mainDialog.setVisible(false); messageDialog.setVisible(true); } }); executer.run(); } });
Clone fragments detected by clone detection tool
File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/commands/VacuumTableCommand.java File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/commands/VacuumDatabaseCommand.java
Method name: void executeScript(String) Method name: void executeScript(String)
Number of AST nodes: 7 Number of AST nodes: 7
1
final MessageDialog messageDialog = new MessageDialog();
1
final MessageDialog messageDialog = new MessageDialog();
2
        messageDialog.setTitle("SQL Execution Output");        
2
        messageDialog.setTitle("SQL Execution Output");        
3
        messageDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
3
        messageDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
4
        final VacuumTableSQLExecuterHandler handler = new VacuumTableSQLExecuterHandler(_session, messageDialog, i18n.PROGRESS_DIALOG_TITLE, i18n.COMMAND_PREFIX);
4
        final VacuumDatabaseSQLExecuterHandler handler = new VacuumDatabaseSQLExecuterHandler(_session, messageDialog, i18n.PROGRESS_DIALOG_TITLE, i18n.COMMAND_PREFIX);
5
        final SQLExecuterTask executer = new SQLExecuterTask(_session, script, handler);
5
        final SQLExecuterTask executer = new SQLExecuterTask(_session, script, handler);
6
        executer.setSchemaCheck(false);
6
        executer.setSchemaCheck(false);
7
        _session.getApplication().getThreadPool().addTask(new Runnable() {
7
        _session.getApplication().getThreadPool().addTask(new Runnable() {
8
            public void run() {
8
            public void run() {
9
                GUIUtils.processOnSwingEventThread(new Runnable() {
9
                GUIUtils.processOnSwingEventThread(new Runnable() {
10
                    public void run() {
10
                    public void run() {
11
                        _mainDialog.setVisible(false);
11
                        _mainDialog.setVisible(false);
12
                        messageDialog.setVisible(true);
12
                        messageDialog.setVisible(true);
13
                    }
13
                    }
14
                });
14
                });
15
                executer.run();
15
                executer.run();
16
            }
16
            }
17
        });
17
        });
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 having the same super class
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    final MessageDialog messageDialog = new MessageDialog();
    1
    final MessageDialog messageDialog = new MessageDialog();
    2
    messageDialog.setTitle("SQL Execution Output");
    2
    messageDialog.setTitle("SQL Execution Output");
    3
    messageDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
    3
    messageDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
    4
    final VacuumTableSQLExecuterHandler handler = new VacuumTableSQLExecuterHandler(_session, messageDialog, i18n.PROGRESS_DIALOG_TITLE, i18n.COMMAND_PREFIX);
    4
    final VacuumTableSQLExecuterHandler handler = new VacuumTableSQLExecuterHandler(_session, messageDialog, i18n.PROGRESS_DIALOG_TITLE, i18n.COMMAND_PREFIX);
    4
    final VacuumDatabaseSQLExecuterHandler handler = new VacuumDatabaseSQLExecuterHandler(_session, messageDialog, i18n.PROGRESS_DIALOG_TITLE, i18n.COMMAND_PREFIX);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.VacuumTableSQLExecuterHandlernet.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.VacuumDatabaseSQLExecuterHandlerSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.VacuumTableSQLExecuterHandlernet.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.VacuumDatabaseSQLExecuterHandlerSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.VacuumTableSQLExecuterHandlernet.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.VacuumDatabaseSQLExecuterHandlerSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18nnet.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.i18nVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18nnet.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.i18nVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression new VacuumTableSQLExecuterHandler(_session,messageDialog,i18n.PROGRESS_DIALOG_TITLE,i18n.COMMAND_PREFIX) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new VacuumDatabaseSQLExecuterHandler(_session,messageDialog,i18n.PROGRESS_DIALOG_TITLE,i18n.COMMAND_PREFIX) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n and net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.i18n extend a common superclass
    Type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n and net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.i18n extend a common superclass
    4
    final VacuumDatabaseSQLExecuterHandler handler = new VacuumDatabaseSQLExecuterHandler(_session, messageDialog, i18n.PROGRESS_DIALOG_TITLE, i18n.COMMAND_PREFIX);
    5
    final SQLExecuterTask executer = new SQLExecuterTask(_session, script, handler);
    5
    final SQLExecuterTask executer = new SQLExecuterTask(_session, script, handler);
    5
    final SQLExecuterTask executer = new SQLExecuterTask(_session, script, handler);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.VacuumTableSQLExecuterHandlernet.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.VacuumDatabaseSQLExecuterHandlerSUBCLASS_TYPE_MISMATCH
    5
    final SQLExecuterTask executer = new SQLExecuterTask(_session, script, handler);
    6
    executer.setSchemaCheck(false);
    6
    executer.setSchemaCheck(false);
    7
    _session.getApplication().getThreadPool().addTask(new Runnable() {...});
    7
    _session.getApplication().getThreadPool().addTask(new Runnable() {...});
    7
    _session.getApplication().getThreadPool().addTask(new Runnable() {...});
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialognet.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumDatabaseDialogSUBCLASS_TYPE_MISMATCH
    7
    _session.getApplication().getThreadPool().addTask(new Runnable() {...});
    Precondition Violations (4)
    Row Violation
    1Expression new VacuumTableSQLExecuterHandler(_session,messageDialog,i18n.PROGRESS_DIALOG_TITLE,i18n.COMMAND_PREFIX) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new VacuumDatabaseSQLExecuterHandler(_session,messageDialog,i18n.PROGRESS_DIALOG_TITLE,i18n.COMMAND_PREFIX) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.i18n
    4Type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumDatabaseCommand.i18n