JPanel ret = new JPanel(); GridBagConstraints gbc; // i18n[graphToClipboard.copyButton=Copy image from selected tab] btnSaveToFile = new JButton(s_stringMgr.getString("graphToFile.saveFilesTo")); gbc = new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0); ret.add(btnSaveToFile, gbc); gbc = new GridBagConstraints(1,0,1,1,1,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0); ret.add(new JPanel(), gbc); // i18n[graphToClipboard.closeButton=Close] btnClose = new JButton(s_stringMgr.getString("graphToClipboard.closeButton")); gbc = new GridBagConstraints(2,0,1,1,0,0,GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0); ret.add(btnClose, 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,0,5,5),0,0); // i18n[HibernateConfigPanel.toObtainSessionFactJPA=Call "javax.persistence.Persistence.createEntityManagerFactory("<persitence-unit name>");"] radJPA = new JRadioButton(s_stringMgr.getString("HibernatePanel.toObtainSessionFactJPA")); ret.add(radJPA, gbc); gbc = new GridBagConstraints(1,0,1,1,0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,5,5,5),0,0); // i18n[HibernateConfigPanel.toObtainSessionFactPersUnit=persitence-unit name:] ret.add(new JLabel(s_stringMgr.getString("HibernatePanel.toObtainSessionFactPersUnit")), gbc); gbc = new GridBagConstraints(2,0,1,1,1,0,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,0,5,5),0,0); txtPersistenceUnitName = new JTextField(); ret.add(txtPersistenceUnitName, gbc); return ret;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/graphtofiles/GraphToFilesDlg.java File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/configuration/HibernateConfigPanel.java
Method name: JPanel createButtonPanel() Method name: JPanel createJPAPanel()
Number of AST nodes: 11 Number of AST nodes: 11
1
JPanel ret = new JPanel();
1
JPanel ret = new JPanel(new GridBagLayout());
2
      GridBagConstraints gbc;
2
      GridBagCon
3
      // i18n[graphToClipboard.copyButton=Copy image from selected tab]
4
      btnSaveToFile = new JButton(s_stringMgr.getString("graphToFile.saveFilesTo"));
3
straints gbc;
5
      gbc = new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, 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,0,5,5),0,0);
6
      ret.add(btnSaveToFile
5
      // i18n[HibernateConfigPanel.toObtainSessionFactJPA=Call "javax.persistence.Persistence.createEntityManagerFactory("<persitence-unit name>");"]
6
      radJPA = new JRadioButton(s_stringMgr.getString("HibernatePanel.toObtainSessionFactJPA"));
7
, gbc);
7
      ret.add(radJPA, gbc);
8
      gbc = new GridBagConstraints(1,0,1,1,1,0,GridBagConstraints.CENTER, 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
      ret.add(new JPanel(), gbc);
9
      
10
      
11
      // i18n[graphToClipboard.closeButton=Close]
12
      btnClose = new JButton(s_stringMgr.getString("graphToClipboard.closeButton")
10
// i18n[HibernateConfigPanel.toObtainSessionFactPersUnit=persitence-unit name:]
13
);
11
      ret.add(new JLabel(s_stringMgr.getString("HibernatePanel.toObtainSessionFactPersUnit")), gbc);
14
      gbc = new GridBagConstraints(2,0,1,1,0,0,GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0);
12
      gbc = new GridBagConstraints(2,0,1,1,1,0,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,0,5,5),0,0);
15
      ret.add(btnClos
13
      txtPersistenceUnitName = new JTextField();
16
e, gbc);
14
      ret.add(txtPersistenceUnitName, gbc);
17
      return ret;
15
      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 comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    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
    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
    GridBagConstraints gbc;
    2
    GridBagConstraints gbc;
    3
    btnSaveToFile = new JButton(s_stringMgr.getString("graphToFile.saveFilesTo"));
    3
    btnSaveToFile = new JButton(s_stringMgr.getString("graphToFile.saveFilesTo"));
    4
    radJPA = new JRadioButton(s_stringMgr.getString("HibernatePanel.toObtainSessionFactJPA"));
    Differences
    Expression1Expression2Difference
    btnSaveToFileradJPAVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JRadioButtonSUBCLASS_TYPE_MISMATCH
    javax.swing.JButtonjavax.swing.JRadioButtonSUBCLASS_TYPE_MISMATCH
    "graphToFile.saveFilesTo""HibernatePanel.toObtainSessionFactJPA"LITERAL_VALUE_MISMATCH
    4
    radJPA = new JRadioButton(s_stringMgr.getString("HibernatePanel.toObtainSessionFactJPA"));
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.SOUTHEAST, 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, 0, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    SOUTHEASTWESTVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    3
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0);
    5
    ret.add(btnSaveToFile, gbc);
    5
    ret.add(btnSaveToFile, gbc);
    5
    ret.add(radJPA, gbc);
    Differences
    Expression1Expression2Difference
    btnSaveToFileradJPAVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JRadioButtonSUBCLASS_TYPE_MISMATCH
    5
    ret.add(radJPA, gbc);
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, 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
    10LITERAL_VALUE_MISMATCH
    CENTERWESTVARIABLE_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);
    7
    ret.add(new JPanel(), gbc);
    7
    ret.add(new JPanel(), gbc);
    7
    ret.add(new JLabel(s_stringMgr.getString("HibernatePanel.toObtainSessionFactPersUnit")), gbc);
    Differences
    Expression1Expression2Difference
    javax.swing.JPaneljavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    new JPanel()new JLabel(s_stringMgr.getString("HibernatePanel.toObtainSessionFactPersUnit"))ARGUMENT_NUMBER_MISMATCH
    7
    ret.add(new JLabel(s_stringMgr.getString("HibernatePanel.toObtainSessionFactPersUnit")), gbc);
    8
    btnClose = new JButton(s_stringMgr.getString("graphToClipboard.closeButton"));
    8
    btnClose = new JButton(s_stringMgr.getString("graphToClipboard.closeButton"));
    9
    txtPersistenceUnitName = new JTextField();
    Differences
    Expression1Expression2Difference
    btnClosetxtPersistenceUnitNameVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    javax.swing.JButtonjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    new JButton(s_stringMgr.getString("graphToClipboard.closeButton"))new JTextField()ARGUMENT_NUMBER_MISMATCH
    9
    txtPersistenceUnitName = new JTextField();
    9
    gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    9
    gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    8
    gbc = new GridBagConstraints(2, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    01LITERAL_VALUE_MISMATCH
    SOUTHWESTWESTVARIABLE_NAME_MISMATCH
    NONEHORIZONTALVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    8
    gbc = new GridBagConstraints(2, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0);
    10
    ret.add(btnClose, gbc);
    10
    ret.add(btnClose, gbc);
    10
    ret.add(txtPersistenceUnitName, gbc);
    Differences
    Expression1Expression2Difference
    btnClosetxtPersistenceUnitNameVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    10
    ret.add(txtPersistenceUnitName, gbc);
    11
    return ret;
    11
    return ret;
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.graph.graphtofiles.GraphToFilesDlg and net.sourceforge.squirrel_sql.plugins.hibernate.configuration.HibernateConfigPanel do not have a common superclass