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;
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); 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;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/gui/ThreadGroupGui.java
Method name: JPanel createGroupingPanel() Method name: JPanel createOnErrorPanel()
Number of AST nodes: 14 Number of AST nodes: 13
1
DefaultComboBoxModel m = new DefaultComboBoxModel();
2
		// Note: position of these elements in the menu *must* match the
3
		// corresponding ProxyControl.GROUPING_* values.
4
		m.addElement
1
JPanel panel = new JPanel();
5
(JMeterUtils.getResString("grouping_no_groups")); // $NON-NLS-1$
2
		panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("
6
		m.addElement(JMeterUtils.getResString("grouping_add_separators")); // $NON-NLS-1$
7
		m.addElement
3
sampler_on_error_action"))); // $NON-NLS-1$
4
		ButtonGroup group = new ButtonGroup();
8
(JMeterUtils.getResString("grouping_in_controllers")); // $NON-NLS-1$
5
		continueBox = new JRadioButton(JMeterUtils.getResString("
9
		m.addElement
6
sampler_on_error_continue")); // $NON-NLS-1$
7
		group.add(continueBox);
8
		panel.add(continueBox);
10
(JMeterUtils.getResString("grouping_store_first_only")); // $NON-NLS-1$
9
		stopThrdBox = new JRadioButton(JMeterUtils.getResString("
11
		groupingMode = new JComboBox(m);
12
		groupingMode.setSelectedIndex(0);
13
		groupingMode.addItemListener(this);
14
		JLabel label2 = new JLabel
10
sampler_on_error_stop_thread")); // $NON-NLS-1$
11
		group.add(stopThrdBox);
12
		panel.add(stopThrdBox);
15
(JMeterUtils.getResString("grouping_mode")); // $NON-NLS-1$
13
		stopTestBox = new JRadioButton(JMeterUtils.getResString("
16
		label2.setLabelFor(groupingMode);
17
		HorizontalPanel panel = new HorizontalPanel();
18
		panel.add(label2
14
sampler_on_error_stop_test")); // $NON-NLS-1$
19
);
15
		group.add(stopTestBox);
20
		panel.add(groupingMode);
16
		panel.add(stopTestBox);
21
		return panel;
17
		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 comparisons174
  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 fragment9
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    DefaultComboBoxModel m = new DefaultComboBoxModel();
                                                                                                              
                                                                                                                                                                                                                        
    2
    panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("sampler_on_error_action")));
    Preondition Violations
    Unmatched statement panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("sampler_on_error_action"))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("sampler_on_error_action")));
    2
    m.addElement(JMeterUtils.getResString("grouping_no_groups"));
                                                                                                                                    
                                                                                  
    3
    ButtonGroup group = new ButtonGroup();
    3
    m.addElement(JMeterUtils.getResString("grouping_add_separators"));
                                                                                                                                              
                                                                                                                                                                                  
    4
    continueBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_continue"));
    4
    m.addElement(JMeterUtils.getResString("grouping_in_controllers"));
                                                                                                                                              
                                                        
    5
    group.add(continueBox);
    5
    m.addElement(JMeterUtils.getResString("grouping_store_first_only"));
                                                                                                                                                  
    6
    groupingMode = new JComboBox(m);
                                                                      
                                                                                                                                                                                        
    7
    stopThrdBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_thread"));
    7
    groupingMode.setSelectedIndex(0);
                                                                            
                                                        
    8
    group.add(stopThrdBox);
    8
    groupingMode.addItemListener(this);
                                                                                
    9
    JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode"));
    9
    JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode"));
    1
    JPanel panel = new JPanel();
    Differences
    Expression1Expression2Difference
    javax.swing.JLabeljavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    label2panelVARIABLE_NAME_MISMATCH
    javax.swing.JLabeljavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    javax.swing.JLabeljavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    new JLabel(JMeterUtils.getResString("grouping_mode"))new JPanel()ARGUMENT_NUMBER_MISMATCH
    1
    JPanel panel = new JPanel();
    10
    label2.setLabelFor(groupingMode);
                                                                              
    11
    HorizontalPanel panel = new HorizontalPanel();
                                                                                                    
    12
    panel.add(label2);
    12
    panel.add(label2);
    9
    panel.add(stopThrdBox);
    Differences
    Expression1Expression2Difference
    label2stopThrdBoxVARIABLE_NAME_MISMATCH
    javax.swing.JLabeljavax.swing.JRadioButtonSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.gui.util.HorizontalPaneljavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression label2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    panel.add(stopThrdBox);
    13
    panel.add(groupingMode);
    13
    panel.add(groupingMode);
    6
    panel.add(continueBox);
    Differences
    Expression1Expression2Difference
    groupingModecontinueBoxVARIABLE_NAME_MISMATCH
    javax.swing.JComboBoxjavax.swing.JRadioButtonSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.gui.util.HorizontalPaneljavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    6
    panel.add(continueBox);
                                                                                                                                                                                      
    10
    stopTestBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_test"));
                                                          
    11
    group.add(stopTestBox);
                                                          
    12
    panel.add(stopTestBox);
    14
    return panel;
    14
    return panel;
    13
    return panel;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.util.HorizontalPaneljavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    13
    return panel;
    Precondition Violations (3)
    Row Violation
    1Unmatched statement panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("sampler_on_error_action"))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression label2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variable label2 with type javax.swing.JLabel , while Clone fragment #2 returns variable panel with type javax.swing.JPanel