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 reqLabel = new JLabel(JMeterUtils.getResString("tcp_request_data")); // $NON-NLS-1$ requestData = new JTextArea(3, 0); requestData.setLineWrap(true); requestData.setName(REQUEST); reqLabel.setLabelFor(requestData); JPanel reqDataPanel = new JPanel(new BorderLayout(5, 0)); reqDataPanel.add(reqLabel, BorderLayout.WEST); reqDataPanel.add(requestData, BorderLayout.CENTER); return reqDataPanel;
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 createRequestPanel()
Number of AST nodes: 9 Number of AST nodes: 9
1
setLayout(new BorderLayout(5, 0));
2
		commentField = new JTextArea();
3
		JLabel commentLabel = new JLabel(JMeterUtils.getResString("testplan_comments")); //$NON-NLS-1$
1
JLabel reqLabel = new JLabel(JMeterUtils.getResString("tcp_request_data")); // $NON-NLS-1$
4
		comment
2
		requestData = new JTextArea(3, 0);
3
		requestData.setLineWrap(true);
4
		requestData.setName(REQUEST);
5
Label.setLabelFor(commentField);
5
		reqLabel.setLabelFor(requestData);
6
		JPanel commentPanel = new JPanel();
6
		JPanel reqDataPanel = new JPanel(
7
		commentPanel.setLayout(new BorderLayout(0, 5));
7
new BorderLayout(5, 0));
8
		commentPanel.add(commentLabel,BorderLayout.WEST);
8
		reqDataPanel.add(reqLabel, BorderLayout.WEST);
9
		commentPanel.add(commentField,BorderLayout.CENTER);
9
		reqDataPanel.add(requestData, BorderLayout.CENTER);
10
		add(commentPanel);
10
		return reqDataPanel;
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 comparisons38
  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 fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    setLayout(new BorderLayout(5, 0));
                                                                            
    2
    commentField = new JTextArea();
    2
    commentField = new JTextArea();
    2
    requestData = new JTextArea(3, 0);
    Differences
    Expression1Expression2Difference
    commentFieldrequestDataVARIABLE_NAME_MISMATCH
    new JTextArea()new JTextArea(3,0)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression commentField is a field being modified, and thus it cannot be parameterized
    Expression requestData is a field being modified, and thus it cannot be parameterized
    2
    requestData = new JTextArea(3, 0);
    3
    JLabel commentLabel = new JLabel(JMeterUtils.getResString("testplan_comments"));
    3
    JLabel commentLabel = new JLabel(JMeterUtils.getResString("testplan_comments"));
    1
    JLabel reqLabel = new JLabel(JMeterUtils.getResString("tcp_request_data"));
    Differences
    Expression1Expression2Difference
    commentLabelreqLabelVARIABLE_NAME_MISMATCH
    "testplan_comments""tcp_request_data"LITERAL_VALUE_MISMATCH
    1
    JLabel reqLabel = new JLabel(JMeterUtils.getResString("tcp_request_data"));
                                                                      
    3
    requestData.setLineWrap(true);
                                                                    
    4
    requestData.setName(REQUEST);
    4
    commentLabel.setLabelFor(commentField);
    4
    commentLabel.setLabelFor(commentField);
    5
    reqLabel.setLabelFor(requestData);
    Differences
    Expression1Expression2Difference
    commentFieldrequestDataVARIABLE_NAME_MISMATCH
    commentLabelreqLabelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression commentField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression requestData cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    reqLabel.setLabelFor(requestData);
    5
    JPanel commentPanel = new JPanel();
    5
    JPanel commentPanel = new JPanel();
    6
    JPanel reqDataPanel = new JPanel(new BorderLayout(5, 0));
    Differences
    Expression1Expression2Difference
    commentPanelreqDataPanelVARIABLE_NAME_MISMATCH
    new JPanel()new JPanel(new BorderLayout(5,0))ARGUMENT_NUMBER_MISMATCH
    6
    JPanel reqDataPanel = 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);
    7
    reqDataPanel.add(reqLabel, BorderLayout.WEST);
    Differences
    Expression1Expression2Difference
    commentLabelreqLabelVARIABLE_NAME_MISMATCH
    commentPanelreqDataPanelVARIABLE_NAME_MISMATCH
    7
    reqDataPanel.add(reqLabel, BorderLayout.WEST);
    8
    commentPanel.add(commentField, BorderLayout.CENTER);
    8
    commentPanel.add(commentField, BorderLayout.CENTER);
    8
    reqDataPanel.add(requestData, BorderLayout.CENTER);
    Differences
    Expression1Expression2Difference
    commentFieldrequestDataVARIABLE_NAME_MISMATCH
    commentPanelreqDataPanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression commentField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression requestData cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    reqDataPanel.add(requestData, BorderLayout.CENTER);
                                                  
    9
    return reqDataPanel;
    9
    add(commentPanel);
                                              
    Precondition Violations (7)
    Row Violation
    1Expression commentField is a field being modified, and thus it cannot be parameterized
    2Expression requestData 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 requestData 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 requestData cannot be parameterized, because it has dependencies to/from statements that will be extracted