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[MappedObjectPanel.QualifiedNames=Show qualified names] chkShowQualified = new JCheckBox(s_stringMgr.getString("MappedObjectPanel.QualifiedNames")); ret.add(chkShowQualified, gbc); // dist gbc = new GridBagConstraints(1,0,1,1,1,1,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,5,5,5), 0,0); ret.add(new JPanel(), gbc); return ret;
JPanel buttonPane = new JPanel(new GridBagLayout()); GridBagConstraints gbc; btnSave = new JButton(plugin.getResourceString(BM_SAVE)); gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,1,1,1), 0, 0); buttonPane.add(btnSave, gbc); gbc = new GridBagConstraints(0,6,1,1,0,1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0, 0); buttonPane.add(new JPanel(), gbc); return buttonPane;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/mapping/MappedObjectPanel.java File path: /sql12/plugins/sqlreplace/src/net/sourceforge/squirrel_sql/plugins/sqlreplace/SQLReplacementPreferencesPanel.java
Method name: JPanel createTopPanel() Method name: JPanel createButtonPane(SQLReplacePlugin)
Number of AST nodes: 8 Number of AST nodes: 8
1
JPanel ret = new JPanel(new GridBagLayout());
1
JPanel buttonPane = new JPanel(new GridBagLayout());
2
      GridBagConstraints gbc;
2
      GridBagConstraints gbc;
3
      btnSave = new JButton(plugin.getResourceString(BM_SAVE));
3
      gbc = new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5,5,5,5), 0,0);
4
      gbc = new GridBagConstraints(0,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,1,1,1), 0, 0);
4
      // i18n[MappedObjectPanel.QualifiedNames=Show qualified names]
5
      
5
      chkShowQualified = new JCheckBox(s_stringMgr.getString("MappedObjectPanel.QualifiedNames"));
6
      ret.add(chkShowQualified, gbc);
6
buttonPane.add(btnSave, gbc);
7
      // dist
8
      gbc = new GridBagConstraints(1,0,1,1,1,1,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5,5,5,5), 0,0);
7
      gbc = new GridBagConstraints(0,6,1,1,0,1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0, 0);
9
      ret.add(new JPanel(), gbc);
8
      buttonPane.add(new JPanel(), gbc);
10
      return ret;
9
      return buttonPane;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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 comparisons33
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    JPanel ret = new JPanel(new GridBagLayout());
    1
    JPanel ret = new JPanel(new GridBagLayout());
    1
    JPanel buttonPane = new JPanel(new GridBagLayout());
    Differences
    Expression1Expression2Difference
    retbuttonPaneVARIABLE_NAME_MISMATCH
    1
    JPanel buttonPane = new JPanel(new GridBagLayout());
    2
    GridBagConstraints gbc;
    2
    GridBagConstraints gbc;
                                                                                                                        
    3
    btnSave = new JButton(plugin.getResourceString(BM_SAVE));
    Preondition Violations
    Unmatched statement btnSave=new JButton(plugin.getResourceString(BM_SAVE)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    btnSave = new JButton(plugin.getResourceString(BM_SAVE));
    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);
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 1, 1, 1), 0, 0);
    Differences
    Expression1Expression2Difference
    WESTNORTHWESTVARIABLE_NAME_MISMATCH
    NONEHORIZONTALVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    51LITERAL_VALUE_MISMATCH
    51LITERAL_VALUE_MISMATCH
    51LITERAL_VALUE_MISMATCH
    4
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 1, 1, 1), 0, 0);
    4
    chkShowQualified = new JCheckBox(s_stringMgr.getString("MappedObjectPanel.QualifiedNames"));
    4
    chkShowQualified = new JCheckBox(s_stringMgr.getString("MappedObjectPanel.QualifiedNames"));
    Preondition Violations
    Unmatched statement chkShowQualified=new JCheckBox(s_stringMgr.getString("MappedObjectPanel.QualifiedNames")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                              
    5
    ret.add(chkShowQualified, gbc);
    5
    ret.add(chkShowQualified, gbc);
    5
    buttonPane.add(btnSave, gbc);
    Differences
    Expression1Expression2Difference
    chkShowQualifiedbtnSaveVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JButtonSUBCLASS_TYPE_MISMATCH
    retbuttonPaneVARIABLE_NAME_MISMATCH
    5
    buttonPane.add(btnSave, gbc);
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0);
    6
    gbc = new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0);
    6
    gbc = new GridBagConstraints(0, 6, 1, 1, 0, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0);
    Differences
    Expression1Expression2Difference
    10LITERAL_VALUE_MISMATCH
    06LITERAL_VALUE_MISMATCH
    10LITERAL_VALUE_MISMATCH
    WESTNORTHWESTVARIABLE_NAME_MISMATCH
    HORIZONTALBOTHVARIABLE_NAME_MISMATCH
    50LITERAL_VALUE_MISMATCH
    50LITERAL_VALUE_MISMATCH
    50LITERAL_VALUE_MISMATCH
    50LITERAL_VALUE_MISMATCH
    6
    gbc = new GridBagConstraints(0, 6, 1, 1, 0, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0);
    7
    ret.add(new JPanel(), gbc);
    7
    ret.add(new JPanel(), gbc);
    7
    buttonPane.add(new JPanel(), gbc);
    Differences
    Expression1Expression2Difference
    retbuttonPaneVARIABLE_NAME_MISMATCH
    7
    buttonPane.add(new JPanel(), gbc);
    8
    return ret;
    8
    return ret;
    8
    return buttonPane;
    Differences
    Expression1Expression2Difference
    retbuttonPaneVARIABLE_NAME_MISMATCH
    8
    return buttonPane;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement btnSave=new JButton(plugin.getResourceString(BM_SAVE)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement chkShowQualified=new JCheckBox(s_stringMgr.getString("MappedObjectPanel.QualifiedNames")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted