ButtonGroup group = new ButtonGroup(); getBox = new JRadioButton(JMeterUtils.getResString("ftp_get")); //$NON-NLS-1$ group.add(getBox); getBox.setSelected(true); putBox = new JRadioButton(JMeterUtils.getResString("ftp_put")); //$NON-NLS-1$ group.add(putBox); binaryMode = new JCheckBox(JMeterUtils.getResString("ftp_binary_mode")); //$NON-NLS-1$ saveResponseData = new JCheckBox(JMeterUtils.getResString("ftp_save_response_data")); //$NON-NLS-1$ JPanel optionsPanel = new HorizontalPanel(); optionsPanel.add(getBox); optionsPanel.add(putBox); optionsPanel.add(binaryMode); optionsPanel.add(saveResponseData); return optionsPanel;
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/protocol/ftp/config/gui/FtpConfigGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Method name: JPanel createOptionsPanel() Method name: JPanel createGroupingPanel()
Number of AST nodes: 14 Number of AST nodes: 14
1
ButtonGroup group = new ButtonGroup();
2
		getBox = new JRadioButton
1
DefaultComboBoxModel m = new DefaultComboBoxModel();
2
		// Note: position of these elements in the menu *must* match the
3
		// corresponding ProxyControl.GROUPING_* values.
3
(JMeterUtils.getResString("ftp_get")); //$NON-NLS-1$
4
		m.addElement(JMeterUtils.getResString("grouping_no_groups")); // $NON-NLS-1$
4
		group.add(getBox);
5
		
5
		getBox.setSelected(true);
6
		putBox = new JRadioButton
6
m.addElement(JMeterUtils.getResString("grouping_add_separators")); // $NON-NLS-1$
7
(JMeterUtils.getResString("ftp_put")); //$NON-NLS-1$
7
		m.addElement(JMeterUtils.getResString("grouping_in_controllers")); // $NON-NLS-1$
8
		group.add(putBox);
8
		
9
		binaryMode = new JCheckBox(JMeterUtils.getResString("ftp_binary_mode")); //$NON-NLS-1$
9
m.addElement(JMeterUtils.getResString("grouping_store_first_only")); // $NON-NLS-1$
10
		saveResponseData = new JCheckBox
10
		groupingMode = new JComboBox(m);
11
		groupingMode.setSelectedIndex(0);
12
		groupingMode.addItemListener(this);
11
(JMeterUtils.getResString("ftp_save_response_data")); //$NON-NLS-1$
13
		JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode")); // $NON-NLS-1$
12
		
14
		
13
		
14
		JPanel optionsP
15
label2.setLabelFor(groupingMode);
15
anel = new HorizontalPanel();
16
		HorizontalPanel panel = new HorizontalPanel();
16
		optionsPanel.add(getBox);
17
		panel.add(
17
		optionsPanel.add(putBox);
18
		optionsPanel.add(binaryMode);
19
		optionsPanel.add(saveResponseData);
18
label2);
19
		panel.add(groupingMode);
20
		return optionsPanel;
20
		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 comparisons169
  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();
    1
    ButtonGroup group = new ButtonGroup();
                                                                                  
                                                                                                                                    
    2
    m.addElement(JMeterUtils.getResString("grouping_no_groups"));
    2
    getBox = new JRadioButton(JMeterUtils.getResString("ftp_get"));
                                                                                                                                    
                                                                                                                                              
    3
    m.addElement(JMeterUtils.getResString("grouping_add_separators"));
    3
    group.add(getBox);
                                              
                                                                                                                                              
    4
    m.addElement(JMeterUtils.getResString("grouping_in_controllers"));
    4
    getBox.setSelected(true);
                                                            
                                                                                                                                                  
    5
    m.addElement(JMeterUtils.getResString("grouping_store_first_only"));
    5
    putBox = new JRadioButton(JMeterUtils.getResString("ftp_put"));
                                                                                                                                    
                                                                      
    6
    groupingMode = new JComboBox(m);
    6
    group.add(putBox);
                                              
                                                                            
    7
    groupingMode.setSelectedIndex(0);
    7
    binaryMode = new JCheckBox(JMeterUtils.getResString("ftp_binary_mode"));
                                                                                                                                                      
                                                                                
    8
    groupingMode.addItemListener(this);
    8
    saveResponseData = new JCheckBox(JMeterUtils.getResString("ftp_save_response_data"));
                                                                                                                                                                                
                                                                                                                                                  
    9
    JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode"));
                                                                              
    10
    label2.setLabelFor(groupingMode);
    9
    JPanel optionsPanel = new HorizontalPanel();
    9
    JPanel optionsPanel = new HorizontalPanel();
    11
    HorizontalPanel panel = new HorizontalPanel();
    Differences
    Expression1Expression2Difference
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    11
    HorizontalPanel panel = new HorizontalPanel();
    10
    optionsPanel.add(getBox);
                                                              
    11
    optionsPanel.add(putBox);
    11
    optionsPanel.add(putBox);
    Preondition Violations
    Unmatched statement optionsPanel.add(putBox); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                              
    12
    optionsPanel.add(binaryMode);
    12
    optionsPanel.add(binaryMode);
    12
    panel.add(label2);
    Differences
    Expression1Expression2Difference
    binaryModelabel2VARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    12
    panel.add(label2);
    13
    optionsPanel.add(saveResponseData);
    13
    optionsPanel.add(saveResponseData);
    13
    panel.add(groupingMode);
    Differences
    Expression1Expression2Difference
    saveResponseDatagroupingModeVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JComboBoxSUBCLASS_TYPE_MISMATCH
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    13
    panel.add(groupingMode);
    14
    return optionsPanel;
    14
    return optionsPanel;
    14
    return panel;
    Differences
    Expression1Expression2Difference
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    javax.swing.JPanelorg.apache.jmeter.gui.util.HorizontalPanelSUBCLASS_TYPE_MISMATCH
    14
    return panel;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement optionsPanel.add(putBox); 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 optionsPanel , while Clone fragment #2 returns variables