JPanel result = new JPanel(); executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL); result.add(executeButton); editSQLButton = new JButton(i18n.EDIT_BUTTON_LABEL); result.add(editSQLButton); showSQLButton = new JButton(i18n.SHOWSQL_BUTTON_LABEL); result.add(showSQLButton); cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); } }); result.add(cancelButton); return result;
JPanel result = new JPanel(); _executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL); result.add(_executeButton); _editButton = new JButton(i18n.EDIT_BUTTON_LABEL); result.add(_editButton); _showButton = new JButton(i18n.SHOW_BUTTON_LABEL); result.add(_showButton); _cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL); addCancelListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); } }); result.add(_cancelButton); return result;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AbstractRefactoringDialog.java File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/gui/AbstractPostgresDialog.java
Method name: JPanel getButtonPanel() Method name: JPanel getButtonPanel()
Number of AST nodes: 11 Number of AST nodes: 11
1
JPanel result = new JPanel();
1
JPanel result = new JPanel();
2
		
3
executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
2
        _executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
4
		
5
result.add(executeButton);
3
        result.add(_executeButton);
6
		
7
editSQLButton = new JButton(i18n.EDIT_BUTTON_LABEL);
4
        _editButton = new JButton(i18n.EDIT_BUTTON_LABEL);
8
		
9
result.add(editSQLButton);
5
        result.add(_editButton);
10
		
11
showSQLButton = new JButton(i18n.SHOWSQL_BUTTON_LABEL);
6
        _showButton = new JButton(i18n.SHOW_BUTTON_LABEL);
12
		
13
result.add(showSQLButton);
7
        result.add(_showButton);
14
		
15
cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
8
        _cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
16
		cancelButton.addAction
17
Listener(new ActionListener()
9
        addCancelListener(new ActionListener()
18
		{
19
			
10
 {
20
public void actionPerformed(ActionEvent e)
11
            public void actionPerformed(ActionEvent e)
21
			{
22
				setVisible(false);
23
			}
24
		});
25
		
12
 {
13
                setVisible(false);
14
            }
15
        });
26
result.add(cancelButton);
16
        result.add(_cancelButton);
27
		
28
return result;
17
        return result;
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 comparisons51
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    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
    JPanel result = new JPanel();
    1
    JPanel result = new JPanel();
    2
    executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
    2
    executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
    2
    _executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
    Differences
    Expression1Expression2Difference
    executeButton_executeButtonVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18nnet.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18nVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression executeButton is a field being modified, and thus it cannot be parameterized
    Expression _executeButton is a field being modified, and thus it cannot be parameterized
    Type net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n and net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n extend a common superclass
    2
    _executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
    3
    result.add(executeButton);
    3
    result.add(executeButton);
    3
    result.add(_executeButton);
    Differences
    Expression1Expression2Difference
    executeButton_executeButtonVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression executeButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _executeButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    result.add(_executeButton);
    4
    editSQLButton = new JButton(i18n.EDIT_BUTTON_LABEL);
    4
    editSQLButton = new JButton(i18n.EDIT_BUTTON_LABEL);
    4
    _editButton = new JButton(i18n.EDIT_BUTTON_LABEL);
    Differences
    Expression1Expression2Difference
    editSQLButton_editButtonVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18nnet.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18nVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n and net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n extend a common superclass
    4
    _editButton = new JButton(i18n.EDIT_BUTTON_LABEL);
    5
    result.add(editSQLButton);
    5
    result.add(editSQLButton);
    5
    result.add(_editButton);
    Differences
    Expression1Expression2Difference
    editSQLButton_editButtonVARIABLE_NAME_MISMATCH
    5
    result.add(_editButton);
    6
    showSQLButton = new JButton(i18n.SHOWSQL_BUTTON_LABEL);
    6
    showSQLButton = new JButton(i18n.SHOWSQL_BUTTON_LABEL);
    6
    _showButton = new JButton(i18n.SHOW_BUTTON_LABEL);
    Differences
    Expression1Expression2Difference
    showSQLButton_showButtonVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18nnet.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18nVARIABLE_TYPE_MISMATCH
    SHOWSQL_BUTTON_LABELSHOW_BUTTON_LABELVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n and net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n extend a common superclass
    6
    _showButton = new JButton(i18n.SHOW_BUTTON_LABEL);
    7
    result.add(showSQLButton);
    7
    result.add(showSQLButton);
    7
    result.add(_showButton);
    Differences
    Expression1Expression2Difference
    showSQLButton_showButtonVARIABLE_NAME_MISMATCH
    7
    result.add(_showButton);
    8
    cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
    8
    cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
    8
    _cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
    Differences
    Expression1Expression2Difference
    cancelButton_cancelButtonVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18nnet.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18nVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression cancelButton is a field being modified, and thus it cannot be parameterized
    Expression _cancelButton is a field being modified, and thus it cannot be parameterized
    Type net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n and net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n extend a common superclass
    8
    _cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
    9
    cancelButton.addActionListener(new ActionListener() {...});
    9
    cancelButton.addActionListener(new ActionListener() {...});
    9
    addCancelListener(new ActionListener() {...});
    Differences
    Expression1Expression2Difference
    addActionListeneraddCancelListenerMETHOD_INVOCATION_NAME_MISMATCH
    cancelButtonMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    9
    addCancelListener(new ActionListener() {...});
    10
    result.add(cancelButton);
    10
    result.add(cancelButton);
    10
    result.add(_cancelButton);
    Differences
    Expression1Expression2Difference
    cancelButton_cancelButtonVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    result.add(_cancelButton);
    11
    return result;
    11
    return result;
    Precondition Violations (20)
    Row Violation
    1Expression executeButton is a field being modified, and thus it cannot be parameterized
    2Expression _executeButton is a field being modified, and thus it cannot be parameterized
    3Type net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    4Expression executeButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression _executeButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    7Type net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    8Expression cancelButton is a field being modified, and thus it cannot be parameterized
    9Expression _cancelButton is a field being modified, and thus it cannot be parameterized
    10Type net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    11Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    14Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    15Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    18Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    19Expression cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression _cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted