GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.insets = new Insets(5,25,0,0); c.anchor = GridBagConstraints.WEST; JPanel subpanel = new JPanel(); //i18n[SQLScriptPreferencesPanel.updateActionLabel=Action to take on update:] String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.updateActionLabel"); updateActionLabel = new JLabel(cbLabelStr); updateActionLabel.setHorizontalAlignment(JLabel.LEFT); updateActionComboBox = new JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(new String[] { "NO ACTION", "CASCADE", "SET DEFAULT", "SET NULL"}); updateActionComboBox.setModel(model); subpanel.add(updateActionLabel); subpanel.add(updateActionComboBox); panel.add(subpanel, c);
GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.insets = new Insets(5,25,0,0); c.anchor = GridBagConstraints.WEST; JPanel subpanel = new JPanel(); //i18n[SQLScriptPreferencesPanel.deleteActionLabel=Action to take on delete:] String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteActionLabel"); deleteActionLabel = new JLabel(cbLabelStr); deleteActionLabel.setHorizontalAlignment(JLabel.LEFT); deleteActionComboBox = new JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(new String[] { "NO ACTION", "CASCADE", "SET DEFAULT", "SET NULL"}); deleteActionComboBox.setModel(model); subpanel.add(deleteActionLabel); subpanel.add(deleteActionComboBox); panel.add(subpanel, 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 addUpdateActionComboBox(JPanel, int, int) Method name: void addDeleteActionComboBox(JPanel, int, int)
Number of AST nodes: 15 Number of AST nodes: 15
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.insets = new Insets(5,25,0,0);
4
        c.insets = new Insets(5,25,0,0);
5
        c.anchor = GridBagConstraints.WEST;
5
        c.anchor = GridBagConstraints.WEST;
6
        
6
        
7
        JPanel subpanel = new JPanel();
7
        JPanel subpanel = new JPanel();
8
        
8
        
9
        //i18n[SQLScriptPreferencesPanel.updateActionLabel=Action to take on update:]
9
        //i18n[SQLScriptPreferencesPanel.deleteActionLabel=Action to take on delete:]
10
        String cbLabelStr = 
10
        String cbLabelStr = 
11
            s_stringMgr.getString("SQLScriptPreferencesPanel.updateActionLabel");
11
            s_stringMgr.getString("SQLScriptPreferencesPanel.deleteActionLabel");
12
        updateActionLabel = new JLabel(cbLabelStr);
12
        deleteActionLabel = new JLabel(cbLabelStr);
13
        updateActionLabel.setHorizontalAlignment(JLabel.LEFT);
13
        deleteActionLabel.setHorizontalAlignment(JLabel.LEFT);
14
                
14
                
15
        updateActionComboBox = new JComboBox();
15
        deleteActionComboBox = new JComboBox();
16
        DefaultComboBoxModel model = 
16
        DefaultComboBoxModel model = 
17
            new DefaultComboBoxModel(new String[] { "NO ACTION", 
17
            new DefaultComboBoxModel(new String[] { "NO ACTION", 
18
                                                    "CASCADE", 
18
                                                    "CASCADE", 
19
                                                    "SET DEFAULT",
19
                                                    "SET DEFAULT",
20
                                                    "SET NULL"});
20
                                                    "SET NULL"});
21
        updateActionComboBox.setModel(model);
21
        deleteActionComboBox.setModel(model);
22
        subpanel.add(updateActionLabel);
22
        subpanel.add(deleteActionLabel);
23
        subpanel.add(updateActionComboBox);
23
        subpanel.add(deleteActionComboBox);
24
        panel.add(subpanel, c);
24
        panel.add(subpanel, 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 comparisons91
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements15
    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.insets = new Insets(5, 25, 0, 0);
    4
    c.insets = new Insets(5, 25, 0, 0);
    5
    c.anchor = GridBagConstraints.WEST;
    5
    c.anchor = GridBagConstraints.WEST;
    6
    JPanel subpanel = new JPanel();
    6
    JPanel subpanel = new JPanel();
    7
    String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.updateActionLabel");
    7
    String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.updateActionLabel");
    7
    String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteActionLabel");
    Differences
    Expression1Expression2Difference
    "SQLScriptPreferencesPanel.updateActionLabel""SQLScriptPreferencesPanel.deleteActionLabel"LITERAL_VALUE_MISMATCH
    7
    String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteActionLabel");
    8
    updateActionLabel = new JLabel(cbLabelStr);
    8
    updateActionLabel = new JLabel(cbLabelStr);
    8
    deleteActionLabel = new JLabel(cbLabelStr);
    Differences
    Expression1Expression2Difference
    updateActionLabeldeleteActionLabelVARIABLE_NAME_MISMATCH
    8
    deleteActionLabel = new JLabel(cbLabelStr);
    9
    updateActionLabel.setHorizontalAlignment(JLabel.LEFT);
    9
    updateActionLabel.setHorizontalAlignment(JLabel.LEFT);
    9
    deleteActionLabel.setHorizontalAlignment(JLabel.LEFT);
    Differences
    Expression1Expression2Difference
    updateActionLabeldeleteActionLabelVARIABLE_NAME_MISMATCH
    9
    deleteActionLabel.setHorizontalAlignment(JLabel.LEFT);
    10
    updateActionComboBox = new JComboBox();
    10
    updateActionComboBox = new JComboBox();
    10
    deleteActionComboBox = new JComboBox();
    Differences
    Expression1Expression2Difference
    updateActionComboBoxdeleteActionComboBoxVARIABLE_NAME_MISMATCH
    10
    deleteActionComboBox = new JComboBox();
    11
    DefaultComboBoxModel model = new DefaultComboBoxModel(new String[] {"NO ACTION", "CASCADE", "SET DEFAULT", "SET NULL"});
    11
    DefaultComboBoxModel model = new DefaultComboBoxModel(new String[] {"NO ACTION", "CASCADE", "SET DEFAULT", "SET NULL"});
    12
    updateActionComboBox.setModel(model);
    12
    updateActionComboBox.setModel(model);
    12
    deleteActionComboBox.setModel(model);
    Differences
    Expression1Expression2Difference
    updateActionComboBoxdeleteActionComboBoxVARIABLE_NAME_MISMATCH
    12
    deleteActionComboBox.setModel(model);
    13
    subpanel.add(updateActionLabel);
    13
    subpanel.add(updateActionLabel);
    13
    subpanel.add(deleteActionLabel);
    Differences
    Expression1Expression2Difference
    updateActionLabeldeleteActionLabelVARIABLE_NAME_MISMATCH
    13
    subpanel.add(deleteActionLabel);
    14
    subpanel.add(updateActionComboBox);
    14
    subpanel.add(updateActionComboBox);
    14
    subpanel.add(deleteActionComboBox);
    Differences
    Expression1Expression2Difference
    updateActionComboBoxdeleteActionComboBoxVARIABLE_NAME_MISMATCH
    14
    subpanel.add(deleteActionComboBox);
    15
    panel.add(subpanel, c);
    15
    panel.add(subpanel, c);
    Precondition Violations (0)
    Row Violation