Program: 78025
Project: 78025
Buggy source:
private void switchToList(){
  createLabel(valueArea,LABEL_VALUES,maxStrLengthProperty);
  Composite tableArea=new Composite(valueArea,SWT.NONE);
  tableArea.setLayout(UIUtil.createGridLayoutWithoutMargin());
  tableArea.setLayoutData(new GridData(GridData.FILL_BOTH));
  Table table=new Table(tableArea,SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
  table.setLayoutData(new GridData(GridData.FILL_BOTH));
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  table.addKeyListener(new KeyAdapter(){
    /** 
 * @see org.eclipse.swt.events.KeyAdapter#keyReleased(org.eclipse.swt.events.KeyEvent)
 */
    public void keyReleased(    KeyEvent e){
      if (e.keyCode == SWT.DEL) {
        deleteRow();
      }
    }
  }
);
  String[] columns;
  int[] columnWidth;
  CellEditor[] cellEditors;
  columns=new String[]{null,COLUMN_IS_DEFAULT,COLUMN_VALUE,COLUMN_DISPLAY_TEXT};
  columnWidth=new int[]{20,70,145,145};
  cellEditors=new CellEditor[]{null,null,new TextCellEditor(table),new TextCellEditor(table)};
  for (int i=0; i < columns.length; i++) {
    TableColumn column=new TableColumn(table,SWT.LEFT);
    column.setResizable(columns[i] != null && !COLUMN_IS_DEFAULT.equals(columns[i]));
    if (columns[i] != null) {
      column.setText(columns[i]);
    }
    column.setWidth(columnWidth[i]);
  }
  valueTable=new TableViewer(table);
  valueTable.setCellEditors(cellEditors);
  valueTable.setColumnProperties(columns);
  valueTable.setContentProvider(contentProvider);
  valueTable.setLabelProvider(labelProvider);
  valueTable.setCellModifier(cellModifier);
  valueTable.setInput(choiceList);
  valueTable.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      updateTableButtons();
    }
  }
);
  Composite buttonBar=new Composite(tableArea,SWT.NONE);
  buttonBar.setLayout(UIUtil.createGridLayoutWithoutMargin(4,false));
  buttonBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  importValue=new Button(buttonBar,SWT.PUSH);
  importValue.setText(BUTTON_LABEL_IMPORT);
  setButtonLayoutData(importValue);
  importValue.setEnabled(!inputParameter.getModuleHandle().getVisibleDataSets().isEmpty());
  importValue.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      String type=getSelectedDataType();
      ImportValueDialog dialog=new ImportValueDialog(type);
      if (dialog.open() == OK) {
        String[] importValues=(String[])dialog.getResult();
        for (int i=0; i < importValues.length; i++) {
          if (!containValue(null,importValues[i],COLUMN_VALUE)) {
            SelectionChoice choice=StructureFactory.createSelectionChoice();
            choice.setValue(importValues[i]);
            choiceList.add(choice);
          }
        }
        refreshValueTable();
      }
    }
  }
);
  changeDefault=new Button(buttonBar,SWT.TOGGLE);
  changeDefault.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      SelectionChoice choice=(SelectionChoice)((IStructuredSelection)valueTable.getSelection()).getFirstElement();
      if (isDefaultChoice(choice)) {
        defaultValue=null;
      }
 else {
        defaultValue=choice.getValue();
      }
      refreshValueTable();
      updateMessageLine();
      updateButtons();
    }
  }
);
  delete=new Button(buttonBar,SWT.PUSH);
  delete.setText(BUTTON_LABEL_DELETE);
  setButtonLayoutData(delete);
  delete.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      deleteRow();
    }
  }
);
  createPromptLine(tableArea);
  updateTableButtons();
}

Fixed version (ground truth):
private void switchToList(){
  createLabel(valueArea,LABEL_VALUES);
  Composite tableArea=new Composite(valueArea,SWT.NONE);
  tableArea.setLayout(UIUtil.createGridLayoutWithoutMargin());
  tableArea.setLayoutData(new GridData(GridData.FILL_BOTH));
  Table table=new Table(tableArea,SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
  table.setLayoutData(new GridData(GridData.FILL_BOTH));
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  table.addKeyListener(new KeyAdapter(){
    /** 
 * @see org.eclipse.swt.events.KeyAdapter#keyReleased(org.eclipse.swt.events.KeyEvent)
 */
    public void keyReleased(    KeyEvent e){
      if (e.keyCode == SWT.DEL) {
        deleteRow();
      }
    }
  }
);
  String[] columns;
  int[] columnWidth;
  CellEditor[] cellEditors;
  columns=new String[]{null,COLUMN_IS_DEFAULT,COLUMN_VALUE,COLUMN_DISPLAY_TEXT};
  columnWidth=new int[]{20,70,145,145};
  cellEditors=new CellEditor[]{null,null,new TextCellEditor(table),new TextCellEditor(table)};
  for (int i=0; i < columns.length; i++) {
    TableColumn column=new TableColumn(table,SWT.LEFT);
    column.setResizable(columns[i] != null);
    if (columns[i] != null) {
      column.setText(columns[i]);
    }
    column.setWidth(columnWidth[i]);
  }
  valueTable=new TableViewer(table);
  valueTable.setCellEditors(cellEditors);
  valueTable.setColumnProperties(columns);
  valueTable.setContentProvider(contentProvider);
  valueTable.setLabelProvider(labelProvider);
  valueTable.setCellModifier(cellModifier);
  valueTable.setInput(choiceList);
  valueTable.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      updateTableButtons();
    }
  }
);
  Composite buttonBar=new Composite(tableArea,SWT.NONE);
  buttonBar.setLayout(UIUtil.createGridLayoutWithoutMargin(4,false));
  buttonBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  importValue=new Button(buttonBar,SWT.PUSH);
  importValue.setText(BUTTON_LABEL_IMPORT);
  setButtonLayoutData(importValue);
  importValue.setEnabled(!inputParameter.getModuleHandle().getVisibleDataSets().isEmpty());
  importValue.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      String type=getSelectedDataType();
      ImportValueDialog dialog=new ImportValueDialog(type);
      if (dialog.open() == OK) {
        String[] importValues=(String[])dialog.getResult();
        for (int i=0; i < importValues.length; i++) {
          if (!containValue(null,importValues[i],COLUMN_VALUE)) {
            SelectionChoice choice=StructureFactory.createSelectionChoice();
            choice.setValue(importValues[i]);
            choiceList.add(choice);
          }
        }
        refreshValueTable();
      }
    }
  }
);
  changeDefault=new Button(buttonBar,SWT.TOGGLE);
  changeDefault.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      SelectionChoice choice=(SelectionChoice)((IStructuredSelection)valueTable.getSelection()).getFirstElement();
      if (isDefaultChoice(choice)) {
        defaultValue=null;
      }
 else {
        defaultValue=choice.getValue();
      }
      refreshValueTable();
      updateMessageLine();
      updateButtons();
      changeDefault.getParent().layout();
    }
  }
);
  delete=new Button(buttonBar,SWT.PUSH);
  delete.setText(BUTTON_LABEL_DELETE);
  setButtonLayoutData(delete);
  delete.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      deleteRow();
    }
  }
);
  createPromptLine(tableArea);
  updateTableButtons();
}