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;
JLabel label = new JLabel(JMeterUtils.getResString("resultsaver_prefix")); // $NON-NLS-1$ filename = new JTextField(10); filename.setName(ResultSaver.FILENAME); label.setLabelFor(filename); JPanel filenamePanel = new JPanel(new BorderLayout(5, 0)); filenamePanel.add(label, BorderLayout.WEST); filenamePanel.add(filename, BorderLayout.CENTER); return filenamePanel;
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/reporters/gui/ResultSaverGui.java
Method name: JPanel createClosePortPanel() Method name: JPanel createFilenamePanel()
Number of AST nodes: 8 Number of AST nodes: 8
1
JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection")); //$NON-NLS-1$
1
JLabel label = new JLabel(JMeterUtils.getResString("resultsaver_prefix")); // $NON-NLS-1$
2
        reUseConnection = new JCheckBox("", true);
3
		reUseConnection.setName(RE_USE_CONNECTION
2
		filename = new JTextField(10);
4
);
3
		filename.setName(ResultSaver.FILENAME);
5
		label.setLabelFor(reUseConnection);
4
		label.setLabelFor(filename);
6
		JPanel closePortPanel = new JPanel(new BorderLayout(5, 0));
5
		JPanel filenamePanel = new JPanel(new BorderLayout(5, 0));
7
		closePortPanel.add(label, BorderLayout.WEST);
6
		filenamePanel.add(label, BorderLayout.WEST);
8
		closePortPanel.add(reUseConnection, BorderLayout.CENTER);
7
		filenamePanel.add(filename, BorderLayout.CENTER);
9
		return closePortPanel;
8
		return filenamePanel;
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 comparisons29
  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("reuseconnection"));
    1
    JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection"));
    1
    JLabel label = new JLabel(JMeterUtils.getResString("resultsaver_prefix"));
    Differences
    Expression1Expression2Difference
    "reuseconnection""resultsaver_prefix"LITERAL_VALUE_MISMATCH
    1
    JLabel label = new JLabel(JMeterUtils.getResString("resultsaver_prefix"));
    2
    reUseConnection = new JCheckBox("", true);
    2
    reUseConnection = new JCheckBox("", true);
    2
    filename = new JTextField(10);
    Differences
    Expression1Expression2Difference
    reUseConnectionfilenameVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    new JCheckBox("",true)new JTextField(10)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression reUseConnection is a field being modified, and thus it cannot be parameterized
    Expression filename is a field being modified, and thus it cannot be parameterized
    2
    filename = new JTextField(10);
    3
    reUseConnection.setName(RE_USE_CONNECTION);
    3
    reUseConnection.setName(RE_USE_CONNECTION);
    3
    filename.setName(ResultSaver.FILENAME);
    Differences
    Expression1Expression2Difference
    RE_USE_CONNECTIONResultSaver.FILENAMETYPE_COMPATIBLE_REPLACEMENT
    reUseConnectionfilenameVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression filename cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    filename.setName(ResultSaver.FILENAME);
    4
    label.setLabelFor(reUseConnection);
    4
    label.setLabelFor(reUseConnection);
    4
    label.setLabelFor(filename);
    Differences
    Expression1Expression2Difference
    reUseConnectionfilenameVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression filename cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    label.setLabelFor(filename);
    5
    JPanel closePortPanel = new JPanel(new BorderLayout(5, 0));
    5
    JPanel closePortPanel = new JPanel(new BorderLayout(5, 0));
    5
    JPanel filenamePanel = new JPanel(new BorderLayout(5, 0));
    Differences
    Expression1Expression2Difference
    closePortPanelfilenamePanelVARIABLE_NAME_MISMATCH
    5
    JPanel filenamePanel = new JPanel(new BorderLayout(5, 0));
    6
    closePortPanel.add(label, BorderLayout.WEST);
    6
    closePortPanel.add(label, BorderLayout.WEST);
    6
    filenamePanel.add(label, BorderLayout.WEST);
    Differences
    Expression1Expression2Difference
    closePortPanelfilenamePanelVARIABLE_NAME_MISMATCH
    6
    filenamePanel.add(label, BorderLayout.WEST);
    7
    closePortPanel.add(reUseConnection, BorderLayout.CENTER);
    7
    closePortPanel.add(reUseConnection, BorderLayout.CENTER);
    7
    filenamePanel.add(filename, BorderLayout.CENTER);
    Differences
    Expression1Expression2Difference
    reUseConnectionfilenameVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    closePortPanelfilenamePanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression filename cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    filenamePanel.add(filename, BorderLayout.CENTER);
    8
    return closePortPanel;
    8
    return closePortPanel;
    8
    return filenamePanel;
    Differences
    Expression1Expression2Difference
    closePortPanelfilenamePanelVARIABLE_NAME_MISMATCH
    8
    return filenamePanel;
    Precondition Violations (8)
    Row Violation
    1Expression reUseConnection is a field being modified, and thus it cannot be parameterized
    2Expression filename is a field being modified, and thus it cannot be parameterized
    3Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression filename cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression filename cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression reUseConnection cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression filename cannot be parameterized, because it has dependencies to/from statements that will be extracted