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.FactoryProvider=SessionFactoryImpl provider] JLabel lblConfig = new JLabel(s_stringMgr.getString("HibernatePanel.FactoryProvider")); ret.add(lblConfig, gbc); gbc = new GridBagConstraints(1,0,1,1,1,0, GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL, new Insets(5,5,5,5),0,0); txtFactoryProvider = new JTextField(); txtFactoryProvider.setEditable(false); txtFactoryProvider.setBackground(Color.lightGray); ret.add(txtFactoryProvider, gbc); gbc = new GridBagConstraints(2,0,1,1,0,0, GridBagConstraints.WEST,GridBagConstraints.NONE, new Insets(5,5,5,5),0,0); // i18n[HibernateConfigPanel.editFactoryProvider=Edit] btnEditFactoryProviderInfo = new JButton(s_stringMgr.getString("HibernatePanel.editFactoryProvider")); ret.add(btnEditFactoryProviderInfo, gbc); return ret;
JPanel pnlSouth = new JPanel(new GridBagLayout()); GridBagConstraints gbc; gbc = new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0); // i18n[sqlbookmark.squirrelMarksInPopup=Show SQuirreL bookmarks in ctrl+j popup] chkSquirrelMarksInPopup = new JCheckBox(s_stringMgr.getString("sqlbookmark.squirrelMarksInPopup")); pnlSouth.add(chkSquirrelMarksInPopup, gbc); JLabel lblAccesshint = new JLabel(plugin.getResourceString(AddBookmarkDialog.BM_ACCESS_HINT)); lblAccesshint.setForeground(Color.red); gbc = new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,5,5,5), 0,0); pnlSouth.add(lblAccesshint, gbc); gbc = new GridBagConstraints(1,0,1,2,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0,0); pnlSouth.add(new JPanel(), gbc); return pnlSouth;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/configuration/HibernateConfigPanel.java File path: /sql12/plugins/sqlbookmark/src/net/sourceforge/squirrel_sql/plugins/sqlbookmark/SQLBookmarkPreferencesPanel.java
Method name: JPanel createUserDefinedSessionFactoryPanel() Method name: JPanel createSouthPane(SQLBookmarkPlugin)
Number of AST nodes: 14 Number of AST nodes: 12
1
JPanel ret = new JPanel(new GridBagLayout());
1
JPanel pnlSouth = new JPanel(new GridBagLayout());
2
      GridBagConstraints gbc;
2
      GridBagConstraints gbc;
3
      gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.WEST,GridBagConstraints.NONE, new Insets(5,5,5,5),0,0);
3
      gbc = new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0);
4
      // i18n[HibernateConfigPanel.FactoryProvider=SessionFactoryImpl provider]
4
      // i18n[
5
      JLabel lblConfig = new JLabel(s_stringMgr.getString("HibernatePanel.FactoryProvider"));
6
      ret.add(lblConfig, gbc
5
sqlbookmark.squirrelMarksInPopup=Show SQuirreL bookmarks in ctrl+j popup]
6
      chkSquirrelMarksInPopup = new JCheckBox(s_stringMgr.getString("sqlbookmark.squirrelMarksInPopup"));
7
      pnlSouth.add(chkSquirrelMarksInPopup, gbc);
8
      JLabel lblAccesshint = new JLabel(plugin.getResourceString(AddBookmarkDialog.BM_ACCESS_HINT));
7
);
9
      lblAccesshint.setForeground(Color.red);
8
      gbc = new GridBagConstraints(1,0,1,1,1,0, GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL, new Insets(5,5,5,5),0,0);
10
      gbc = new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,5,5,5), 0,0);
9
      txtFactoryProvider = new JTextField();
11
      
10
      txtFactoryProvider.setEditable(false);
11
      txtFactoryProvider.setBackground(Color.lightGray);
12
      ret.add(txtFactoryProvider, gbc);
12
pnlSouth.add(lblAccesshint, gbc);
13
      gbc = new GridBagConstraints(2,0,1,1,0,0, GridBagConstraints.WEST,GridBagConstraints.NONE, new Insets(5,5,5,5),0,0);
13
      gbc = new GridBagConstraints(1,0,1,2,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0,0);
14
      // i18n[HibernateConfigPanel.editFactoryProvider=Edit]
14
      
15
      btnEditFactoryProviderInfo = new JButton(s_stringMgr.getString("HibernatePanel.editFactoryProvider"));
16
      ret.add(btnEditFactoryProviderInfo, gbc);
15
pnlSouth.add(new JPanel(), gbc);
17
      return ret;
16
      return pnlSouth;
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 comparisons87
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    JPanel ret = new JPanel(new GridBagLayout());
    1
    JPanel ret = new JPanel(new GridBagLayout());
    1
    JPanel pnlSouth = new JPanel(new GridBagLayout());
    Differences
    Expression1Expression2Difference
    retpnlSouthVARIABLE_NAME_MISMATCH
    1
    JPanel pnlSouth = new JPanel(new GridBagLayout());
    2
    GridBagConstraints gbc;
    2
    GridBagConstraints gbc;
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, 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);
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    WESTNORTHWESTVARIABLE_NAME_MISMATCH
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    4
    JLabel lblConfig = new JLabel(s_stringMgr.getString("HibernatePanel.FactoryProvider"));
                                                                                                                                                                                    
                                                                                                                                                                                                  
    6
    JLabel lblAccesshint = new JLabel(plugin.getResourceString(AddBookmarkDialog.BM_ACCESS_HINT));
    5
    ret.add(lblConfig, gbc);
    5
    ret.add(lblConfig, gbc);
    9
    pnlSouth.add(lblAccesshint, gbc);
    Differences
    Expression1Expression2Difference
    lblConfiglblAccesshintVARIABLE_NAME_MISMATCH
    retpnlSouthVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression lblConfig cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression lblAccesshint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    pnlSouth.add(lblAccesshint, gbc);
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0);
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0);
    8
    gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    10LITERAL_VALUE_MISMATCH
    01LITERAL_VALUE_MISMATCH
    10LITERAL_VALUE_MISMATCH
    WESTNORTHWESTVARIABLE_NAME_MISMATCH
    HORIZONTALNONEVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    8
    gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    7
    txtFactoryProvider = new JTextField();
    7
    txtFactoryProvider = new JTextField();
    4
    chkSquirrelMarksInPopup = new JCheckBox(s_stringMgr.getString("sqlbookmark.squirrelMarksInPopup"));
    Differences
    Expression1Expression2Difference
    txtFactoryProviderchkSquirrelMarksInPopupVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    new JTextField()new JCheckBox(s_stringMgr.getString("sqlbookmark.squirrelMarksInPopup"))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression txtFactoryProvider is a field being modified, and thus it cannot be parameterized
    Expression chkSquirrelMarksInPopup is a field being modified, and thus it cannot be parameterized
    4
    chkSquirrelMarksInPopup = new JCheckBox(s_stringMgr.getString("sqlbookmark.squirrelMarksInPopup"));
    8
    txtFactoryProvider.setEditable(false);
                                                                                      
    9
    txtFactoryProvider.setBackground(Color.lightGray);
    9
    txtFactoryProvider.setBackground(Color.lightGray);
    7
    lblAccesshint.setForeground(Color.red);
    Differences
    Expression1Expression2Difference
    lightGrayredVARIABLE_NAME_MISMATCH
    setBackgroundsetForegroundMETHOD_INVOCATION_NAME_MISMATCH
    txtFactoryProviderlblAccesshintVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression txtFactoryProvider.setBackground(Color.lightGray) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression lblAccesshint.setForeground(Color.red) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression txtFactoryProvider.setBackground(Color.lightGray) is a void method call, and thus it cannot be parameterized
    Expression lblAccesshint.setForeground(Color.red) is a void method call, and thus it cannot be parameterized
    Expression txtFactoryProvider cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression lblAccesshint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    lblAccesshint.setForeground(Color.red);
    10
    ret.add(txtFactoryProvider, gbc);
    10
    ret.add(txtFactoryProvider, gbc);
    5
    pnlSouth.add(chkSquirrelMarksInPopup, gbc);
    Differences
    Expression1Expression2Difference
    txtFactoryProviderchkSquirrelMarksInPopupVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    retpnlSouthVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression txtFactoryProvider cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression chkSquirrelMarksInPopup cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    pnlSouth.add(chkSquirrelMarksInPopup, gbc);
    11
    gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    11
    gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    10
    gbc = new GridBagConstraints(1, 0, 1, 2, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0);
    Differences
    Expression1Expression2Difference
    21LITERAL_VALUE_MISMATCH
    12LITERAL_VALUE_MISMATCH
    WESTNORTHWESTVARIABLE_NAME_MISMATCH
    NONEBOTHVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    50LITERAL_VALUE_MISMATCH
    50LITERAL_VALUE_MISMATCH
    50LITERAL_VALUE_MISMATCH
    10
    gbc = new GridBagConstraints(1, 0, 1, 2, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0);
    12
    btnEditFactoryProviderInfo = new JButton(s_stringMgr.getString("HibernatePanel.editFactoryProvider"));
    12
    btnEditFactoryProviderInfo = new JButton(s_stringMgr.getString("HibernatePanel.editFactoryProvider"));
    Preondition Violations
    Unmatched statement btnEditFactoryProviderInfo=new JButton(s_stringMgr.getString("HibernatePanel.editFactoryProvider")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                                    
    13
    ret.add(btnEditFactoryProviderInfo, gbc);
    13
    ret.add(btnEditFactoryProviderInfo, gbc);
    11
    pnlSouth.add(new JPanel(), gbc);
    Differences
    Expression1Expression2Difference
    javax.swing.JButtonjavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    btnEditFactoryProviderInfonew JPanel()TYPE_COMPATIBLE_REPLACEMENT
    retpnlSouthVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression btnEditFactoryProviderInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    pnlSouth.add(new JPanel(), gbc);
    14
    return ret;
    14
    return ret;
    12
    return pnlSouth;
    Differences
    Expression1Expression2Difference
    retpnlSouthVARIABLE_NAME_MISMATCH
    12
    return pnlSouth;
    Precondition Violations (14)
    Row Violation
    1Expression lblConfig cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression lblAccesshint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression txtFactoryProvider is a field being modified, and thus it cannot be parameterized
    4Expression chkSquirrelMarksInPopup is a field being modified, and thus it cannot be parameterized
    5Expression txtFactoryProvider.setBackground(Color.lightGray) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression lblAccesshint.setForeground(Color.red) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression txtFactoryProvider.setBackground(Color.lightGray) is a void method call, and thus it cannot be parameterized
    8Expression lblAccesshint.setForeground(Color.red) is a void method call, and thus it cannot be parameterized
    9Expression txtFactoryProvider cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression lblAccesshint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression txtFactoryProvider cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression chkSquirrelMarksInPopup cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Unmatched statement btnEditFactoryProviderInfo=new JButton(s_stringMgr.getString("HibernatePanel.editFactoryProvider")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    14Expression btnEditFactoryProviderInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted