port = new JTextField(6); port.setName(PORT); JLabel label = new JLabel(JMeterUtils.getResString("web_server_port")); // $NON-NLS-1$ label.setLabelFor(port); JPanel panel = new JPanel(new BorderLayout(5, 0)); panel.add(label, BorderLayout.WEST); panel.add(port, BorderLayout.CENTER); return panel;
JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection")); //$NON-NLS-1$ reUseConnection = new JCheckBox("", true); reUseConnection.setName(RE_USE_CONNECTION); label.setLabelFor(reUseConnection); JPanel closePortPanel = new JPanel(new BorderLayout(5, 0)); closePortPanel.add(label, BorderLayout.WEST); closePortPanel.add(reUseConnection, BorderLayout.CENTER); return closePortPanel;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java
Method name: JPanel getPortPanel() Method name: JPanel createClosePortPanel()
Number of AST nodes: 8 Number of AST nodes: 8
1
port = new JTextField(6);
2
		port.setName(PORT);
3
		JLabel label = new JLabel(JMeterUtils.getResString("web_server_port")); // $NON-NLS-1$
1
JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection")); //$NON-NLS-1$
2
        reUseConnection = new JCheckBox("", true);
3
		reUseConnection.setName(RE_USE_CONNECTION);
4
		label.setLabelFor(port);
4
		label.setLabelFor(reUseConnection);
5
		JPanel panel = new JPanel(new BorderLayout(5, 0));
5
		JPanel closePortPanel = new JPanel(new BorderLayout(5, 0));
6
		panel.add(label, BorderLayout.WEST);
6
		closePortPanel.add(label, BorderLayout.WEST);
7
		panel.add(port, BorderLayout.CENTER);
7
		closePortPanel.add(reUseConnection, BorderLayout.CENTER);
8
		return panel;
8
		return closePortPanel;
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
    port = new JTextField(6);
    1
    port = new JTextField(6);
    2
    reUseConnection = new JCheckBox("", true);
    Differences
    Expression1Expression2Difference
    portreUseConnectionVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    new JTextField(6)new JCheckBox("",true)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression port is a field being modified, and thus it cannot be parameterized
    Expression reUseConnection is a field being modified, and thus it cannot be parameterized
    2
    reUseConnection = new JCheckBox("", true);
    2
    port.setName(PORT);
    2
    port.setName(PORT);
    3
    reUseConnection.setName(RE_USE_CONNECTION);
    Differences
    Expression1Expression2Difference
    PORTRE_USE_CONNECTIONVARIABLE_NAME_MISMATCH
    portreUseConnectionVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression port cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    reUseConnection.setName(RE_USE_CONNECTION);
    3
    JLabel label = new JLabel(JMeterUtils.getResString("web_server_port"));
    3
    JLabel label = new JLabel(JMeterUtils.getResString("web_server_port"));
    1
    JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection"));
    Differences
    Expression1Expression2Difference
    "web_server_port""reuseconnection"LITERAL_VALUE_MISMATCH
    1
    JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection"));
    4
    label.setLabelFor(port);
    4
    label.setLabelFor(port);
    4
    label.setLabelFor(reUseConnection);
    Differences
    Expression1Expression2Difference
    portreUseConnectionVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression port cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    label.setLabelFor(reUseConnection);
    5
    JPanel panel = new JPanel(new BorderLayout(5, 0));
    5
    JPanel panel = new JPanel(new BorderLayout(5, 0));
    5
    JPanel closePortPanel = new JPanel(new BorderLayout(5, 0));
    Differences
    Expression1Expression2Difference
    panelclosePortPanelVARIABLE_NAME_MISMATCH
    5
    JPanel closePortPanel = new JPanel(new BorderLayout(5, 0));
    6
    panel.add(label, BorderLayout.WEST);
    6
    panel.add(label, BorderLayout.WEST);
    6
    closePortPanel.add(label, BorderLayout.WEST);
    Differences
    Expression1Expression2Difference
    panelclosePortPanelVARIABLE_NAME_MISMATCH
    6
    closePortPanel.add(label, BorderLayout.WEST);
    7
    panel.add(port, BorderLayout.CENTER);
    7
    panel.add(port, BorderLayout.CENTER);
    7
    closePortPanel.add(reUseConnection, BorderLayout.CENTER);
    Differences
    Expression1Expression2Difference
    portreUseConnectionVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    panelclosePortPanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression port cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    closePortPanel.add(reUseConnection, BorderLayout.CENTER);
    8
    return panel;
    8
    return panel;
    8
    return closePortPanel;
    Differences
    Expression1Expression2Difference
    panelclosePortPanelVARIABLE_NAME_MISMATCH
    8
    return closePortPanel;
    Precondition Violations (8)
    Row Violation
    1Expression port is a field being modified, and thus it cannot be parameterized
    2Expression reUseConnection is a field being modified, and thus it cannot be parameterized
    3Expression port cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression port cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression port cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted