GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.gridwidth = 2; // Span across two columns c.insets = new Insets(10,0,0,0); c.anchor = GridBagConstraints.WEST; String cbLabelStr = s_stringMgr.getString("PreferencesPanel.copyTableRecords"); String toolTipText = s_stringMgr.getString("PreferencesPanel.copyTableRecordsToolTip"); copyTableRecords = new JCheckBox(cbLabelStr); copyTableRecords.setToolTipText(toolTipText); copyTableRecords.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } }); panel.add(copyTableRecords, c);
GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.gridwidth = 2; // Span across two columns c.insets = new Insets(10,0,0,0); c.anchor = GridBagConstraints.WEST; String cbLabelStr = s_stringMgr.getString("PreferencesPanel.copyIndexDefs"); String toolTipText = s_stringMgr.getString("PreferencesPanel.copyIndexDefsToolTip"); copyIndexDefs = new JCheckBox(cbLabelStr); copyIndexDefs.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } }); copyIndexDefs.setToolTipText(toolTipText); panel.add(copyIndexDefs, c);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/gui/PreferencesPanel.java File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/gui/PreferencesPanel.java
Method name: void addCopyTableRecordsCheckBox(JPanel, int, int) Method name: void addCopyIndexDefsCheckBox(JPanel, int, int)
Number of AST nodes: 12 Number of AST nodes: 12
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.gridwidth = 2;  // Span across two columns
4
        c.gridwidth = 2;  // Span across two columns
5
        c.insets = new Insets(10,0,0,0);
5
        c.insets = new Insets(10,0,0,0);
6
        c.anchor = GridBagConstraints.WEST;
6
        c.anchor = GridBagConstraints.WEST;
7
        String cbLabelStr =         
7
        String cbLabelStr =         
8
            s_stringMgr.getString("PreferencesPanel.copyTableRecords");
8
            s_stringMgr.getString("PreferencesPanel.copyIndexDefs");
9
        String toolTipText = 
9
        String toolTipText = 
10
            s_stringMgr.getString("PreferencesPanel.copyTableRecordsToolTip");
10
            s_stringMgr.getString("PreferencesPanel.copyIndexDefsToolTip");
11
        copyTableRecords = new JCheckBox(cbLabelStr);
11
        copyIndexDefs = new JCheckBox(cbLabelStr);
12
        copyTableRecords.setToolTipText(toolTipText);
12
        copy
13
        copyTableRecords.addActionListener(new ActionListener() {
13
IndexDefs.addActionListener(new ActionListener() {
14
            public void actionPerformed(ActionEvent e) {
14
            public void actionPerformed(ActionEvent e) {
15
                selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected());
15
                if (copyIndexDefs.isSelected()) {
16
                selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected());
16
                
17
            }
18
        }
17
    pruneDuplicateIndexDefs.setEnabled(true);
18
                } else {
19
                    pruneDuplicateIndexDefs.setEnabled(false);
20
                }
21
            }
22
        });
19
);
23
        copyIndexDefs.setToolTipText(toolTipText);
20
        panel.add(copyTableRecords, c);
24
        panel.add(copyIndexDefs, c);
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 declared in the same class
Number of node comparisons68
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    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.gridwidth = 2;
    4
    c.gridwidth = 2;
    5
    c.insets = new Insets(10, 0, 0, 0);
    5
    c.insets = new Insets(10, 0, 0, 0);
    6
    c.anchor = GridBagConstraints.WEST;
    6
    c.anchor = GridBagConstraints.WEST;
    7
    String cbLabelStr = s_stringMgr.getString("PreferencesPanel.copyTableRecords");
    7
    String cbLabelStr = s_stringMgr.getString("PreferencesPanel.copyTableRecords");
    7
    String cbLabelStr = s_stringMgr.getString("PreferencesPanel.copyIndexDefs");
    Differences
    Expression1Expression2Difference
    "PreferencesPanel.copyTableRecords""PreferencesPanel.copyIndexDefs"LITERAL_VALUE_MISMATCH
    7
    String cbLabelStr = s_stringMgr.getString("PreferencesPanel.copyIndexDefs");
    8
    String toolTipText = s_stringMgr.getString("PreferencesPanel.copyTableRecordsToolTip");
    8
    String toolTipText = s_stringMgr.getString("PreferencesPanel.copyTableRecordsToolTip");
    8
    String toolTipText = s_stringMgr.getString("PreferencesPanel.copyIndexDefsToolTip");
    Differences
    Expression1Expression2Difference
    "PreferencesPanel.copyTableRecordsToolTip""PreferencesPanel.copyIndexDefsToolTip"LITERAL_VALUE_MISMATCH
    8
    String toolTipText = s_stringMgr.getString("PreferencesPanel.copyIndexDefsToolTip");
    9
    copyTableRecords = new JCheckBox(cbLabelStr);
    9
    copyTableRecords = new JCheckBox(cbLabelStr);
    9
    copyIndexDefs = new JCheckBox(cbLabelStr);
    Differences
    Expression1Expression2Difference
    copyTableRecordscopyIndexDefsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression copyTableRecords is a field being modified, and thus it cannot be parameterized
    Expression copyIndexDefs is a field being modified, and thus it cannot be parameterized
    9
    copyIndexDefs = new JCheckBox(cbLabelStr);
    10
    copyTableRecords.setToolTipText(toolTipText);
    10
    copyTableRecords.setToolTipText(toolTipText);
    11
    copyIndexDefs.setToolTipText(toolTipText);
    Differences
    Expression1Expression2Difference
    copyTableRecordscopyIndexDefsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression copyTableRecords cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression copyIndexDefs cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    copyIndexDefs.setToolTipText(toolTipText);
    11
    copyTableRecords.addActionListener(new ActionListener() {...});
    11
    copyTableRecords.addActionListener(new ActionListener() {...});
    12
    panel.add(copyIndexDefs, c);
    Differences
    Expression1Expression2Difference
    addActionListeneraddMETHOD_INVOCATION_NAME_MISMATCH
    copyTableRecordspanelVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } )panel.add(copyIndexDefs,c)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(copyIndexDefs,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } ) is a void method call, and thus it cannot be parameterized
    Expression panel.add(copyIndexDefs,c) is a void method call, and thus it cannot be parameterized
    Expression copyTableRecords cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(copyIndexDefs,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } ) is a void method call, and thus it cannot be parameterized
    Expression panel.add(copyIndexDefs,c) is a void method call, and thus it cannot be parameterized
    12
    panel.add(copyIndexDefs, c);
    12
    panel.add(copyTableRecords, c);
    12
    panel.add(copyTableRecords, c);
    10
    copyIndexDefs.addActionListener(new ActionListener() {...});
    Differences
    Expression1Expression2Difference
    addaddActionListenerMETHOD_INVOCATION_NAME_MISMATCH
    panelcopyIndexDefsVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    panel.add(copyTableRecords,c)copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } )ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression panel.add(copyTableRecords,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(copyTableRecords,c) is a void method call, and thus it cannot be parameterized
    Expression copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } ) is a void method call, and thus it cannot be parameterized
    Expression copyIndexDefs cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(copyTableRecords,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(copyTableRecords,c) is a void method call, and thus it cannot be parameterized
    Expression copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } ) is a void method call, and thus it cannot be parameterized
    10
    copyIndexDefs.addActionListener(new ActionListener() {...});
    Precondition Violations (22)
    Row Violation
    1Expression copyTableRecords is a field being modified, and thus it cannot be parameterized
    2Expression copyIndexDefs is a field being modified, and thus it cannot be parameterized
    3Expression copyTableRecords cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression copyIndexDefs cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression panel.add(copyIndexDefs,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } ) is a void method call, and thus it cannot be parameterized
    8Expression panel.add(copyIndexDefs,c) is a void method call, and thus it cannot be parameterized
    9Expression copyTableRecords cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression panel.add(copyIndexDefs,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression copyTableRecords.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ selectFetchSizeLabel.setEnabled(copyTableRecords.isSelected()); selectFetchSizeTextField.setEnabled(copyTableRecords.isSelected()); } } ) is a void method call, and thus it cannot be parameterized
    13Expression panel.add(copyIndexDefs,c) is a void method call, and thus it cannot be parameterized
    14Expression panel.add(copyTableRecords,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression panel.add(copyTableRecords,c) is a void method call, and thus it cannot be parameterized
    17Expression copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } ) is a void method call, and thus it cannot be parameterized
    18Expression copyIndexDefs cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression panel.add(copyTableRecords,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } ) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression panel.add(copyTableRecords,c) is a void method call, and thus it cannot be parameterized
    22Expression copyIndexDefs.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ if (copyIndexDefs.isSelected()) { pruneDuplicateIndexDefs.setEnabled(true); } else { pruneDuplicateIndexDefs.setEnabled(false); } } } ) is a void method call, and thus it cannot be parameterized