JPanel ret = new JPanel(); ret.setLayout(new GridBagLayout()); GridBagConstraints gbc; gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0); btnYes = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes")); ret.add(btnYes, gbc); gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0); btnNo = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no")); ret.add(btnNo, gbc); return ret;
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/app/src/net/sourceforge/squirrel_sql/client/gui/desktopcontainer/TabbedStyleHintDlg.java File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/configuration/HibernateConfigPanel.java
Method name: JPanel createButtonPanel() Method name: JPanel createButtonClasspathPanel()
Number of AST nodes: 10 Number of AST nodes: 9
1
JPanel ret = new JPanel();
1
JPanel ret = new JPanel(
2
      ret.setLayout(new GridBagLayout());
2
new GridBagLayout());
3
      GridBagConstraints gbc;
3
      GridBagConstraints gbc;
4
      gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5,5,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);
5
      btnYes
5
      // i18n[HibernateConfigPanel.classPathAdd=Add classpath entry]
6
 = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
6
      btnClassPathAdd = new JButton(s_stringMgr.getString("HibernatePanel.classPathAdd"));
7
      ret.add(btnYes, gbc);
7
      ret.add(btnClassPathAdd, gbc);
8
      gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0);
8
      gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0);
9
      btnNo
9
      // i18n[HibernateConfigPanel.classPathRemove=Remove selected entries]
10
 = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no"));
10
      btnClassPathRemove = new JButton(s_stringMgr.getString("HibernatePanel.classPathRemove"));
11
      ret.add(btnNo, gbc);
11
      ret.add(btnClassPathRemove, gbc);
12
      return ret;
12
      return ret;
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 in different classes having the same super class
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    JPanel ret = new JPanel();
    1
    JPanel ret = new JPanel();
    1
    JPanel ret = new JPanel(new GridBagLayout());
    Differences
    Expression1Expression2Difference
    new JPanel()new JPanel(new GridBagLayout())ARGUMENT_NUMBER_MISMATCH
    1
    JPanel ret = new JPanel(new GridBagLayout());
    2
    ret.setLayout(new GridBagLayout());
    2
    ret.setLayout(new GridBagLayout());
    Preondition Violations
    Unmatched statement ret.setLayout(new GridBagLayout()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
    3
    GridBagConstraints gbc;
    2
    GridBagConstraints gbc;
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 5, 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
    NORTHWESTWESTVARIABLE_NAME_MISMATCH
    BOTHNONEVARIABLE_NAME_MISMATCH
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    5
    btnYes = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
    5
    btnYes = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
    4
    btnClassPathAdd = new JButton(s_stringMgr.getString("HibernatePanel.classPathAdd"));
    Differences
    Expression1Expression2Difference
    btnYesbtnClassPathAddVARIABLE_NAME_MISMATCH
    "SessionStartupTimeHintDlg.yes""HibernatePanel.classPathAdd"LITERAL_VALUE_MISMATCH
    4
    btnClassPathAdd = new JButton(s_stringMgr.getString("HibernatePanel.classPathAdd"));
    6
    ret.add(btnYes, gbc);
    6
    ret.add(btnYes, gbc);
    5
    ret.add(btnClassPathAdd, gbc);
    Differences
    Expression1Expression2Difference
    btnYesbtnClassPathAddVARIABLE_NAME_MISMATCH
    5
    ret.add(btnClassPathAdd, gbc);
    7
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
    7
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 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
    BOTHNONEVARIABLE_NAME_MISMATCH
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    8
    btnNo = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no"));
    8
    btnNo = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no"));
    7
    btnClassPathRemove = new JButton(s_stringMgr.getString("HibernatePanel.classPathRemove"));
    Differences
    Expression1Expression2Difference
    btnNobtnClassPathRemoveVARIABLE_NAME_MISMATCH
    "SessionStartupTimeHintDlg.no""HibernatePanel.classPathRemove"LITERAL_VALUE_MISMATCH
    7
    btnClassPathRemove = new JButton(s_stringMgr.getString("HibernatePanel.classPathRemove"));
    9
    ret.add(btnNo, gbc);
    9
    ret.add(btnNo, gbc);
    8
    ret.add(btnClassPathRemove, gbc);
    Differences
    Expression1Expression2Difference
    btnNobtnClassPathRemoveVARIABLE_NAME_MISMATCH
    8
    ret.add(btnClassPathRemove, gbc);
    10
    return ret;
    9
    return ret;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement ret.setLayout(new GridBagLayout()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.gui.desktopcontainer.TabbedStyleHintDlg and net.sourceforge.squirrel_sql.plugins.hibernate.configuration.HibernateConfigPanel do not have a common superclass