String local = (String) localColumBox.getSelectedItem(); String ref = (String) referencingBox.getSelectedItem(); localColumBox.removeItem(local); referencingBox.removeItem(ref); _columnTableModel.addColumn(new String[]{local, ref}); _propertiesTab.enableReferencedComboBox(false); if (localColumBox.getItemCount() == 0 || referencingBox.getItemCount() == 0) addButton.setEnabled(false); MergeTableDialog.this.checkInputCompletion();
String local = (String) localColumBox.getSelectedItem(); String ref = (String) referencingBox.getSelectedItem(); localColumBox.removeItem(local); referencingBox.removeItem(ref); _columnTableModel.addColumn(new String[]{local, ref}); _propertiesTab.enableReferencedComboBox(false); if (localColumBox.getItemCount() == 0 || referencingBox.getItemCount() == 0) addButton.setEnabled(false); AddForeignKeyDialog.this.checkInputCompletion();
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/MergeTableDialog.java File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AddForeignKeyDialog.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 9 Number of AST nodes: 9
1
String local = (String) localColumBox.getSelectedItem();
1
String local = (String) localColumBox.getSelectedItem();
2
                    String ref = (String) referencingBox.getSelectedItem();
2
                    String ref = (String) referencingBox.getSelectedItem();
3
                    localColumBox.removeItem(local);
3
                    localColumBox.removeItem(local);
4
                    referencingBox.removeItem(ref);
4
                    referencingBox.removeItem(ref);
5
                    _columnTableModel.addColumn(new String[]{local, ref});
5
                    _columnTableModel.addColumn(new String[]{local, ref});
6
                    _propertiesTab.enableReferencedComboBox(false);
6
                    _propertiesTab.enableReferencedComboBox(false);
7
                    if (localColumBox.getItemCount() == 0 || referencingBox.getItemCount() == 0)
7
                    if (localColumBox.getItemCount() == 0 || referencingBox.getItemCount() == 0)
8
                        addButton.setEnabled(false);
8
                        addButton.setEnabled(false);
9
                    MergeTableDialog.this.checkInputCompletion();
9
                    AddForeignKeyDialog.this.checkInputCompletion();
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.4
Clones locationClones are in different classes
Number of node comparisons53
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)13.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String local = (String)localColumBox.getSelectedItem();
    1
    String local = (String)localColumBox.getSelectedItem();
    2
    String ref = (String)referencingBox.getSelectedItem();
    2
    String ref = (String)referencingBox.getSelectedItem();
    3
    localColumBox.removeItem(local);
    3
    localColumBox.removeItem(local);
    4
    referencingBox.removeItem(ref);
    4
    referencingBox.removeItem(ref);
    5
    _columnTableModel.addColumn(new String[] {local, ref});
    5
    _columnTableModel.addColumn(new String[] {local, ref});
    5
    _columnTableModel.addColumn(new String[] {local, ref});
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.MergeTableDialog.ReferenceColumnTableModelnet.sourceforge.squirrel_sql.plugins.refactoring.gui.AddForeignKeyColumnTableModelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression _columnTableModel cannot be unified with expression _columnTableModel , because common superclass javax.swing.table.AbstractTableModel does not declare member(s) public void addColumn(java.lang.String[])
    5
    _columnTableModel.addColumn(new String[] {local, ref});
    6
    _propertiesTab.enableReferencedComboBox(false);
    6
    _propertiesTab.enableReferencedComboBox(false);
    6
    _propertiesTab.enableReferencedComboBox(false);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.MergeTableDialog.PropertiesTabnet.sourceforge.squirrel_sql.plugins.refactoring.gui.AddForeignKeyDialog.PropertiesTabSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression _propertiesTab cannot be unified with expression _propertiesTab , because common superclass javax.swing.JPanel does not declare member(s) private void enableReferencedComboBox(boolean)
    6
    _propertiesTab.enableReferencedComboBox(false);
    7
    if (localColumBox.getItemCount() == 0 || referencingBox.getItemCount() == 0)
    7
    if (localColumBox.getItemCount() == 0 || referencingBox.getItemCount() == 0)
    8
    addButton.setEnabled(false);
    8
    addButton.setEnabled(false);
    9
    MergeTableDialog.this.checkInputCompletion();
    9
    MergeTableDialog.this.checkInputCompletion();
    9
    AddForeignKeyDialog.this.checkInputCompletion();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.MergeTableDialognet.sourceforge.squirrel_sql.plugins.refactoring.gui.AddForeignKeyDialogSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression MergeTableDialog cannot be unified with expression AddForeignKeyDialog , because common superclass net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringTabbedDialog does not declare member(s) private void checkInputCompletion()
    9
    AddForeignKeyDialog.this.checkInputCompletion();
    Precondition Violations (4)
    Row Violation
    1Expression _columnTableModel cannot be unified with expression _columnTableModel , because common superclass javax.swing.table.AbstractTableModel does not declare member(s) public void addColumn(java.lang.String[])
    2Expression _propertiesTab cannot be unified with expression _propertiesTab , because common superclass javax.swing.JPanel does not declare member(s) private void enableReferencedComboBox(boolean)
    3Expression MergeTableDialog cannot be unified with expression AddForeignKeyDialog , because common superclass net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringTabbedDialog does not declare member(s) private void checkInputCompletion()
    4The refactoring of the clones is infeasible, because classes and do not have a common superclass