_addButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String local = (String) _columnBox.getSelectedItem(); _columnBox.removeItem(local); _columnTableModel.addColumn(local); if (_columnBox.getItemCount() == 0) _addButton.setEnabled(false); AddIndexDialog.this.checkInputCompletion(); } });
addButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String local = (String) localColumBox.getSelectedItem(); localColumBox.removeItem(local); _columnTableModel.addColumn(local); if (localColumBox.getItemCount() == 0) addButton.setEnabled(false); AddUniqueConstraintDialog.this.checkInputCompletion(); } });
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AddIndexDialog.java File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AddUniqueConstraintDialog.java
Method name: void init() Method name: void init()
Number of AST nodes: 1 Number of AST nodes: 1
1
_addButton.addActionListener(new ActionListener()
1
addButton.addActionListener(new ActionListener()
2
			{
2
			{
3
				public void actionPerformed(ActionEvent e)
3
				public void actionPerformed(ActionEvent e)
4
				{
4
				{
5
					String local = (String) _columnBox.getSelectedItem();
5
					String local = (String) localColumBox.getSelectedItem();
6

6
					_columnBox.removeItem(local);
7
					localColumBox.removeItem(local);
8

7
					_columnTableModel.addColumn(local);
9
					_columnTableModel.addColumn(local);
8
					if (_columnBox.getItemCount() == 0)
10
					if (localColumBox.getItemCount() == 0)
9
						_addButton.setEnabled(false);
11
						addButton.setEnabled(false);
12

10
					AddIndexDialog.this.checkInputCompletion();
13
					AddUniqueConstraintDialog.this.checkInputCompletion();
11
				}
14
				}
12
			});
15
			});
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 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
    15
    _addButton.addActionListener(new ActionListener() {...});
    15
    _addButton.addActionListener(new ActionListener() {...});
    15
    addButton.addActionListener(new ActionListener() {...});
    Differences
    Expression1Expression2Difference
    _columnBoxlocalColumBoxVARIABLE_NAME_MISMATCH
    _columnBoxlocalColumBoxVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddIndexColumnTableModelnet.sourceforge.squirrel_sql.plugins.refactoring.gui.AddUniqueConstraintColumnTableModelSUBCLASS_TYPE_MISMATCH
    _columnBoxlocalColumBoxVARIABLE_NAME_MISMATCH
    _addButtonaddButtonVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddIndexDialognet.sourceforge.squirrel_sql.plugins.refactoring.gui.AddUniqueConstraintDialogSUBCLASS_TYPE_MISMATCH
    _addButtonaddButtonVARIABLE_NAME_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)
    Expression AddIndexDialog cannot be unified with expression AddUniqueConstraintDialog , because common superclass net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringTabbedDialog does not declare member(s) private void checkInputCompletion()
    15
    addButton.addActionListener(new ActionListener() {...});
    Precondition Violations (2)
    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 AddIndexDialog cannot be unified with expression AddUniqueConstraintDialog , because common superclass net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringTabbedDialog does not declare member(s) private void checkInputCompletion()