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