customDialog = new AddModifySequenceDialog(AddModifySequenceDialog.ADD_MODE); customDialog.addExecuteListener(new ExecuteListener()); customDialog.addEditSQLListener(new EditSQLListener(customDialog)); customDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, customDialog)); customDialog.setLocationRelativeTo(_session.getApplication().getMainFrame()); customDialog.setVisible(true);
_mainDialog = new VacuumTableDialog(tableinfos); _mainDialog.addExecuteListener(new ExecuteListener()); _mainDialog.addEditSQLListener(new EditSQLListener(_mainDialog)); _mainDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, _mainDialog)); _mainDialog.setLocationRelativeTo(_session.getApplication().getMainFrame()); _mainDialog.setVisible(true);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/commands/AddSequenceCommand.java File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/commands/VacuumTableCommand.java
Method name: void showCustomDialog() Method name: void showDialog(ITableInfo[])
Number of AST nodes: 6 Number of AST nodes: 6
1
customDialog = new AddModifySequenceDialog(AddModifySequenceDialog.ADD_MODE);
1
_mainDialog = new 
2
		custom
2
VacuumTableDialog(tableinfos);
3
Dialog.addExecuteListener(new ExecuteListener());
3
        _mainDialog.addExecuteListener(new ExecuteListener());
4
		customDialog.addEditSQLListener(new EditSQLListener(customDialog));
4
        _mainDialog.addEditSQLListener(new EditSQLListener(_mainDialog));
5
		customDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, customDialog));
5
        _mainDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, _mainDialog));
6
		customDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
6
        _mainDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
7
		customDialog.setVisible(true);
7
        _mainDialog.setVisible(true);
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 comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                      
    1
    _mainDialog = new VacuumTableDialog(tableinfos);
    Preondition Violations
    Unmatched statement _mainDialog=new VacuumTableDialog(tableinfos); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    _mainDialog = new VacuumTableDialog(tableinfos);
    1
    customDialog = new AddModifySequenceDialog(AddModifySequenceDialog.ADD_MODE);
    1
    customDialog = new AddModifySequenceDialog(AddModifySequenceDialog.ADD_MODE);
    Preondition Violations
    Unmatched statement customDialog=new AddModifySequenceDialog(AddModifySequenceDialog.ADD_MODE); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                
    2
    customDialog.addExecuteListener(new ExecuteListener());
    2
    customDialog.addExecuteListener(new ExecuteListener());
    2
    _mainDialog.addExecuteListener(new ExecuteListener());
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.refactoring.commands.AbstractRefactoringCommand.ExecuteListenernet.sourceforge.squirrel_sql.plugins.postgres.commands.AbstractPostgresDialogCommand.ExecuteListenerSUBCLASS_TYPE_MISMATCH
    customDialog_mainDialogVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddModifySequenceDialognet.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialogSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addExecuteListener(java.awt.event.ActionListener)
    2
    _mainDialog.addExecuteListener(new ExecuteListener());
    3
    customDialog.addEditSQLListener(new EditSQLListener(customDialog));
    3
    customDialog.addEditSQLListener(new EditSQLListener(customDialog));
    3
    _mainDialog.addEditSQLListener(new EditSQLListener(_mainDialog));
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.refactoring.commands.AbstractRefactoringCommand.EditSQLListenernet.sourceforge.squirrel_sql.plugins.postgres.commands.AbstractPostgresDialogCommand.EditSQLListenerSUBCLASS_TYPE_MISMATCH
    customDialog_mainDialogVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddModifySequenceDialognet.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialogSUBCLASS_TYPE_MISMATCH
    customDialog_mainDialogVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddModifySequenceDialognet.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialogSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new EditSQLListener(customDialog) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new EditSQLListener(_mainDialog) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression customDialog cannot be unified with expression _mainDialog , because common superclass type javax.swing.JDialog cannot be passed as an argument to public void <init>(net.sourceforge.squirrel_sql.client.gui.db.IDisposableDialog)
    Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addEditSQLListener(java.awt.event.ActionListener)
    Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addEditSQLListener(java.awt.event.ActionListener)
    3
    _mainDialog.addEditSQLListener(new EditSQLListener(_mainDialog));
    4
    customDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, customDialog));
    4
    customDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, customDialog));
    4
    _mainDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, _mainDialog));
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.refactoring.commands.AbstractRefactoringCommand.ShowSQLListenernet.sourceforge.squirrel_sql.plugins.postgres.commands.AbstractPostgresDialogCommand.ShowSQLListenerSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.commands.AddSequenceCommand.i18nnet.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18nVARIABLE_TYPE_MISMATCH
    customDialog_mainDialogVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddModifySequenceDialognet.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialogSUBCLASS_TYPE_MISMATCH
    customDialog_mainDialogVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddModifySequenceDialognet.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialogSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE,customDialog) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE,_mainDialog) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type net.sourceforge.squirrel_sql.plugins.refactoring.commands.AddSequenceCommand.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.refactoring.commands.AddSequenceCommand.i18n and net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n extend a common superclass
    Expression customDialog cannot be unified with expression _mainDialog , because common superclass type javax.swing.JDialog cannot be passed as an argument to public void <init>(java.lang.String, net.sourceforge.squirrel_sql.client.gui.db.IDisposableDialog)
    Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addShowSQLListener(java.awt.event.ActionListener)
    Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addShowSQLListener(java.awt.event.ActionListener)
    4
    _mainDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, _mainDialog));
    5
    customDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
    5
    customDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
    5
    _mainDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
    Differences
    Expression1Expression2Difference
    customDialog_mainDialogVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddModifySequenceDialognet.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialogSUBCLASS_TYPE_MISMATCH
    5
    _mainDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
    6
    customDialog.setVisible(true);
    6
    customDialog.setVisible(true);
    6
    _mainDialog.setVisible(true);
    Differences
    Expression1Expression2Difference
    customDialog_mainDialogVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddModifySequenceDialognet.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialogSUBCLASS_TYPE_MISMATCH
    6
    _mainDialog.setVisible(true);
    Precondition Violations (15)
    Row Violation
    1Unmatched statement _mainDialog=new VacuumTableDialog(tableinfos); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement customDialog=new AddModifySequenceDialog(AddModifySequenceDialog.ADD_MODE); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addExecuteListener(java.awt.event.ActionListener)
    4Expression new EditSQLListener(customDialog) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression new EditSQLListener(_mainDialog) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression customDialog cannot be unified with expression _mainDialog , because common superclass type javax.swing.JDialog cannot be passed as an argument to public void <init>(net.sourceforge.squirrel_sql.client.gui.db.IDisposableDialog)
    7Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addEditSQLListener(java.awt.event.ActionListener)
    8Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addEditSQLListener(java.awt.event.ActionListener)
    9Expression new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE,customDialog) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE,_mainDialog) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type net.sourceforge.squirrel_sql.plugins.refactoring.commands.AddSequenceCommand.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand.i18n
    12Expression customDialog cannot be unified with expression _mainDialog , because common superclass type javax.swing.JDialog cannot be passed as an argument to public void <init>(java.lang.String, net.sourceforge.squirrel_sql.client.gui.db.IDisposableDialog)
    13Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addShowSQLListener(java.awt.event.ActionListener)
    14Expression customDialog cannot be unified with expression _mainDialog , because common superclass javax.swing.JDialog does not declare member(s) public void addShowSQLListener(java.awt.event.ActionListener)
    15The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.refactoring.commands.AddSequenceCommand and net.sourceforge.squirrel_sql.plugins.postgres.commands.VacuumTableCommand do not have a common superclass