GridBagConstraints gbc; JPanel pnlButtons = new JPanel(new GridBagLayout()); // i18n[codeCompletion.prefixConfig.newRow=Add new row] btnNewRow = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.newRow")); gbc = new GridBagConstraints(0,0,1,1,1,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,0,5,5),0,0); pnlButtons.add(btnNewRow, gbc); // i18n[codeCompletion.prefixConfig.deleteSelRows=Delete selected rows] btnDeleteRows = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.deleteSelRows")); gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,5,5,5),0,0); pnlButtons.add(btnDeleteRows, gbc); return pnlButtons;
JPanel ret = new JPanel(new GridBagLayout()); GridBagConstraints gbc; gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0); // i18n[HibernateConfigPanel.classPathAdd=Add classpath entry] btnClassPathAdd = new JButton(s_stringMgr.getString("HibernatePanel.classPathAdd")); ret.add(btnClassPathAdd, gbc); gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0); // i18n[HibernateConfigPanel.classPathRemove=Remove selected entries] btnClassPathRemove = new JButton(s_stringMgr.getString("HibernatePanel.classPathRemove")); ret.add(btnClassPathRemove, gbc); return ret;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/codecompletion/src/net/sourceforge/squirrel_sql/plugins/codecompletion/prefs/CodeCompletionPreferencesPanel.java File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/configuration/HibernateConfigPanel.java
Method name: JPanel createButtonsPanel() Method name: JPanel createButtonClasspathPanel()
Number of AST nodes: 9 Number of AST nodes: 9
1
GridBagConstraints gbc;
2
      JPanel pnlButtons = new JPanel(new GridBagLayout());
1
JPanel ret = new JPanel(new GridBagLayout());
3
      // i18n[codeCompletion.prefixConfig.newRow=Add new row]
2
      
4
      btnNewRow = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.newRow"));
3
GridBagConstraints gbc;
5
      gbc = new GridBagConstraints(0,0,1,1,1,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,0,5,5),0,0);
4
      gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0);
6
      pnlButtons.add(btnNewRow, gbc);
5
      
7
      // i18n[codeCompletion.prefixConfig.deleteSelRows=Delete selected rows]
8
      btnDeleteRows = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.deleteSelRows")
6
// i18n[HibernateConfigPanel.classPathAdd=Add classpath entry]
7
      btnClassPathAdd = new JButton(s_stringMgr.getString("HibernatePanel.classPathAdd"));
9
);
8
      ret.add(btnClassPathAdd, gbc);
10
      gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,5,5,5),0,0);
9
      gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0);
11
      pnlButtons.add(btnDeleteRows
10
      // i18n[HibernateConfigPanel.classPathRemove=Remove selected entries]
11
      btnClassPathRemove = new JButton(s_stringMgr.getString("HibernatePanel.classPathRemove"));
12
, gbc);
12
      ret.add(btnClassPathRemove, gbc);
13
      return pnlButtons;
13
      return ret;
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 in different classes having the same super class
Number of node comparisons33
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    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 gbc;
    2
    GridBagConstraints gbc;
    2
    JPanel pnlButtons = new JPanel(new GridBagLayout());
    2
    JPanel pnlButtons = new JPanel(new GridBagLayout());
    1
    JPanel ret = new JPanel(new GridBagLayout());
    Differences
    Expression1Expression2Difference
    pnlButtonsretVARIABLE_NAME_MISMATCH
    1
    JPanel ret = new JPanel(new GridBagLayout());
    3
    btnNewRow = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.newRow"));
    3
    btnNewRow = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.newRow"));
    4
    btnClassPathAdd = new JButton(s_stringMgr.getString("HibernatePanel.classPathAdd"));
    Differences
    Expression1Expression2Difference
    btnNewRowbtnClassPathAddVARIABLE_NAME_MISMATCH
    "codeCompletion.prefixConfig.newRow""HibernatePanel.classPathAdd"LITERAL_VALUE_MISMATCH
    4
    btnClassPathAdd = new JButton(s_stringMgr.getString("HibernatePanel.classPathAdd"));
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0);
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0);
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    10LITERAL_VALUE_MISMATCH
    NORTHWESTWESTVARIABLE_NAME_MISMATCH
    05LITERAL_VALUE_MISMATCH
    05LITERAL_VALUE_MISMATCH
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    5
    pnlButtons.add(btnNewRow, gbc);
    5
    pnlButtons.add(btnNewRow, gbc);
    5
    ret.add(btnClassPathAdd, gbc);
    Differences
    Expression1Expression2Difference
    btnNewRowbtnClassPathAddVARIABLE_NAME_MISMATCH
    pnlButtonsretVARIABLE_NAME_MISMATCH
    5
    ret.add(btnClassPathAdd, gbc);
    6
    btnDeleteRows = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.deleteSelRows"));
    6
    btnDeleteRows = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.deleteSelRows"));
    7
    btnClassPathRemove = new JButton(s_stringMgr.getString("HibernatePanel.classPathRemove"));
    Differences
    Expression1Expression2Difference
    btnDeleteRowsbtnClassPathRemoveVARIABLE_NAME_MISMATCH
    "codeCompletion.prefixConfig.deleteSelRows""HibernatePanel.classPathRemove"LITERAL_VALUE_MISMATCH
    7
    btnClassPathRemove = new JButton(s_stringMgr.getString("HibernatePanel.classPathRemove"));
    7
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    7
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    NORTHWESTWESTVARIABLE_NAME_MISMATCH
    05LITERAL_VALUE_MISMATCH
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    8
    pnlButtons.add(btnDeleteRows, gbc);
    8
    pnlButtons.add(btnDeleteRows, gbc);
    8
    ret.add(btnClassPathRemove, gbc);
    Differences
    Expression1Expression2Difference
    btnDeleteRowsbtnClassPathRemoveVARIABLE_NAME_MISMATCH
    pnlButtonsretVARIABLE_NAME_MISMATCH
    8
    ret.add(btnClassPathRemove, gbc);
    9
    return pnlButtons;
    9
    return pnlButtons;
    9
    return ret;
    Differences
    Expression1Expression2Difference
    pnlButtonsretVARIABLE_NAME_MISMATCH
    9
    return ret;
    Precondition Violations (0)
    Row Violation