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.writeScript"); String toolTipText = s_stringMgr.getString("PreferencesPanel.writeScriptToolTip"); writeScriptCheckBox = new JCheckBox(cbLabelStr); writeScriptCheckBox.setToolTipText(toolTipText); panel.add(writeScriptCheckBox, c);
GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.ipadx = 40; // Increases component width by 20 pixels c.insets = new Insets(5,5,0,0); c.anchor = GridBagConstraints.WEST; commitRecordCountTextField = new JTextField(10); commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT); String commitlabelToolTipText = s_stringMgr.getString("PreferencesPanel.commitRecordCountToolTip"); commitRecordCountTextField.setToolTipText(commitlabelToolTipText); panel.add(commitRecordCountTextField, 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 addWriteScriptCheckBox(JPanel, int, int) Method name: void addCommitRecordCountTextField(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.gridwidth = 2;  // Span across two columns
4
        c.ipadx = 40;      // Increases component width by 20 pixels
5
        c.insets = new Insets(10,0,0,0);
5
        c.insets = new Insets(5,5,0,0);
6
        c.anchor = GridBagConstraints.WEST;
6
        c.anchor = GridBagConstraints.WEST;
7
        String cbLabelStr =         
7
        
8
            s_stringMgr.getString("PreferencesPanel.writeScript"
8
commitRecordCountTextField = new JTextField(10);
9
);
9
        commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT);
10
        String toolTipText = 
10
        String commitlabelToolTipText = 
11
            s_stringMgr.getString("PreferencesPanel.writeScriptToolTip");
11
            s_stringMgr.getString("PreferencesPanel.commitRecordCountToolTip");
12
        writeScriptCheckBox = new JCheckBox(cbLabelStr);
12
        
13
        writeScriptCheckBox.setToolTipText(toolTipText);
13
commitRecordCountTextField.setToolTipText(commitlabelToolTipText);
14
        panel.add(writeScriptCheckBox, c);
14
        panel.add(commitRecordCountTextField, 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.gridwidth = 2;
    4
    c.gridwidth = 2;
    4
    c.ipadx = 40;
    Differences
    Expression1Expression2Difference
    gridwidthipadxVARIABLE_NAME_MISMATCH
    240LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression c.gridwidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c.ipadx cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c.gridwidth is a field being modified, and thus it cannot be parameterized
    Expression c.ipadx is a field being modified, and thus it cannot be parameterized
    4
    c.ipadx = 40;
    5
    c.insets = new Insets(10, 0, 0, 0);
    5
    c.insets = new Insets(10, 0, 0, 0);
    5
    c.insets = new Insets(5, 5, 0, 0);
    Differences
    Expression1Expression2Difference
    105LITERAL_VALUE_MISMATCH
    05LITERAL_VALUE_MISMATCH
    5
    c.insets = new Insets(5, 5, 0, 0);
    6
    c.anchor = GridBagConstraints.WEST;
    6
    c.anchor = GridBagConstraints.WEST;
                                                                                                      
    7
    commitRecordCountTextField = new JTextField(10);
    Preondition Violations
    Unmatched statement commitRecordCountTextField=new JTextField(10); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7
    commitRecordCountTextField = new JTextField(10);
    7
    String cbLabelStr = s_stringMgr.getString("PreferencesPanel.writeScript");
                                                                                                                                                          
    8
    String toolTipText = s_stringMgr.getString("PreferencesPanel.writeScriptToolTip");
    8
    String toolTipText = s_stringMgr.getString("PreferencesPanel.writeScriptToolTip");
    9
    String commitlabelToolTipText = s_stringMgr.getString("PreferencesPanel.commitRecordCountToolTip");
    Differences
    Expression1Expression2Difference
    toolTipTextcommitlabelToolTipTextVARIABLE_NAME_MISMATCH
    "PreferencesPanel.writeScriptToolTip""PreferencesPanel.commitRecordCountToolTip"LITERAL_VALUE_MISMATCH
    9
    String commitlabelToolTipText = s_stringMgr.getString("PreferencesPanel.commitRecordCountToolTip");
    9
    writeScriptCheckBox = new JCheckBox(cbLabelStr);
    9
    writeScriptCheckBox = new JCheckBox(cbLabelStr);
    Preondition Violations
    Unmatched statement writeScriptCheckBox=new JCheckBox(cbLabelStr); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                      
    10
    writeScriptCheckBox.setToolTipText(toolTipText);
    10
    writeScriptCheckBox.setToolTipText(toolTipText);
    10
    commitRecordCountTextField.setToolTipText(commitlabelToolTipText);
    Differences
    Expression1Expression2Difference
    toolTipTextcommitlabelToolTipTextVARIABLE_NAME_MISMATCH
    writeScriptCheckBoxcommitRecordCountTextFieldVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression writeScriptCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression commitRecordCountTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    commitRecordCountTextField.setToolTipText(commitlabelToolTipText);
    11
    panel.add(writeScriptCheckBox, c);
    11
    panel.add(writeScriptCheckBox, c);
    8
    commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT);
    Differences
    Expression1Expression2Difference
    addsetHorizontalAlignmentMETHOD_INVOCATION_NAME_MISMATCH
    panelcommitRecordCountTextFieldVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    panel.add(writeScriptCheckBox,c)commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression panel.add(writeScriptCheckBox,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(writeScriptCheckBox,c) is a void method call, and thus it cannot be parameterized
    Expression commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT) is a void method call, and thus it cannot be parameterized
    Expression commitRecordCountTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(writeScriptCheckBox,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(writeScriptCheckBox,c) is a void method call, and thus it cannot be parameterized
    Expression commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT) is a void method call, and thus it cannot be parameterized
    8
    commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT);
                                                                                            
    11
    panel.add(commitRecordCountTextField, c);
    Preondition Violations
    Unmatched statement panel.add(commitRecordCountTextField,c); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11
    panel.add(commitRecordCountTextField, c);
    Precondition Violations (18)
    Row Violation
    1Expression c.gridwidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression c.ipadx cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression c.gridwidth is a field being modified, and thus it cannot be parameterized
    4Expression c.ipadx is a field being modified, and thus it cannot be parameterized
    5Unmatched statement commitRecordCountTextField=new JTextField(10); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement writeScriptCheckBox=new JCheckBox(cbLabelStr); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Expression writeScriptCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression commitRecordCountTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression panel.add(writeScriptCheckBox,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression panel.add(writeScriptCheckBox,c) is a void method call, and thus it cannot be parameterized
    12Expression commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT) is a void method call, and thus it cannot be parameterized
    13Expression commitRecordCountTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression panel.add(writeScriptCheckBox,c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression panel.add(writeScriptCheckBox,c) is a void method call, and thus it cannot be parameterized
    17Expression commitRecordCountTextField.setHorizontalAlignment(JTextField.RIGHT) is a void method call, and thus it cannot be parameterized
    18Unmatched statement panel.add(commitRecordCountTextField,c); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted