setLayout(new BorderLayout(5, 0)); commentField = new JTextArea(); JLabel commentLabel = new JLabel(JMeterUtils.getResString("testplan_comments")); //$NON-NLS-1$ commentLabel.setLabelFor(commentField); JPanel commentPanel = new JPanel(); commentPanel.setLayout(new BorderLayout(0, 5)); commentPanel.add(commentLabel,BorderLayout.WEST); commentPanel.add(commentField,BorderLayout.CENTER); add(commentPanel);
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/gui/CommentPanel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java
Method name: void init() Method name: JPanel createClosePortPanel()
Number of AST nodes: 9 Number of AST nodes: 8
1
setLayout(new BorderLayout(5, 0));
2
		commentField = new JTextArea();
3
		JLabel commentLabel = new JLabel(JMeterUtils.getResString("testplan_comments")); //$NON-NLS-1$
1
JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection")); //$NON-NLS-1$
4
		commentL
2
        reUseConnection = new JCheckBox("", true);
3
		reUseConnection.setName(RE_USE_CONNECTION);
5
abel.setLabelFor(commentField);
4
		label.setLabelFor(reUseConnection);
6
		JPanel commentPanel = new JPanel();
5
		JPanel closePortPanel = new JPanel(
7
		commentPanel.setLayout(new BorderLayout(0, 5));
6
new BorderLayout(5, 0));
8
		commentPanel.add(commentLabel,BorderLayout.WEST);
7
		closePortPanel.add(label, BorderLayout.WEST);
9
		commentPanel.add(commentField,BorderLayout.CENTER);
8
		closePortPanel.add(reUseConnection, BorderLayout.CENTER);
10
		add(commentPanel);
9
		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 comparisons35
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    setLayout(new BorderLayout(5, 0));
                                                                            
    2
    commentField = new JTextArea();
    2
    commentField = new JTextArea();
    2
    reUseConnection = new JCheckBox("", true);
    Differences
    Expression1Expression2Difference
    commentFieldreUseConnectionVARIABLE_NAME_MISMATCH
    javax.swing.JTextAreajavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    javax.swing.JTextAreajavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    new JTextArea()new JCheckBox("",true)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression commentField 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);
    3
    JLabel commentLabel = new JLabel(JMeterUtils.getResString("testplan_comments"));
    3
    JLabel commentLabel = new JLabel(JMeterUtils.getResString("testplan_comments"));
    1
    JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection"));
    Differences
    Expression1Expression2Difference
    commentLabellabelVARIABLE_NAME_MISMATCH
    "testplan_comments""reuseconnection"LITERAL_VALUE_MISMATCH
    1
    JLabel label = new JLabel(JMeterUtils.getResString("reuseconnection"));
                                                                                                
    3
    reUseConnection.setName(RE_USE_CONNECTION);
    4
    commentLabel.setLabelFor(commentField);
    4
    commentLabel.setLabelFor(commentField);
    4
    label.setLabelFor(reUseConnection);
    Differences
    Expression1Expression2Difference
    commentFieldreUseConnectionVARIABLE_NAME_MISMATCH
    javax.swing.JTextAreajavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    commentLabellabelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression commentField 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 commentPanel = new JPanel();
    5
    JPanel commentPanel = new JPanel();
    5
    JPanel closePortPanel = new JPanel(new BorderLayout(5, 0));
    Differences
    Expression1Expression2Difference
    commentPanelclosePortPanelVARIABLE_NAME_MISMATCH
    new JPanel()new JPanel(new BorderLayout(5,0))ARGUMENT_NUMBER_MISMATCH
    5
    JPanel closePortPanel = new JPanel(new BorderLayout(5, 0));
    6
    commentPanel.setLayout(new BorderLayout(0, 5));
    6
    commentPanel.setLayout(new BorderLayout(0, 5));
    Preondition Violations
    Unmatched statement commentPanel.setLayout(new BorderLayout(0,5)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                      
    7
    commentPanel.add(commentLabel, BorderLayout.WEST);
    7
    commentPanel.add(commentLabel, BorderLayout.WEST);
    6
    closePortPanel.add(label, BorderLayout.WEST);
    Differences
    Expression1Expression2Difference
    commentLabellabelVARIABLE_NAME_MISMATCH
    commentPanelclosePortPanelVARIABLE_NAME_MISMATCH
    6
    closePortPanel.add(label, BorderLayout.WEST);
    8
    commentPanel.add(commentField, BorderLayout.CENTER);
    8
    commentPanel.add(commentField, BorderLayout.CENTER);
    7
    closePortPanel.add(reUseConnection, BorderLayout.CENTER);
    Differences
    Expression1Expression2Difference
    commentFieldreUseConnectionVARIABLE_NAME_MISMATCH
    javax.swing.JTextAreajavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    commentPanelclosePortPanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression commentField 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 closePortPanel;
    9
    add(commentPanel);
                                              
    Precondition Violations (7)
    Row Violation
    1Expression commentField 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 commentField 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
    5Unmatched statement commentPanel.setLayout(new BorderLayout(0,5)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Expression commentField 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