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;
TitledBorder brd = BorderFactory.createTitledBorder(s_stringMgr.getString("HibernatePanel.newFactoryClasspathBorder")); JPanel ret = new JPanel(new GridBagLayout()); ret.setBorder(brd); GridBagConstraints gbc; gbc = new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.NORTHWEST,GridBagConstraints.BOTH, new Insets(0,5,5,5),0,0); lstClassPath = new JList(); ret.add(new JScrollPane(lstClassPath), gbc); gbc = new GridBagConstraints(0,1,1,1,0,0, GridBagConstraints.SOUTHEAST,GridBagConstraints.NONE, new Insets(0,5,5,5),0,0); ret.add(createButtonClasspathPanel(), 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 createClasspathPanel()
Number of AST nodes: 10 Number of AST nodes: 10
1
JPanel ret = new JPanel();
2
      ret.setLayout(new GridBagLayout());
1
TitledBorder brd = BorderFactory.createTitledBorder(s_stringMgr.getString("HibernatePanel.newFactoryClasspathBorder"));
2
      JPanel ret = new JPanel(new GridBagLayout());
3
      ret.setBorder(brd);
3
      GridBagConstraints gbc;
4
      GridBagConstraints gbc;
4
      gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0);
5
      gbc = new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.NORTHWEST,GridBagConstraints.BOTH, new Insets(0,5,5,5),0,0);
5
      btnYes = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
6
      
6
      ret.add(btnYes
7
lstClassPath = new JList();
7
, gbc);
8
      ret.add(new JScrollPane(lstClassPath), gbc);
8
      gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0);
9
      gbc = new GridBagConstraints(0,1,1,1,0,0, GridBagConstraints.SOUTHEAST,GridBagConstraints.NONE, new Insets(0,5,5,5),0,0);
9
      btnNo = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no"));
10
      
10
      ret.add(btnNo, gbc);
11
ret.add(createButtonClasspathPanel(), gbc);
11
      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 comparisons48
  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 fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                    
    1
    TitledBorder brd = BorderFactory.createTitledBorder(s_stringMgr.getString("HibernatePanel.newFactoryClasspathBorder"));
    1
    JPanel ret = new JPanel();
    1
    JPanel ret = new JPanel();
    2
    JPanel ret = new JPanel(new GridBagLayout());
    Differences
    Expression1Expression2Difference
    new JPanel()new JPanel(new GridBagLayout())ARGUMENT_NUMBER_MISMATCH
    2
    JPanel ret = new JPanel(new GridBagLayout());
    2
    ret.setLayout(new GridBagLayout());
    2
    ret.setLayout(new GridBagLayout());
    7
    ret.add(new JScrollPane(lstClassPath), gbc);
    Differences
    Expression1Expression2Difference
    setLayoutaddMETHOD_INVOCATION_NAME_MISMATCH
    ret.setLayout(new GridBagLayout())ret.add(new JScrollPane(lstClassPath),gbc)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ret.setLayout(new GridBagLayout()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(new JScrollPane(lstClassPath),gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.setLayout(new GridBagLayout()) is a void method call, and thus it cannot be parameterized
    Expression ret.add(new JScrollPane(lstClassPath),gbc) is a void method call, and thus it cannot be parameterized
    Expression ret.setLayout(new GridBagLayout()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(new JScrollPane(lstClassPath),gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.setLayout(new GridBagLayout()) is a void method call, and thus it cannot be parameterized
    Expression ret.add(new JScrollPane(lstClassPath),gbc) is a void method call, and thus it cannot be parameterized
    7
    ret.add(new JScrollPane(lstClassPath), gbc);
    3
    GridBagConstraints gbc;
    4
    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);
    5
    gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    01LITERAL_VALUE_MISMATCH
    01LITERAL_VALUE_MISMATCH
    50LITERAL_VALUE_MISMATCH
    5
    gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0);
    5
    btnYes = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
    5
    btnYes = new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"));
    6
    lstClassPath = new JList();
    Differences
    Expression1Expression2Difference
    btnYeslstClassPathVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JListSUBCLASS_TYPE_MISMATCH
    javax.swing.JButtonjavax.swing.JListSUBCLASS_TYPE_MISMATCH
    new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.yes"))new JList()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression btnYes is a field being modified, and thus it cannot be parameterized
    Expression lstClassPath is a field being modified, and thus it cannot be parameterized
    6
    lstClassPath = new JList();
    6
    ret.add(btnYes, gbc);
    6
    ret.add(btnYes, gbc);
    9
    ret.add(createButtonClasspathPanel(), gbc);
    Differences
    Expression1Expression2Difference
    javax.swing.JButtonjavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    btnYescreateButtonClasspathPanel()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression btnYes cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression createButtonClasspathPanel() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method createButtonClasspathPanel
    9
    ret.add(createButtonClasspathPanel(), 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);
    8
    gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    Differences
    Expression1Expression2Difference
    10LITERAL_VALUE_MISMATCH
    01LITERAL_VALUE_MISMATCH
    NORTHWESTSOUTHEASTVARIABLE_NAME_MISMATCH
    BOTHNONEVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    8
    gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.SOUTHEAST, 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"));
    Preondition Violations
    Unmatched statement btnNo=new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                            
    9
    ret.add(btnNo, gbc);
    9
    ret.add(btnNo, gbc);
    3
    ret.setBorder(brd);
    Differences
    Expression1Expression2Difference
    addsetBorderMETHOD_INVOCATION_NAME_MISMATCH
    ret.add(btnNo,gbc)ret.setBorder(brd)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ret.add(btnNo,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.setBorder(brd) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(btnNo,gbc) is a void method call, and thus it cannot be parameterized
    Expression ret.setBorder(brd) is a void method call, and thus it cannot be parameterized
    Expression ret.add(btnNo,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.setBorder(brd) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ret.add(btnNo,gbc) is a void method call, and thus it cannot be parameterized
    Expression ret.setBorder(brd) is a void method call, and thus it cannot be parameterized
    3
    ret.setBorder(brd);
    10
    return ret;
    10
    return ret;
    Precondition Violations (22)
    Row Violation
    1Expression ret.setLayout(new GridBagLayout()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ret.add(new JScrollPane(lstClassPath),gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ret.setLayout(new GridBagLayout()) is a void method call, and thus it cannot be parameterized
    4Expression ret.add(new JScrollPane(lstClassPath),gbc) is a void method call, and thus it cannot be parameterized
    5Expression ret.setLayout(new GridBagLayout()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ret.add(new JScrollPane(lstClassPath),gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression ret.setLayout(new GridBagLayout()) is a void method call, and thus it cannot be parameterized
    8Expression ret.add(new JScrollPane(lstClassPath),gbc) is a void method call, and thus it cannot be parameterized
    9Expression btnYes is a field being modified, and thus it cannot be parameterized
    10Expression lstClassPath is a field being modified, and thus it cannot be parameterized
    11Expression btnYes cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression createButtonClasspathPanel() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Unmatched statement btnNo=new JButton(s_stringMgr.getString("SessionStartupTimeHintDlg.no")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    14Expression ret.add(btnNo,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression ret.setBorder(brd) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression ret.add(btnNo,gbc) is a void method call, and thus it cannot be parameterized
    17Expression ret.setBorder(brd) is a void method call, and thus it cannot be parameterized
    18Expression ret.add(btnNo,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression ret.setBorder(brd) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression ret.add(btnNo,gbc) is a void method call, and thus it cannot be parameterized
    21Expression ret.setBorder(brd) is a void method call, and thus it cannot be parameterized
    22The 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