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;
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;
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/codecompletion/src/net/sourceforge/squirrel_sql/plugins/codecompletion/prefs/CodeCompletionPreferencesPanel.java
Method name: JPanel createButtonPanel() Method name: JPanel createButtonsPanel()
Number of AST nodes: 10 Number of AST nodes: 9
1
JPanel ret = new JPanel();
2
      ret.setLayout(new GridBagLayout());
3
      GridBagCon
1
GridBagConstraints gbc;
2
      JPanel pnlButtons = new JPanel(new GridBagLayout());
3
      // i18n[codeCompletion.prefixConfig.newRow=Add new row]
4
straints gbc;
4
      btnNewRow = new JButton(s_strin
5
gMgr.getString("codeCompletion.prefixConfig.newRow"));
5
      gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0);
6
      gbc = new GridBagConstraints(0,0,1,1,1,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,0,5,5),0,0);
6
      btnYe
7
      pnlButtons.add(btnNewRow, gbc);
8
      // i18n[codeCompletion.prefixConfig.deleteSelRows=Delete selected rows]
7
s = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
9
      btnDeleteRows = new JButton(s_stringMgr.getString("
8
      ret.add(btnYes, gbc);
10
codeCompletion.prefixConfig.deleteSelRows"));
9
      gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0);
11
      gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,5,5,5),0,0);
10
      btnNo = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no"));
12
      
11
      ret.add(btnNo, gbc);
13
pnlButtons.add(btnDeleteRows, gbc);
12
      return ret;
14
      return pnlButtons;
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();
    2
    JPanel pnlButtons = new JPanel(new GridBagLayout());
    Differences
    Expression1Expression2Difference
    retpnlButtonsVARIABLE_NAME_MISMATCH
    new JPanel()new JPanel(new GridBagLayout())ARGUMENT_NUMBER_MISMATCH
    2
    JPanel pnlButtons = 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;
    1
    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);
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    01LITERAL_VALUE_MISMATCH
    BOTHNONEVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    50LITERAL_VALUE_MISMATCH
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0);
    5
    btnYes = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
    5
    btnYes = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
    6
    btnDeleteRows = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.deleteSelRows"));
    Differences
    Expression1Expression2Difference
    btnYesbtnDeleteRowsVARIABLE_NAME_MISMATCH
    "SessionStartupTimeHintDlg.yes""codeCompletion.prefixConfig.deleteSelRows"LITERAL_VALUE_MISMATCH
    6
    btnDeleteRows = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.deleteSelRows"));
    6
    ret.add(btnYes, gbc);
    6
    ret.add(btnYes, gbc);
    8
    pnlButtons.add(btnDeleteRows, gbc);
    Differences
    Expression1Expression2Difference
    btnYesbtnDeleteRowsVARIABLE_NAME_MISMATCH
    retpnlButtonsVARIABLE_NAME_MISMATCH
    8
    pnlButtons.add(btnDeleteRows, 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);
    7
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    BOTHNONEVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    7
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    8
    btnNo = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no"));
    8
    btnNo = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no"));
    3
    btnNewRow = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.newRow"));
    Differences
    Expression1Expression2Difference
    btnNobtnNewRowVARIABLE_NAME_MISMATCH
    "SessionStartupTimeHintDlg.no""codeCompletion.prefixConfig.newRow"LITERAL_VALUE_MISMATCH
    3
    btnNewRow = new JButton(s_stringMgr.getString("codeCompletion.prefixConfig.newRow"));
    9
    ret.add(btnNo, gbc);
    9
    ret.add(btnNo, gbc);
    5
    pnlButtons.add(btnNewRow, gbc);
    Differences
    Expression1Expression2Difference
    btnNobtnNewRowVARIABLE_NAME_MISMATCH
    retpnlButtonsVARIABLE_NAME_MISMATCH
    5
    pnlButtons.add(btnNewRow, gbc);
    10
    return ret;
    10
    return ret;
    9
    return pnlButtons;
    Differences
    Expression1Expression2Difference
    retpnlButtonsVARIABLE_NAME_MISMATCH
    9
    return pnlButtons;
    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.codecompletion.prefs.CodeCompletionPreferencesPanel do not have a common superclass