JPanel ret = new JPanel(); ret.setLayout(new GridBagLayout()); GridBagConstraints gbc; // i18n[SchemaPropertiesPanel.printCacheFileLocation=Print cache file path to message panel] btnPrintCacheFileLocation = new JButton(s_stringMgr.getString("SchemaPropertiesPanel.printCacheFileLocation")); gbc = new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,5,5), 0,0); ret.add(btnPrintCacheFileLocation, gbc); // i18n[SchemaPropertiesPanel.deleteCache=Delete cache file] btnDeleteCache = new JButton(s_stringMgr.getString("SchemaPropertiesPanel.deleteCache")); gbc = new GridBagConstraints(1,0,1,1,0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,5,5,5), 0,0); ret.add(btnDeleteCache, 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/db/aliasproperties/SchemaPropertiesPanel.java File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/configuration/HibernateConfigPanel.java
Method name: JPanel createCacheFilePanel() Method name: JPanel createClasspathPanel()
Number of AST nodes: 10 Number of AST nodes: 10
1
JPanel ret = new JPanel();
2
      ret.setLayout(new GridBagLayout());
3
      GridBagConstraints gbc;
1
TitledBorder brd = BorderFactory.createTitledBorder(s_stringMgr.getStrin
4
      // i18n[SchemaPropertiesPanel.printCacheFileLocation=Print cache file path to message panel]
5
      btnPrintCacheFileLocation = new JButton(s_stringMgr.getString("SchemaPropertiesPanel.printCacheFileLocation"));
2
g("HibernatePanel.newFactoryClasspathBorder"));
3
      JPanel ret = new JPanel(new GridBagLayout());
4
      ret.setBorder(brd);
5
      GridBagConstraints gbc;
6
      gbc = new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,5,5), 0,0);
6
      gbc = new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.NORTHWEST,GridBagConstraints.BOTH, new Insets(0,5,5,5),0,0);
7
      ret.add(btnPrintCacheFileLocation, gbc);
7
      
8
      // i18n[SchemaPropertiesPanel.deleteCache=Delete cache file]
9
      btnDeleteCache = new JButton(s_stringMgr.getString("SchemaPropertiesPanel.deleteCache")
8
lstClassPath = new JList();
10
);
9
      ret.add(new JScrollPane(lstClassPath), gbc);
11
      gbc = new GridBagConstraints(1,0,1,1,0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,5,5,5), 0,0);
10
      gbc = new GridBagConstraints(0,1,1,1,0,0, GridBagConstraints.SOUTHEAST,GridBagConstraints.NONE, new Insets(0,5,5,5),0,0);
12
      ret.add(btnDeleteCache, gbc);
11
      ret.add(createButtonClasspathPanel(), gbc);
13
      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
    btnPrintCacheFileLocation = new JButton(s_stringMgr.getString("SchemaPropertiesPanel.printCacheFileLocation"));
    4
    btnPrintCacheFileLocation = new JButton(s_stringMgr.getString("SchemaPropertiesPanel.printCacheFileLocation"));
    Preondition Violations
    Unmatched statement btnPrintCacheFileLocation=new JButton(s_stringMgr.getString("SchemaPropertiesPanel.printCacheFileLocation")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                                                    
    5
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0);
    5
    gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 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
    WESTNORTHWESTVARIABLE_NAME_MISMATCH
    NONEBOTHVARIABLE_NAME_MISMATCH
    05LITERAL_VALUE_MISMATCH
    5
    gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0);
    6
    ret.add(btnPrintCacheFileLocation, gbc);
    6
    ret.add(btnPrintCacheFileLocation, gbc);
    3
    ret.setBorder(brd);
    Differences
    Expression1Expression2Difference
    addsetBorderMETHOD_INVOCATION_NAME_MISMATCH
    ret.add(btnPrintCacheFileLocation,gbc)ret.setBorder(brd)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ret.add(btnPrintCacheFileLocation,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(btnPrintCacheFileLocation,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(btnPrintCacheFileLocation,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(btnPrintCacheFileLocation,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);
    7
    btnDeleteCache = new JButton(s_stringMgr.getString("SchemaPropertiesPanel.deleteCache"));
    7
    btnDeleteCache = new JButton(s_stringMgr.getString("SchemaPropertiesPanel.deleteCache"));
    6
    lstClassPath = new JList();
    Differences
    Expression1Expression2Difference
    btnDeleteCachelstClassPathVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JListSUBCLASS_TYPE_MISMATCH
    javax.swing.JButtonjavax.swing.JListSUBCLASS_TYPE_MISMATCH
    new JButton(s_stringMgr.getString("SchemaPropertiesPanel.deleteCache"))new JList()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression btnDeleteCache 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();
    8
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    8
    gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 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
    WESTSOUTHEASTVARIABLE_NAME_MISMATCH
    8
    gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0);
    9
    ret.add(btnDeleteCache, gbc);
    9
    ret.add(btnDeleteCache, gbc);
    9
    ret.add(createButtonClasspathPanel(), gbc);
    Differences
    Expression1Expression2Difference
    javax.swing.JButtonjavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    btnDeleteCachecreateButtonClasspathPanel()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression btnDeleteCache 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);
    10
    return ret;
    10
    return ret;
    Precondition Violations (21)
    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
    9Unmatched statement btnPrintCacheFileLocation=new JButton(s_stringMgr.getString("SchemaPropertiesPanel.printCacheFileLocation")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10Expression ret.add(btnPrintCacheFileLocation,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression ret.setBorder(brd) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression ret.add(btnPrintCacheFileLocation,gbc) is a void method call, and thus it cannot be parameterized
    13Expression ret.setBorder(brd) is a void method call, and thus it cannot be parameterized
    14Expression ret.add(btnPrintCacheFileLocation,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(btnPrintCacheFileLocation,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 btnDeleteCache is a field being modified, and thus it cannot be parameterized
    19Expression lstClassPath is a field being modified, and thus it cannot be parameterized
    20Expression btnDeleteCache cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression createButtonClasspathPanel() cannot be parameterized, because it has dependencies to/from statements that will be extracted