JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("sampler_on_error_action"))); //$NON-NLS-1$ ButtonGroup group = new ButtonGroup(); continueBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_continue")); //$NON-NLS-1$ group.add(continueBox); continueBox.setSelected(true); panel.add(continueBox); stopThrdBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_thread")); //$NON-NLS-1$ group.add(stopThrdBox); panel.add(stopThrdBox); stopTestBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_test")); //$NON-NLS-1$ group.add(stopTestBox); panel.add(stopTestBox); return panel;
DefaultComboBoxModel m = new DefaultComboBoxModel(); // Note: position of these elements in the menu *must* match the // corresponding ProxyControl.GROUPING_* values. m.addElement(JMeterUtils.getResString("grouping_no_groups")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_add_separators")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_in_controllers")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_store_first_only")); // $NON-NLS-1$ groupingMode = new JComboBox(m); groupingMode.setSelectedIndex(0); groupingMode.addItemListener(this); JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode")); // $NON-NLS-1$ label2.setLabelFor(groupingMode); HorizontalPanel panel = new HorizontalPanel(); panel.add(label2); panel.add(groupingMode); return panel;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/OnErrorPanel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Method name: JPanel createOnErrorPanel() Method name: JPanel createGroupingPanel()
Number of AST nodes: 14 Number of AST nodes: 14
1
JPanel panel = new JPanel();
1
DefaultComboBoxModel m = new 
2
		panel.setBorder(BorderFactory.createTitledBorder
2
DefaultComboBoxModel();
3
		// Note: position of these elements in the menu *must* match the
4
		// corresponding ProxyControl.GROUPING_* values.
3
(JMeterUtils.getResString("sampler_on_error_action"))); //$NON-NLS-1$
5
		m.addElement(JMeterUtils.getResString("grouping_no_groups")); // $NON-NLS-1$
4
		ButtonGroup group = new ButtonGroup();
5
		continueBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_continue")); //$NON-NLS-1$
6
		m.addElement(JMeterUtils.getResString("grouping_add_separators")); // $NON-NLS-1$
6
		group.add(continueBox);
7
		
7
		continueBox.setSelected(true);
8
		panel.add(continueBox);
9
		stopThrdBox = new JRadioButton
8
m.addElement(JMeterUtils.getResString("grouping_in_controllers")); // $NON-NLS-1$
10
(JMeterUtils.getResString("sampler_on_error_stop_thread")); //$NON-NLS-1$
9
		m.addElement(JMeterUtils.getResString("grouping_store_first_only")); // $NON-NLS-1$
11
		group.add(stopThrdBox);
10
		group
12
		panel.add(stopThrdBox);
13
		stopTestBox = new JRadioButton
11
ingMode = new JComboBox(m);
12
		groupingMode.setSelectedIndex(0);
13
		groupingMode.addItemListener(this);
14
(JMeterUtils.getResString("sampler_on_error_stop_test")); //$NON-NLS-1$
14
		JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode")); // $NON-NLS-1$
15
		group.add(stopTestBox
15
		label2.setLabelFor(groupingMode);
16
		HorizontalPanel panel = new HorizontalPanel();
16
);
17
		panel.add(label2);
17
		panel.add(stopTestBox);
18
		panel.add(groupingMode);
18
		return panel;
19
		return panel;
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 comparisons160
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment10
    Number of unmapped statements in the second code fragment10
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                              
    1
    DefaultComboBoxModel m = new DefaultComboBoxModel();
                                                                                                                                    
    2
    m.addElement(JMeterUtils.getResString("grouping_no_groups"));
    1
    JPanel panel = new JPanel();
    1
    JPanel panel = new JPanel();
    11
    HorizontalPanel panel = new HorizontalPanel();
    Differences
    Expression1Expression2Difference
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    11
    HorizontalPanel panel = new HorizontalPanel();
    2
    panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("sampler_on_error_action")));
                                                                                                                                                                                                                        
                                                                                                                                              
    3
    m.addElement(JMeterUtils.getResString("grouping_add_separators"));
    3
    ButtonGroup group = new ButtonGroup();
                                                                                  
                                                                                                                                              
    4
    m.addElement(JMeterUtils.getResString("grouping_in_controllers"));
    4
    continueBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_continue"));
                                                                                                                                                                                  
                                                                                                                                                  
    5
    m.addElement(JMeterUtils.getResString("grouping_store_first_only"));
    5
    group.add(continueBox);
                                                        
                                                                      
    6
    groupingMode = new JComboBox(m);
    6
    continueBox.setSelected(true);
                                                                      
                                                                            
    7
    groupingMode.setSelectedIndex(0);
    7
    panel.add(continueBox);
    7
    panel.add(continueBox);
    Preondition Violations
    Unmatched statement panel.add(continueBox); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                        
                                                                                
    8
    groupingMode.addItemListener(this);
    8
    stopThrdBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_thread"));
                                                                                                                                                                                        
                                                                                                                                                  
    9
    JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode"));
    9
    group.add(stopThrdBox);
                                                        
                                                                              
    10
    label2.setLabelFor(groupingMode);
    10
    panel.add(stopThrdBox);
    10
    panel.add(stopThrdBox);
    12
    panel.add(label2);
    Differences
    Expression1Expression2Difference
    stopThrdBoxlabel2VARIABLE_NAME_MISMATCH
    javax.swing.JRadioButtonjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    12
    panel.add(label2);
    11
    stopTestBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_test"));
                                                                                                                                                                                      
    12
    group.add(stopTestBox);
                                                          
    13
    panel.add(stopTestBox);
    13
    panel.add(stopTestBox);
    13
    panel.add(groupingMode);
    Differences
    Expression1Expression2Difference
    stopTestBoxgroupingModeVARIABLE_NAME_MISMATCH
    javax.swing.JRadioButtonjavax.swing.JComboBoxSUBCLASS_TYPE_MISMATCH
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    13
    panel.add(groupingMode);
    14
    return panel;
    14
    return panel;
    14
    return panel;
    Differences
    Expression1Expression2Difference
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    14
    return panel;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement panel.add(continueBox); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Clone fragment #1 returns variables panel , while Clone fragment #2 returns variables