GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.ipadx = 40; // Increases component width by 40 pixels c.insets = new Insets(5,5,0,0); c.anchor = GridBagConstraints.WEST; bufferSizeTextField = new JTextField(10); bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT); String toolTip = s_stringMgr.getString("PreferencesPanel.bufferSizeTextFieldToolTip"); bufferSizeTextField.setToolTipText(toolTip); panel.add(bufferSizeTextField, c);
GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.gridwidth = 2; // Span across two columns //c.ipadx = 40; c.insets = new Insets(10,25,0,0); c.anchor = GridBagConstraints.WEST; String cbLabelStr = s_stringMgr.getString("PreferencesPanel.commitAfterCreateTable"); String toolTipText = s_stringMgr.getString("PreferencesPanel.commitAfterCreateTableToolTip"); commitAfterCreateTableCheckBox = new JCheckBox(cbLabelStr); commitAfterCreateTableCheckBox.setToolTipText(toolTipText); panel.add(commitAfterCreateTableCheckBox, 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 addBufferSizeTextField(JPanel, int, int) Method name: void addCommitAfterCreateTableCheckBox(JPanel, int, int)
Number of AST nodes: 11 Number of AST nodes: 11
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.ipadx = 40;    // Increases component width by 40 pixels
4
        c.gridwidth = 2;  // Span across two columns
5
        //c.ipadx = 40;
5
        c.insets = new Insets(5,5,0,0);
6
        c.insets = new Insets(10,25,0,0);
6
        c.anchor = GridBagConstraints.WEST;
7
        c.anchor = GridBagConstraints.WEST;
7
        bufferSizeTextField = new JTextField(10);
8
        
8
        bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT
9
String cbLabelStr =         
9
);
10
            s_stringMgr.getString("PreferencesPanel.commitAfterCreateTable");
10
        String toolTip = 
11
        String toolTipText = 
11
            s_stringMgr.getString("PreferencesPanel.bufferSizeTextFieldToolTip");
12
            s_stringMgr.getString("PreferencesPanel.
12
        bufferSizeTextField
13
commitAfterCreateTableToolTip");
14
        commitAfterCreateTableCheckBox = new JCheckBox(cbLabelStr);
13
.setToolTipText(toolTip);
15
        commitAfterCreateTableCheckBox.setToolTipText(toolTipText);
14
        panel.add(bufferSizeTextField, c);
16
        panel.add(commitAfterCreateTableCheckBox, 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 comparisons67
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    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.ipadx = 40;
    4
    c.ipadx = 40;
    4
    c.gridwidth = 2;
    Differences
    Expression1Expression2Difference
    ipadxgridwidthVARIABLE_NAME_MISMATCH
    402LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression c.ipadx cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c.gridwidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c.ipadx is a field being modified, and thus it cannot be parameterized
    Expression c.gridwidth is a field being modified, and thus it cannot be parameterized
    4
    c.gridwidth = 2;
    5
    c.insets = new Insets(5, 5, 0, 0);
    5
    c.insets = new Insets(5, 5, 0, 0);
    5
    c.insets = new Insets(10, 25, 0, 0);
    Differences
    Expression1Expression2Difference
    510LITERAL_VALUE_MISMATCH
    525LITERAL_VALUE_MISMATCH
    5
    c.insets = new Insets(10, 25, 0, 0);
    6
    c.anchor = GridBagConstraints.WEST;
    6
    c.anchor = GridBagConstraints.WEST;
                                                                                                                                                                                
    7
    String cbLabelStr = s_stringMgr.getString("PreferencesPanel.commitAfterCreateTable");
    7
    bufferSizeTextField = new JTextField(10);
    7
    bufferSizeTextField = new JTextField(10);
    Preondition Violations
    Unmatched statement bufferSizeTextField=new JTextField(10); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                        
    8
    bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT);
    8
    bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT);
    11
    panel.add(commitAfterCreateTableCheckBox, c);
    Differences
    Expression1Expression2Difference
    setHorizontalAlignmentaddMETHOD_INVOCATION_NAME_MISMATCH
    bufferSizeTextFieldpanelVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT)panel.add(commitAfterCreateTableCheckBox,c)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(commitAfterCreateTableCheckBox,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT) is a void method call, and thus it cannot be parameterized
    Expression panel.add(commitAfterCreateTableCheckBox,c) is a void method call, and thus it cannot be parameterized
    Expression bufferSizeTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(commitAfterCreateTableCheckBox,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT) is a void method call, and thus it cannot be parameterized
    Expression panel.add(commitAfterCreateTableCheckBox,c) is a void method call, and thus it cannot be parameterized
    11
    panel.add(commitAfterCreateTableCheckBox, c);
    9
    String toolTip = s_stringMgr.getString("PreferencesPanel.bufferSizeTextFieldToolTip");
    9
    String toolTip = s_stringMgr.getString("PreferencesPanel.bufferSizeTextFieldToolTip");
    8
    String toolTipText = s_stringMgr.getString("PreferencesPanel.commitAfterCreateTableToolTip");
    Differences
    Expression1Expression2Difference
    toolTiptoolTipTextVARIABLE_NAME_MISMATCH
    "PreferencesPanel.bufferSizeTextFieldToolTip""PreferencesPanel.commitAfterCreateTableToolTip"LITERAL_VALUE_MISMATCH
    8
    String toolTipText = s_stringMgr.getString("PreferencesPanel.commitAfterCreateTableToolTip");
                                                                                                                            
    9
    commitAfterCreateTableCheckBox = new JCheckBox(cbLabelStr);
    Preondition Violations
    Unmatched statement commitAfterCreateTableCheckBox=new JCheckBox(cbLabelStr); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    9
    commitAfterCreateTableCheckBox = new JCheckBox(cbLabelStr);
    10
    bufferSizeTextField.setToolTipText(toolTip);
    10
    bufferSizeTextField.setToolTipText(toolTip);
    10
    commitAfterCreateTableCheckBox.setToolTipText(toolTipText);
    Differences
    Expression1Expression2Difference
    toolTiptoolTipTextVARIABLE_NAME_MISMATCH
    bufferSizeTextFieldcommitAfterCreateTableCheckBoxVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression bufferSizeTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression commitAfterCreateTableCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    commitAfterCreateTableCheckBox.setToolTipText(toolTipText);
    11
    panel.add(bufferSizeTextField, c);
    11
    panel.add(bufferSizeTextField, c);
    Preondition Violations
    Unmatched statement panel.add(bufferSizeTextField,c); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                              
    Precondition Violations (18)
    Row Violation
    1Expression c.ipadx cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression c.gridwidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression c.ipadx is a field being modified, and thus it cannot be parameterized
    4Expression c.gridwidth is a field being modified, and thus it cannot be parameterized
    5Unmatched statement bufferSizeTextField=new JTextField(10); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Expression bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression panel.add(commitAfterCreateTableCheckBox,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT) is a void method call, and thus it cannot be parameterized
    9Expression panel.add(commitAfterCreateTableCheckBox,c) is a void method call, and thus it cannot be parameterized
    10Expression bufferSizeTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression panel.add(commitAfterCreateTableCheckBox,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression bufferSizeTextField.setHorizontalAlignment(JTextField.RIGHT) is a void method call, and thus it cannot be parameterized
    14Expression panel.add(commitAfterCreateTableCheckBox,c) is a void method call, and thus it cannot be parameterized
    15Unmatched statement commitAfterCreateTableCheckBox=new JCheckBox(cbLabelStr); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    16Expression bufferSizeTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression commitAfterCreateTableCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Unmatched statement panel.add(bufferSizeTextField,c); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted