GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.anchor = GridBagConstraints.WEST; //i18n[SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel=Add delete //referential action to the FK definition] String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel"); // i18n[SQLScriptPreferencesPanel.deleteRefActionToolTip=Append ON DELETE ...] String cbToolTipText = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionToolTip"); deleteReferentialActionCheckbox = new JCheckBox(cbLabelStr); deleteReferentialActionCheckbox.setToolTipText(cbToolTipText); deleteReferentialActionCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean enabled = deleteReferentialActionCheckbox.isSelected(); deleteActionLabel.setEnabled(enabled); deleteActionComboBox.setEnabled(enabled); } }); panel.add(deleteReferentialActionCheckbox, c);
GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.anchor = GridBagConstraints.WEST; //i18n[SQLScriptPreferencesPanel.updateRefActionCheckboxLabel=Add update //referential action to the FK definition] String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionCheckboxLabel"); // i18n[SQLScriptPreferencesPanel.updateRefActionToolTip=Append ON UPDATE ...] String cbToolTipText = s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionToolTip"); updateReferentialActionCheckbox = new JCheckBox(cbLabelStr); updateReferentialActionCheckbox.setToolTipText(cbToolTipText); updateReferentialActionCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean enabled = updateReferentialActionCheckbox.isSelected(); updateActionLabel.setEnabled(enabled); updateActionComboBox.setEnabled(enabled); } }); panel.add(updateReferentialActionCheckbox, c);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesPanel.java File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesPanel.java
Method name: void addDeleteRefActionCheckBox(JPanel, int, int) Method name: void addUpdateRefActionCheckBox(JPanel, int, int)
Number of AST nodes: 10 Number of AST nodes: 10
1
GridBagConstraints c = new GridBagConstraints();
1
GridBagConstraints c = new GridBagConstraints();
2
        c.gridx = col;
2
        c.gridx = col;
3
        c.gridy = row;  
3
        c.gridy = row;  
4
        c.anchor = GridBagConstraints.WEST;
4
        c.anchor = GridBagConstraints.WEST;
5
        //i18n[SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel=Add delete 
5
        //i18n[SQLScriptPreferencesPanel.updateRefActionCheckboxLabel=Add update 
6
        //referential action to the FK definition]
6
        //referential action to the FK definition]
7
        String cbLabelStr = 
7
        String cbLabelStr = 
8
            s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel");
8
            s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionCheckboxLabel");
9
        // i18n[SQLScriptPreferencesPanel.deleteRefActionToolTip=Append ON DELETE ...]
9
        // i18n[SQLScriptPreferencesPanel.updateRefActionToolTip=Append ON UPDATE ...]
10
        String cbToolTipText = 
10
        String cbToolTipText = 
11
            s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionToolTip");
11
            s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionToolTip");
12
        deleteReferentialActionCheckbox = new JCheckBox(cbLabelStr);
12
        updateReferentialActionCheckbox = new JCheckBox(cbLabelStr);
13
        deleteReferentialActionCheckbox.setToolTipText(cbToolTipText);
13
        updateReferentialActionCheckbox.setToolTipText(cbToolTipText);
14
        deleteReferentialActionCheckbox.addActionListener(new ActionListener() {
14
        updateReferentialActionCheckbox.addActionListener(new ActionListener() {
15
            public void actionPerformed(ActionEvent e) {
15
            public void actionPerformed(ActionEvent e) {
16
                boolean enabled = deleteReferentialActionCheckbox.isSelected();
16
                boolean enabled = updateReferentialActionCheckbox.isSelected();
17
                deleteActionLabel.setEnabled(enabled);
17
                updateActionLabel.setEnabled(enabled);
18
                deleteActionComboBox.setEnabled(enabled);
18
                updateActionComboBox.setEnabled(enabled);
19
            }
19
            }
20
        });
20
        });
21
        panel.add(deleteReferentialActionCheckbox, c);
21
        panel.add(updateReferentialActionCheckbox, c);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons46
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    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
    GridBagConstraints c = new GridBagConstraints();
    1
    GridBagConstraints c = new GridBagConstraints();
    2
    c.gridx = col;
    2
    c.gridx = col;
    3
    c.gridy = row;
    3
    c.gridy = row;
    4
    c.anchor = GridBagConstraints.WEST;
    4
    c.anchor = GridBagConstraints.WEST;
    5
    String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel");
    5
    String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel");
    5
    String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionCheckboxLabel");
    Differences
    Expression1Expression2Difference
    "SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel""SQLScriptPreferencesPanel.updateRefActionCheckboxLabel"LITERAL_VALUE_MISMATCH
    5
    String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionCheckboxLabel");
    6
    String cbToolTipText = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionToolTip");
    6
    String cbToolTipText = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionToolTip");
    6
    String cbToolTipText = s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionToolTip");
    Differences
    Expression1Expression2Difference
    "SQLScriptPreferencesPanel.deleteRefActionToolTip""SQLScriptPreferencesPanel.updateRefActionToolTip"LITERAL_VALUE_MISMATCH
    6
    String cbToolTipText = s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionToolTip");
    7
    deleteReferentialActionCheckbox = new JCheckBox(cbLabelStr);
    7
    deleteReferentialActionCheckbox = new JCheckBox(cbLabelStr);
    7
    updateReferentialActionCheckbox = new JCheckBox(cbLabelStr);
    Differences
    Expression1Expression2Difference
    deleteReferentialActionCheckboxupdateReferentialActionCheckboxVARIABLE_NAME_MISMATCH
    7
    updateReferentialActionCheckbox = new JCheckBox(cbLabelStr);
    8
    deleteReferentialActionCheckbox.setToolTipText(cbToolTipText);
    8
    deleteReferentialActionCheckbox.setToolTipText(cbToolTipText);
    8
    updateReferentialActionCheckbox.setToolTipText(cbToolTipText);
    Differences
    Expression1Expression2Difference
    deleteReferentialActionCheckboxupdateReferentialActionCheckboxVARIABLE_NAME_MISMATCH
    8
    updateReferentialActionCheckbox.setToolTipText(cbToolTipText);
    9
    deleteReferentialActionCheckbox.addActionListener(new ActionListener() {...});
    9
    deleteReferentialActionCheckbox.addActionListener(new ActionListener() {...});
    9
    updateReferentialActionCheckbox.addActionListener(new ActionListener() {...});
    Differences
    Expression1Expression2Difference
    deleteReferentialActionCheckboxupdateReferentialActionCheckboxVARIABLE_NAME_MISMATCH
    deleteActionLabelupdateActionLabelVARIABLE_NAME_MISMATCH
    deleteActionComboBoxupdateActionComboBoxVARIABLE_NAME_MISMATCH
    deleteReferentialActionCheckboxupdateReferentialActionCheckboxVARIABLE_NAME_MISMATCH
    9
    updateReferentialActionCheckbox.addActionListener(new ActionListener() {...});
    10
    panel.add(deleteReferentialActionCheckbox, c);
    10
    panel.add(deleteReferentialActionCheckbox, c);
    10
    panel.add(updateReferentialActionCheckbox, c);
    Differences
    Expression1Expression2Difference
    deleteReferentialActionCheckboxupdateReferentialActionCheckboxVARIABLE_NAME_MISMATCH
    10
    panel.add(updateReferentialActionCheckbox, c);
    Precondition Violations (0)
    Row Violation