if (paramTable.isEditing()) { TableCellEditor cellEditor = paramTable.getCellEditor(paramTable.getEditingRow(), paramTable .getEditingColumn()); cellEditor.stopCellEditing(); } tableModel.addNewRow(); tableModel.fireTableDataChanged(); // Enable DELETE (which may already be enabled, but it won't hurt) deleteRowButton.setEnabled(true); // Highlight (select) the appropriate row. int rowToSelect = tableModel.getRowCount() - 1; paramTable.setRowSelectionInterval(rowToSelect, rowToSelect);
if (paramTable.isEditing()) { TableCellEditor cellEditor = paramTable.getCellEditor(paramTable.getEditingRow(), paramTable .getEditingColumn()); cellEditor.stopCellEditing(); } tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(), String.class); tableModel.fireTableDataChanged(); // Enable DELETE (which may already be enabled, but it won't hurt) deleteColumnButton.setEnabled(true); // Highlight (select) the appropriate row. int colToSelect = tableModel.getColumnCount() - 1; paramTable.setColumnSelectionInterval(colToSelect, colToSelect);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/modifiers/gui/UserParametersGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/modifiers/gui/UserParametersGui.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (paramTable.isEditing()) {
1
if (paramTable.isEditing()) {
2
				TableCellEditor cellEditor = paramTable.getCellEditor(paramTable.getEditingRow(), paramTable
2
				TableCellEditor cellEditor = paramTable.getCellEditor(paramTable.getEditingRow(), paramTable
3
						.getEditingColumn());
3
						.getEditingColumn());
4
				cellEditor.stopCellEditing();
4
				cellEditor.stopCellEditing();
5
			}
5
			}
6
			tableModel.addNewRow();
6
			tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(), String.class);
7
			tableModel.fireTableDataChanged();
7
			tableModel.fireTableDataChanged();
8
			// Enable DELETE (which may already be enabled, but it won't hurt)
8
			// Enable DELETE (which may already be enabled, but it won't hurt)
9
			deleteRowButton.setEnabled(true);
9
			deleteColumnButton.setEnabled(true);
10
			// Highlight (select) the appropriate row.
10
			// Highlight (select) the appropriate row.
11
			int rowToSelect = tableModel.getRowCount() - 1;
11
			int colToSelect = tableModel.getColumnCount() - 1;
12
			paramTable.setRowSelectionInterval(rowToSelect, rowToSelect);
12
			paramTable.setColumnSelectionInterval(colToSelect, colToSelect);
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.2
Clones locationClones are in the same java file
Number of node comparisons34
  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)2.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (paramTable.isEditing())
    1
    if (paramTable.isEditing())
    2
    TableCellEditor cellEditor = paramTable.getCellEditor(paramTable.getEditingRow(), paramTable.getEditingColumn());
    2
    TableCellEditor cellEditor = paramTable.getCellEditor(paramTable.getEditingRow(), paramTable.getEditingColumn());
    3
    cellEditor.stopCellEditing();
    3
    cellEditor.stopCellEditing();
    4
    tableModel.addNewRow();
    4
    tableModel.addNewRow();
    5
    tableModel.fireTableDataChanged();
    Differences
    Expression1Expression2Difference
    addNewRowfireTableDataChangedMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression tableModel.addNewRow() is a void method call, and thus it cannot be parameterized
    Expression tableModel.fireTableDataChanged() is a void method call, and thus it cannot be parameterized
    5
    tableModel.fireTableDataChanged();
    5
    tableModel.fireTableDataChanged();
    5
    tableModel.fireTableDataChanged();
    4
    tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(), String.class);
    Differences
    Expression1Expression2Difference
    fireTableDataChangedaddNewColumnMETHOD_INVOCATION_NAME_MISMATCH
    tableModel.fireTableDataChanged()tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(),String.class)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression tableModel.fireTableDataChanged() is a void method call, and thus it cannot be parameterized
    Expression tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(),String.class) is a void method call, and thus it cannot be parameterized
    Expression tableModel.fireTableDataChanged() is a void method call, and thus it cannot be parameterized
    Expression tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(),String.class) is a void method call, and thus it cannot be parameterized
    4
    tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(), String.class);
    6
    deleteRowButton.setEnabled(true);
    6
    deleteRowButton.setEnabled(true);
    6
    deleteColumnButton.setEnabled(true);
    Differences
    Expression1Expression2Difference
    deleteRowButtondeleteColumnButtonVARIABLE_NAME_MISMATCH
    6
    deleteColumnButton.setEnabled(true);
    7
    int rowToSelect = tableModel.getRowCount() - 1;
    7
    int rowToSelect = tableModel.getRowCount() - 1;
    7
    int colToSelect = tableModel.getColumnCount() - 1;
    Differences
    Expression1Expression2Difference
    rowToSelectcolToSelectVARIABLE_NAME_MISMATCH
    getRowCountgetColumnCountMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression tableModel.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tableModel.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    int colToSelect = tableModel.getColumnCount() - 1;
    8
    paramTable.setRowSelectionInterval(rowToSelect, rowToSelect);
    8
    paramTable.setRowSelectionInterval(rowToSelect, rowToSelect);
    8
    paramTable.setColumnSelectionInterval(colToSelect, colToSelect);
    Differences
    Expression1Expression2Difference
    setRowSelectionIntervalsetColumnSelectionIntervalMETHOD_INVOCATION_NAME_MISMATCH
    rowToSelectcolToSelectVARIABLE_NAME_MISMATCH
    rowToSelectcolToSelectVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression paramTable.setRowSelectionInterval(rowToSelect,rowToSelect) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression paramTable.setColumnSelectionInterval(colToSelect,colToSelect) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression paramTable.setRowSelectionInterval(rowToSelect,rowToSelect) is a void method call, and thus it cannot be parameterized
    Expression paramTable.setColumnSelectionInterval(colToSelect,colToSelect) is a void method call, and thus it cannot be parameterized
    8
    paramTable.setColumnSelectionInterval(colToSelect, colToSelect);
    Precondition Violations (12)
    Row Violation
    1Expression tableModel.addNewRow() is a void method call, and thus it cannot be parameterized
    2Expression tableModel.fireTableDataChanged() is a void method call, and thus it cannot be parameterized
    3Expression tableModel.fireTableDataChanged() is a void method call, and thus it cannot be parameterized
    4Expression tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(),String.class) is a void method call, and thus it cannot be parameterized
    5Expression tableModel.fireTableDataChanged() is a void method call, and thus it cannot be parameterized
    6Expression tableModel.addNewColumn(THREAD_COLUMNS_PREFIX + tableModel.getColumnCount(),String.class) is a void method call, and thus it cannot be parameterized
    7Expression tableModel.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression tableModel.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression paramTable.setRowSelectionInterval(rowToSelect,rowToSelect) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression paramTable.setColumnSelectionInterval(colToSelect,colToSelect) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression paramTable.setRowSelectionInterval(rowToSelect,rowToSelect) is a void method call, and thus it cannot be parameterized
    12Expression paramTable.setColumnSelectionInterval(colToSelect,colToSelect) is a void method call, and thus it cannot be parameterized