JPanel ret = new JPanel(new GridBagLayout()); GridBagConstraints gbc; gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,5,5,5),0,0); // i18n[graph.btnOk=OK] btnOK = new JButton(s_stringMgr.getString("graph.btnOk")); ret.add(btnOK, gbc); getRootPane().setDefaultButton(btnOK); gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,5,5,5),0,0); // i18n[graph.btnCreateNewGraph=Create new graph] btnCreateNewGraph = new JButton(s_stringMgr.getString("graph.btnCreateNewGraph")); ret.add(btnCreateNewGraph, gbc); gbc = new GridBagConstraints(2,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,5,5,5),0,0); // i18n[graph.btnCancel=Cancel] btnCancel = new JButton(s_stringMgr.getString("graph.btnCancel")); ret.add(btnCancel, 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.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;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/GraphSelectionDialog.java File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/configuration/HibernateConfigPanel.java
Method name: JPanel createButtonPanel() Method name: JPanel createUserDefinedSessionFactoryPanel()
Number of AST nodes: 13 Number of AST nodes: 14
1
JPanel ret = new JPanel(new GridBagLayout());
1
JPanel ret = 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(0,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);
4
      // i18n[graph.btnOk=OK]
4
      // i18n[
5
		btnOK
5
HibernateConfigPanel.FactoryProvider=SessionFactoryImpl provider]
6
 = new JButton(s_stringMgr.getString("graph.btnOk"));
6
      JLabel lblConfig = new JLabel(s_stringMgr.getString("
7
      ret.add(btnOK, gbc);
8
      getRootPane().setDefaultButton(btnOK);
7
HibernatePanel.FactoryProvider"));
8
      ret.add(lblConfig, gbc);
9
      gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,5,5,5),0,0);
9
      gbc = new GridBagConstraints(1,0,1,1,1,0, GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL, new Insets(5,5,5,5),0,0);
10
      // i18n[graph.btnCreateNewGraph=Create new graph]
10
      
11
		btnCreateNewGraph = new JButton(s_stringMg
11
txtFactoryProvider = new JTextField();
12
r.getString("graph.btnCreateNewGraph")
12
      txtFactoryProvider.setEditable(false);
13
);
13
      txtFactoryProvider.setBackground(Color.lightGray);
14
      ret.add(btnCreateNewGraph, gbc);
14
      ret.add(txtFactoryProvider, gbc);
15
      gbc = new GridBagConstraints(2,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,5,5,5),0,0);
15
      gbc = new GridBagConstraints(2,0,1,1,0,0, GridBagConstraints.WEST,GridBagConstraints.NONE, new Insets(5,5,5,5),0,0);
16
      // i18n[graph.btnCancel=Cancel]
16
      // i18n[HibernateConfigPanel
17
		btnCancel
17
.editFactoryProvider=Edit]
18
 = new JButton(s_stringMgr.getString("graph.btnCancel"));
18
      btnEditFactoryProviderInfo = new JButton(s_stringMgr.getString("
19
      ret.add(btnCancel
19
HibernatePanel.editFactoryProvider"));
20
, gbc);
20
      ret.add(btnEditFactoryProviderInfo, gbc);
21
      return ret;
21
      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 comparisons83
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    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());
    2
    GridBagConstraints gbc;
    2
    GridBagConstraints gbc;
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 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
    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);
                                                                                                                                                                                    
    4
    JLabel lblConfig = new JLabel(s_stringMgr.getString("HibernatePanel.FactoryProvider"));
                                                                                                              
    9
    txtFactoryProvider.setBackground(Color.lightGray);
    4
    btnOK = new JButton(s_stringMgr.getString("graph.btnOk"));
    4
    btnOK = new JButton(s_stringMgr.getString("graph.btnOk"));
    12
    btnEditFactoryProviderInfo = new JButton(s_stringMgr.getString("HibernatePanel.editFactoryProvider"));
    Differences
    Expression1Expression2Difference
    btnOKbtnEditFactoryProviderInfoVARIABLE_NAME_MISMATCH
    "graph.btnOk""HibernatePanel.editFactoryProvider"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression btnOK is a field being modified, and thus it cannot be parameterized
    Expression btnEditFactoryProviderInfo is a field being modified, and thus it cannot be parameterized
    12
    btnEditFactoryProviderInfo = new JButton(s_stringMgr.getString("HibernatePanel.editFactoryProvider"));
    5
    ret.add(btnOK, gbc);
    5
    ret.add(btnOK, gbc);
    13
    ret.add(btnEditFactoryProviderInfo, gbc);
    Differences
    Expression1Expression2Difference
    btnOKbtnEditFactoryProviderInfoVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression btnOK cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression btnEditFactoryProviderInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13
    ret.add(btnEditFactoryProviderInfo, gbc);
    6
    getRootPane().setDefaultButton(btnOK);
    6
    getRootPane().setDefaultButton(btnOK);
    5
    ret.add(lblConfig, gbc);
    Differences
    Expression1Expression2Difference
    setDefaultButtonaddMETHOD_INVOCATION_NAME_MISMATCH
    javax.swing.JRootPanejavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    getRootPane()retTYPE_COMPATIBLE_REPLACEMENT
    getRootPane().setDefaultButton(btnOK)ret.add(lblConfig,gbc)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression getRootPane().setDefaultButton(btnOK) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(lblConfig,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRootPane().setDefaultButton(btnOK) is a void method call, and thus it cannot be parameterized
    Expression ret.add(lblConfig,gbc) is a void method call, and thus it cannot be parameterized
    Expression ret cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRootPane().setDefaultButton(btnOK) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(lblConfig,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRootPane().setDefaultButton(btnOK) is a void method call, and thus it cannot be parameterized
    Expression ret.add(lblConfig,gbc) is a void method call, and thus it cannot be parameterized
    5
    ret.add(lblConfig, gbc);
    7
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    7
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 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);
    Differences
    Expression1Expression2Difference
    01LITERAL_VALUE_MISMATCH
    NONEHORIZONTALVARIABLE_NAME_MISMATCH
    05LITERAL_VALUE_MISMATCH
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0);
    8
    btnCreateNewGraph = new JButton(s_stringMgr.getString("graph.btnCreateNewGraph"));
    8
    btnCreateNewGraph = new JButton(s_stringMgr.getString("graph.btnCreateNewGraph"));
    7
    txtFactoryProvider = new JTextField();
    Differences
    Expression1Expression2Difference
    btnCreateNewGraphtxtFactoryProviderVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    javax.swing.JButtonjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    new JButton(s_stringMgr.getString("graph.btnCreateNewGraph"))new JTextField()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression btnCreateNewGraph is a field being modified, and thus it cannot be parameterized
    Expression txtFactoryProvider is a field being modified, and thus it cannot be parameterized
    7
    txtFactoryProvider = new JTextField();
    9
    ret.add(btnCreateNewGraph, gbc);
    9
    ret.add(btnCreateNewGraph, gbc);
    10
    ret.add(txtFactoryProvider, gbc);
    Differences
    Expression1Expression2Difference
    btnCreateNewGraphtxtFactoryProviderVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression btnCreateNewGraph cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression txtFactoryProvider cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    ret.add(txtFactoryProvider, gbc);
    10
    gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    10
    gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 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);
    Differences
    Expression1Expression2Difference
    EASTWESTVARIABLE_NAME_MISMATCH
    05LITERAL_VALUE_MISMATCH
    11
    gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    11
    btnCancel = new JButton(s_stringMgr.getString("graph.btnCancel"));
    11
    btnCancel = new JButton(s_stringMgr.getString("graph.btnCancel"));
    Preondition Violations
    Unmatched statement btnCancel=new JButton(s_stringMgr.getString("graph.btnCancel")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                            
    12
    ret.add(btnCancel, gbc);
    12
    ret.add(btnCancel, gbc);
    8
    txtFactoryProvider.setEditable(false);
    Differences
    Expression1Expression2Difference
    addsetEditableMETHOD_INVOCATION_NAME_MISMATCH
    rettxtFactoryProviderVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    ret.add(btnCancel,gbc)txtFactoryProvider.setEditable(false)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ret.add(btnCancel,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression txtFactoryProvider.setEditable(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(btnCancel,gbc) is a void method call, and thus it cannot be parameterized
    Expression txtFactoryProvider.setEditable(false) is a void method call, and thus it cannot be parameterized
    Expression ret cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression txtFactoryProvider cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(btnCancel,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression txtFactoryProvider.setEditable(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(btnCancel,gbc) is a void method call, and thus it cannot be parameterized
    Expression txtFactoryProvider.setEditable(false) is a void method call, and thus it cannot be parameterized
    8
    txtFactoryProvider.setEditable(false);
    13
    return ret;
    14
    return ret;
    Precondition Violations (29)
    Row Violation
    1Expression btnOK is a field being modified, and thus it cannot be parameterized
    2Expression btnEditFactoryProviderInfo is a field being modified, and thus it cannot be parameterized
    3Expression btnOK cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression btnEditFactoryProviderInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression getRootPane().setDefaultButton(btnOK) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ret.add(lblConfig,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression getRootPane().setDefaultButton(btnOK) is a void method call, and thus it cannot be parameterized
    8Expression ret.add(lblConfig,gbc) is a void method call, and thus it cannot be parameterized
    9Expression ret cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression getRootPane().setDefaultButton(btnOK) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression ret.add(lblConfig,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression getRootPane().setDefaultButton(btnOK) is a void method call, and thus it cannot be parameterized
    13Expression ret.add(lblConfig,gbc) is a void method call, and thus it cannot be parameterized
    14Expression btnCreateNewGraph is a field being modified, and thus it cannot be parameterized
    15Expression txtFactoryProvider is a field being modified, and thus it cannot be parameterized
    16Expression btnCreateNewGraph cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression txtFactoryProvider cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Unmatched statement btnCancel=new JButton(s_stringMgr.getString("graph.btnCancel")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    19Expression ret.add(btnCancel,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression txtFactoryProvider.setEditable(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression ret.add(btnCancel,gbc) is a void method call, and thus it cannot be parameterized
    22Expression txtFactoryProvider.setEditable(false) is a void method call, and thus it cannot be parameterized
    23Expression ret cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression txtFactoryProvider cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression ret.add(btnCancel,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression txtFactoryProvider.setEditable(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Expression ret.add(btnCancel,gbc) is a void method call, and thus it cannot be parameterized
    28Expression txtFactoryProvider.setEditable(false) is a void method call, and thus it cannot be parameterized
    29The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.graph.GraphSelectionDialog and net.sourceforge.squirrel_sql.plugins.hibernate.configuration.HibernateConfigPanel do not have a common superclass