JLabel label = new JLabel(JMeterUtils.getResString("example_data")); //$NON-NLS-1$ data = new JTextArea(); data.setName(ExampleSampler.DATA); label.setLabelFor(data); JPanel dataPanel = new JPanel(new BorderLayout(5, 0)); dataPanel.add(label, BorderLayout.WEST); dataPanel.add(data, BorderLayout.CENTER); return dataPanel;
JLabel label = new JLabel(JMeterUtils.getResString("tcp_timeout")); // $NON-NLS-1$ timeout = new JTextField(10); timeout.setName(TIMEOUT); label.setLabelFor(timeout); JPanel timeoutPanel = new JPanel(new BorderLayout(5, 0)); timeoutPanel.add(label, BorderLayout.WEST); timeoutPanel.add(timeout, BorderLayout.CENTER); return timeoutPanel;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/examples/sampler/gui/ExampleSamplerGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java
Method name: Component createDataPanel() Method name: JPanel createTimeoutPanel()
Number of AST nodes: 8 Number of AST nodes: 8
1
JLabel label = new JLabel(JMeterUtils.getResString("example_data")); //$NON-NLS-1$
1
JLabel label = new JLabel(JMeterUtils.getResString("tcp_timeout")); // $NON-NLS-1$
2
		data = new JTextArea();
2
		timeout = new JText
3
		data.setName(ExampleSampler.DATA
3
Field(10);
4
);
4
		timeout.setName(TIMEOUT);
5
		label.setLabelFor(data);
5
		label.setLabelFor(timeout);
6
		JPanel dataPanel = new JPanel(new BorderLayout(5, 0));
6
		JPanel timeoutPanel = new JPanel(new BorderLayout(5, 0));
7
		dataPanel.add(label, BorderLayout.WEST);
7
		timeoutPanel.add(label, BorderLayout.WEST);
8
		dataPanel.add(data, BorderLayout.CENTER);
8
		timeoutPanel.add(timeout, BorderLayout.CENTER);
9
		return dataPanel;
9
		return timeoutPanel;
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 comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    JLabel label = new JLabel(JMeterUtils.getResString("example_data"));
    1
    JLabel label = new JLabel(JMeterUtils.getResString("example_data"));
    1
    JLabel label = new JLabel(JMeterUtils.getResString("tcp_timeout"));
    Differences
    Expression1Expression2Difference
    "example_data""tcp_timeout"LITERAL_VALUE_MISMATCH
    1
    JLabel label = new JLabel(JMeterUtils.getResString("tcp_timeout"));
    2
    data = new JTextArea();
    2
    data = new JTextArea();
    2
    timeout = new JTextField(10);
    Differences
    Expression1Expression2Difference
    datatimeoutVARIABLE_NAME_MISMATCH
    javax.swing.JTextAreajavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    javax.swing.JTextAreajavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    new JTextArea()new JTextField(10)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression data is a field being modified, and thus it cannot be parameterized
    Expression timeout is a field being modified, and thus it cannot be parameterized
    2
    timeout = new JTextField(10);
    3
    data.setName(ExampleSampler.DATA);
    3
    data.setName(ExampleSampler.DATA);
    3
    timeout.setName(TIMEOUT);
    Differences
    Expression1Expression2Difference
    ExampleSampler.DATATIMEOUTTYPE_COMPATIBLE_REPLACEMENT
    datatimeoutVARIABLE_NAME_MISMATCH
    javax.swing.JTextAreajavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression data cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression timeout cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    timeout.setName(TIMEOUT);
    4
    label.setLabelFor(data);
    4
    label.setLabelFor(data);
    4
    label.setLabelFor(timeout);
    Differences
    Expression1Expression2Difference
    datatimeoutVARIABLE_NAME_MISMATCH
    javax.swing.JTextAreajavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression data cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression timeout cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    label.setLabelFor(timeout);
    5
    JPanel dataPanel = new JPanel(new BorderLayout(5, 0));
    5
    JPanel dataPanel = new JPanel(new BorderLayout(5, 0));
    5
    JPanel timeoutPanel = new JPanel(new BorderLayout(5, 0));
    Differences
    Expression1Expression2Difference
    dataPaneltimeoutPanelVARIABLE_NAME_MISMATCH
    5
    JPanel timeoutPanel = new JPanel(new BorderLayout(5, 0));
    6
    dataPanel.add(label, BorderLayout.WEST);
    6
    dataPanel.add(label, BorderLayout.WEST);
    6
    timeoutPanel.add(label, BorderLayout.WEST);
    Differences
    Expression1Expression2Difference
    dataPaneltimeoutPanelVARIABLE_NAME_MISMATCH
    6
    timeoutPanel.add(label, BorderLayout.WEST);
    7
    dataPanel.add(data, BorderLayout.CENTER);
    7
    dataPanel.add(data, BorderLayout.CENTER);
    7
    timeoutPanel.add(timeout, BorderLayout.CENTER);
    Differences
    Expression1Expression2Difference
    datatimeoutVARIABLE_NAME_MISMATCH
    javax.swing.JTextAreajavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    dataPaneltimeoutPanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression data cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression timeout cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    timeoutPanel.add(timeout, BorderLayout.CENTER);
    8
    return dataPanel;
    8
    return dataPanel;
    8
    return timeoutPanel;
    Differences
    Expression1Expression2Difference
    dataPaneltimeoutPanelVARIABLE_NAME_MISMATCH
    8
    return timeoutPanel;
    Precondition Violations (8)
    Row Violation
    1Expression data is a field being modified, and thus it cannot be parameterized
    2Expression timeout is a field being modified, and thus it cannot be parameterized
    3Expression data cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression timeout cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression data cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression timeout cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression data cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression timeout cannot be parameterized, because it has dependencies to/from statements that will be extracted