cookieTable = new JTable(tableModel); cookieTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); cookieTable.setPreferredScrollableViewportSize(new Dimension(100, 70)); JPanel buttonPanel = createButtonPanel(); JPanel panel = new JPanel(new BorderLayout(0, 5)); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils .getResString("cookies_stored"))); //$NON-NLS-1$ panel.add(new JScrollPane(cookieTable), BorderLayout.CENTER); panel.add(buttonPanel, BorderLayout.SOUTH); return panel;
headerTable = new JTable(tableModel); headerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); headerTable.setPreferredScrollableViewportSize(new Dimension(100, 70)); JPanel panel = new JPanel(new BorderLayout(0, 5)); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("headers_stored"))); // $NON-NLS-1$ panel.add(new JScrollPane(headerTable), BorderLayout.CENTER); panel.add(createButtonPanel(), BorderLayout.SOUTH); return panel;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/gui/CookiePanel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/gui/HeaderPanel.java
Method name: JPanel createCookieTablePanel() Method name: JPanel createHeaderTablePanel()
Number of AST nodes: 9 Number of AST nodes: 8
1
cookieTable = new JTable(tableModel);
1
headerTable = new JTable(tableModel);
2
		cookieTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
2
		headerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
3
		cookieTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
3
		headerTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
4
		JPanel buttonPanel = createButtonPanel();
5
		JPanel panel = new JPanel(new BorderLayout(0, 5));
4
		JPanel panel = new JPanel(new BorderLayout(0, 5));
6
		panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), 
5
		panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
7
JMeterUtils
6
				JMeterUtils
8
				.getResString("cookies_stored"))); //$NON-NLS-1$
7
.getResString("headers_stored"))); // $NON-NLS-1$
9
		panel.add(new JScrollPane(cookieTable), BorderLayout.CENTER);
8
		panel.add(new JScrollPane(headerTable), BorderLayout.CENTER);
10
		panel.add(buttonPanel, BorderLayout.SOUTH);
9
		panel.add(createButtonPanel(), BorderLayout.SOUTH);
11
		return panel;
10
		return panel;
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 comparisons33
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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
    cookieTable = new JTable(tableModel);
    1
    cookieTable = new JTable(tableModel);
    1
    headerTable = new JTable(tableModel);
    Differences
    Expression1Expression2Difference
    cookieTableheaderTableVARIABLE_NAME_MISMATCH
    org.apache.jmeter.gui.util.PowerTableModelorg.apache.jmeter.protocol.http.gui.HeaderPanel.InnerTableModelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression cookieTable is a field being modified, and thus it cannot be parameterized
    Expression headerTable is a field being modified, and thus it cannot be parameterized
    1
    headerTable = new JTable(tableModel);
    2
    cookieTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    2
    cookieTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    2
    headerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    Differences
    Expression1Expression2Difference
    cookieTableheaderTableVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cookieTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression headerTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    headerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    3
    cookieTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
    3
    cookieTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
    3
    headerTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
    Differences
    Expression1Expression2Difference
    cookieTableheaderTableVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cookieTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression headerTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    headerTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
    4
    JPanel buttonPanel = createButtonPanel();
                                                                                        
    5
    JPanel panel = new JPanel(new BorderLayout(0, 5));
    4
    JPanel panel = new JPanel(new BorderLayout(0, 5));
    6
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("cookies_stored")));
    6
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("cookies_stored")));
    5
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("headers_stored")));
    Differences
    Expression1Expression2Difference
    "cookies_stored""headers_stored"LITERAL_VALUE_MISMATCH
    5
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("headers_stored")));
    7
    panel.add(new JScrollPane(cookieTable), BorderLayout.CENTER);
    7
    panel.add(new JScrollPane(cookieTable), BorderLayout.CENTER);
    6
    panel.add(new JScrollPane(headerTable), BorderLayout.CENTER);
    Differences
    Expression1Expression2Difference
    cookieTableheaderTableVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression cookieTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression headerTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    panel.add(new JScrollPane(headerTable), BorderLayout.CENTER);
    8
    panel.add(buttonPanel, BorderLayout.SOUTH);
    8
    panel.add(buttonPanel, BorderLayout.SOUTH);
    7
    panel.add(createButtonPanel(), BorderLayout.SOUTH);
    Differences
    Expression1Expression2Difference
    buttonPanelcreateButtonPanel()TYPE_COMPATIBLE_REPLACEMENT
    7
    panel.add(createButtonPanel(), BorderLayout.SOUTH);
    9
    return panel;
    8
    return panel;
    Precondition Violations (8)
    Row Violation
    1Expression cookieTable is a field being modified, and thus it cannot be parameterized
    2Expression headerTable is a field being modified, and thus it cannot be parameterized
    3Expression cookieTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression headerTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression cookieTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression headerTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression cookieTable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression headerTable cannot be parameterized, because it has dependencies to/from statements that will be extracted