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