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;
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/ftp/config/gui/FtpConfigGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/gui/ThreadGroupGui.java
Method name: JPanel createOptionsPanel() Method name: JPanel createOnErrorPanel()
Number of AST nodes: 14 Number of AST nodes: 13
1
ButtonGroup group = new ButtonGroup();
2
		getBox = new JRadioButton
1
JPanel panel = new JPanel();
3
(JMeterUtils.getResString("ftp_get")); //$NON-NLS-1$
2
		panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("sampler_on_error_action"))); // $NON-NLS-1$
4
		group.add(getBox);
3
		
5
		getBox.setSelected(true);
6
		put
4
ButtonGroup group = new ButtonGroup();
7
Box = new JRadioButton(JMeterUtils.getResString("ftp_put")); //$NON-NLS-1$
5
		continueBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_continue")); // $NON-NLS-1$
8
		group.add(putBox);
6
		group.add(
9
		binaryMode = new JCheckBox(JMeterUtils.getResString("ftp_binary_mode
7
continueBox);
8
		panel.add(continueBox);
10
")); //$NON-NLS-1$
9
		stopThrdBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_thread")); // $NON-NLS-1$
11
		saveResponseData = new JCheckBox
10
		group.add(stopThrdBox);
11
		panel.add(stopThrdBox);
12
(JMeterUtils.getResString("ftp_save_response_data")); //$NON-NLS-1$
12
		stopTestBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_test")); // $NON-NLS-1$
13
		
13
		
14
		
15
		JPanel optionsPanel = new HorizontalPanel();
16
		optionsPanel.add(getBox);
17
		optionsPanel.add(putBox);
14
group.add(stopTestBox);
18
		optionsPanel.add(binaryMode);
15
		panel.add(
19
		optionsPanel.add(saveResponseData);
16
stopTestBox);
20
		return optionsPanel;
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 comparisons93
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    ButtonGroup group = new ButtonGroup();
    3
    ButtonGroup group = new ButtonGroup();
    2
    getBox = new JRadioButton(JMeterUtils.getResString("ftp_get"));
    2
    getBox = new JRadioButton(JMeterUtils.getResString("ftp_get"));
    4
    continueBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_continue"));
    Differences
    Expression1Expression2Difference
    getBoxcontinueBoxVARIABLE_NAME_MISMATCH
    "ftp_get""sampler_on_error_continue"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression getBox is a field being modified, and thus it cannot be parameterized
    Expression continueBox is a field being modified, and thus it cannot be parameterized
    4
    continueBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_continue"));
    3
    group.add(getBox);
    3
    group.add(getBox);
    5
    group.add(continueBox);
    Differences
    Expression1Expression2Difference
    getBoxcontinueBoxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression continueBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    group.add(continueBox);
    4
    getBox.setSelected(true);
                                                            
    5
    putBox = new JRadioButton(JMeterUtils.getResString("ftp_put"));
    5
    putBox = new JRadioButton(JMeterUtils.getResString("ftp_put"));
    7
    stopThrdBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_thread"));
    Differences
    Expression1Expression2Difference
    putBoxstopThrdBoxVARIABLE_NAME_MISMATCH
    "ftp_put""sampler_on_error_stop_thread"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression putBox is a field being modified, and thus it cannot be parameterized
    Expression stopThrdBox is a field being modified, and thus it cannot be parameterized
    7
    stopThrdBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_thread"));
    6
    group.add(putBox);
    6
    group.add(putBox);
    8
    group.add(stopThrdBox);
    Differences
    Expression1Expression2Difference
    putBoxstopThrdBoxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression putBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression stopThrdBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    group.add(stopThrdBox);
    7
    binaryMode = new JCheckBox(JMeterUtils.getResString("ftp_binary_mode"));
    7
    binaryMode = new JCheckBox(JMeterUtils.getResString("ftp_binary_mode"));
    10
    stopTestBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_test"));
    Differences
    Expression1Expression2Difference
    binaryModestopTestBoxVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JRadioButtonSUBCLASS_TYPE_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JRadioButtonSUBCLASS_TYPE_MISMATCH
    "ftp_binary_mode""sampler_on_error_stop_test"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression binaryMode is a field being modified, and thus it cannot be parameterized
    Expression stopTestBox is a field being modified, and thus it cannot be parameterized
    10
    stopTestBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_test"));
    8
    saveResponseData = new JCheckBox(JMeterUtils.getResString("ftp_save_response_data"));
                                                                                                                                                                                
    9
    JPanel optionsPanel = new HorizontalPanel();
    9
    JPanel optionsPanel = new HorizontalPanel();
    1
    JPanel panel = new JPanel();
    Differences
    Expression1Expression2Difference
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    org.apache.jmeter.gui.util.HorizontalPaneljavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    1
    JPanel panel = new JPanel();
                                                                                                                                                                                                                        
    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")));
    10
    optionsPanel.add(getBox);
    10
    optionsPanel.add(getBox);
    6
    panel.add(continueBox);
    Differences
    Expression1Expression2Difference
    getBoxcontinueBoxVARIABLE_NAME_MISMATCH
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression continueBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    panel.add(continueBox);
    11
    optionsPanel.add(putBox);
    11
    optionsPanel.add(putBox);
    9
    panel.add(stopThrdBox);
    Differences
    Expression1Expression2Difference
    putBoxstopThrdBoxVARIABLE_NAME_MISMATCH
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression putBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression stopThrdBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    panel.add(stopThrdBox);
                                                          
    11
    group.add(stopTestBox);
    12
    optionsPanel.add(binaryMode);
    12
    optionsPanel.add(binaryMode);
    12
    panel.add(stopTestBox);
    Differences
    Expression1Expression2Difference
    binaryModestopTestBoxVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JRadioButtonSUBCLASS_TYPE_MISMATCH
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression binaryMode cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression stopTestBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    panel.add(stopTestBox);
    13
    optionsPanel.add(saveResponseData);
                                                                                  
    14
    return optionsPanel;
    14
    return optionsPanel;
    13
    return panel;
    Differences
    Expression1Expression2Difference
    optionsPanelpanelVARIABLE_NAME_MISMATCH
    13
    return panel;
    Precondition Violations (18)
    Row Violation
    1Expression getBox is a field being modified, and thus it cannot be parameterized
    2Expression continueBox is a field being modified, and thus it cannot be parameterized
    3Expression getBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression continueBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression putBox is a field being modified, and thus it cannot be parameterized
    6Expression stopThrdBox is a field being modified, and thus it cannot be parameterized
    7Expression putBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression stopThrdBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression binaryMode is a field being modified, and thus it cannot be parameterized
    10Expression stopTestBox is a field being modified, and thus it cannot be parameterized
    11Unmatched 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
    12Expression getBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression continueBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression putBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression stopThrdBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression binaryMode cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression stopTestBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Clone fragment #1 returns variables optionsPanel , while Clone fragment #2 returns variables panel, group