JPanel result = new JPanel(); executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL); editSQLButton = new JButton(i18n.EDIT_BUTTON_LABEL); showSQLButton = new JButton(i18n.SHOW_BUTTON_LABEL); cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); } }); result.add(executeButton); result.add(editSQLButton); result.add(showSQLButton); 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/app/src/net/sourceforge/squirrel_sql/client/gui/db/ColumnDetailDialog.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

2
        executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
3
        _executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
4
        result.add(_executeButton);
3
        editSQLButton = new JButton(i18n.EDIT_BUTTON_LABEL);
5
        _editButton = new JButton(i18n.EDIT_BUTTON_LABEL);
4
        
6
        result.add(_editButton);
5
showSQLButton = new JButton(i18n.SHOW_BUTTON_LABEL);
7
        _showButton = new JButton(i18n.SHOW_BUTTON_LABEL);
6
        
8
        result.add(_showButton);
7
cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
9
        _cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
8
        cancelButton.addActionListener(new ActionListener() {
10
        addCancelListener(new ActionListener() {
9
            public void actionPerformed(ActionEvent e) {
11
            public void actionPerformed(ActionEvent e) {
10
                setVisible(false);
12
                setVisible(false);
11
            }
13
            }
12
        });
14
        });
13
        result.add(executeButton);
14
        result.add(editSQLButton);
15
        result.add(showSQLButton);
15

16
        result.add(cancelButton);
16
        result.add(_cancelButton);
17

17
        return result;
18
        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.client.gui.db.ColumnDetailDialog.i18nnet.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18nVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    • Make classes net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n and net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n extend a common superclass
    2
    _executeButton = new JButton(i18n.EXECUTE_BUTTON_LABEL);
    3
    editSQLButton = new JButton(i18n.EDIT_BUTTON_LABEL);
    3
    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.client.gui.db.ColumnDetailDialog.i18nnet.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18nVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    • Make classes net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n and net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n extend a common superclass
    4
    _editButton = new JButton(i18n.EDIT_BUTTON_LABEL);
    4
    showSQLButton = new JButton(i18n.SHOW_BUTTON_LABEL);
    4
    showSQLButton = new JButton(i18n.SHOW_BUTTON_LABEL);
    6
    _showButton = new JButton(i18n.SHOW_BUTTON_LABEL);
    Differences
    Expression1Expression2Difference
    showSQLButton_showButtonVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18nnet.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18nVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    • Make classes net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n and net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n extend a common superclass
    6
    _showButton = new JButton(i18n.SHOW_BUTTON_LABEL);
    5
    cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
    5
    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.client.gui.db.ColumnDetailDialog.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.client.gui.db.ColumnDetailDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    • Make classes net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n and net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n extend a common superclass
    8
    _cancelButton = new JButton(i18n.CANCEL_BUTTON_LABEL);
    6
    cancelButton.addActionListener(new ActionListener() {...});
    6
    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() {...});
    7
    result.add(executeButton);
    7
    result.add(executeButton);
    3
    result.add(_executeButton);
    Differences
    Expression1Expression2Difference
    executeButton_executeButtonVARIABLE_NAME_MISMATCH
    3
    result.add(_executeButton);
    8
    result.add(editSQLButton);
    8
    result.add(editSQLButton);
    5
    result.add(_editButton);
    Differences
    Expression1Expression2Difference
    editSQLButton_editButtonVARIABLE_NAME_MISMATCH
    5
    result.add(_editButton);
    9
    result.add(showSQLButton);
    9
    result.add(showSQLButton);
    7
    result.add(_showButton);
    Differences
    Expression1Expression2Difference
    showSQLButton_showButtonVARIABLE_NAME_MISMATCH
    7
    result.add(_showButton);
    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 (16)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    2Type net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    3Type net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    4Expression cancelButton is a field being modified, and thus it cannot be parameterized
    5Expression _cancelButton is a field being modified, and thus it cannot be parameterized
    6Type net.sourceforge.squirrel_sql.client.gui.db.ColumnDetailDialog.i18n does not match with type net.sourceforge.squirrel_sql.plugins.postgres.gui.AbstractPostgresDialog.i18n
    7Expression 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
    8Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression cancelButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    10Expression addCancelListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ setVisible(false); } } ) is a void method call, and thus it cannot be parameterized
    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 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression _cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted