Program: 102114
Project: 102114
Buggy source:
private Composite createParameterTableGroup(Composite parent){
  Composite thePanel=WidgetFactory.createPanel(parent,SWT.NONE,1,1);
  GridLayoutFactory.fillDefaults().margins(10,10).applyTo(thePanel);
  GridDataFactory.fillDefaults().grab(true,true).applyTo(thePanel);
  Composite buttonPanel=WidgetFactory.createPanel(thePanel,SWT.NONE,1,4);
  GridLayoutFactory.fillDefaults().numColumns(4).applyTo(buttonPanel);
  GridDataFactory.fillDefaults().grab(true,false).applyTo(buttonPanel);
  addParameterButton=new Button(buttonPanel,SWT.PUSH);
  addParameterButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.ADD));
  GridDataFactory.fillDefaults().applyTo(addParameterButton);
  addParameterButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      getRelationalReference().createParameter();
      handleInfoChanged();
    }
  }
);
  deleteParameterButton=new Button(buttonPanel,SWT.PUSH);
  deleteParameterButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.DELETE));
  GridDataFactory.fillDefaults().applyTo(deleteParameterButton);
  deleteParameterButton.setEnabled(false);
  deleteParameterButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      RelationalParameter parameter=null;
      IStructuredSelection selection=(IStructuredSelection)parametersViewer.getSelection();
      for (      Object obj : selection.toArray()) {
        if (obj instanceof RelationalParameter) {
          parameter=(RelationalParameter)obj;
          break;
        }
      }
      if (parameter != null) {
        getRelationalReference().removeParameter(parameter);
        deleteParameterButton.setEnabled(false);
        handleInfoChanged();
      }
    }
  }
);
  upParameterButton=new Button(buttonPanel,SWT.PUSH);
  upParameterButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.MOVE_UP));
  GridDataFactory.fillDefaults().applyTo(upParameterButton);
  upParameterButton.setEnabled(false);
  upParameterButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      RelationalParameter info=null;
      IStructuredSelection selection=(IStructuredSelection)parametersViewer.getSelection();
      for (      Object obj : selection.toArray()) {
        if (obj instanceof RelationalParameter) {
          info=(RelationalParameter)obj;
          break;
        }
      }
      if (info != null) {
        int selectedIndex=parametersViewer.getTable().getSelectionIndex();
        getRelationalReference().moveParameterUp(info);
        handleInfoChanged();
        parametersViewer.getTable().select(selectedIndex - 1);
        downParameterButton.setEnabled(getRelationalReference().canMoveParameterDown(info));
        upParameterButton.setEnabled(getRelationalReference().canMoveParameterUp(info));
      }
    }
  }
);
  downParameterButton=new Button(buttonPanel,SWT.PUSH);
  downParameterButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.MOVE_DOWN));
  GridDataFactory.fillDefaults().applyTo(downParameterButton);
  downParameterButton.setEnabled(false);
  downParameterButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      RelationalParameter info=null;
      IStructuredSelection selection=(IStructuredSelection)parametersViewer.getSelection();
      for (      Object obj : selection.toArray()) {
        if (obj instanceof RelationalParameter) {
          info=(RelationalParameter)obj;
          break;
        }
      }
      if (info != null) {
        int selectedIndex=parametersViewer.getTable().getSelectionIndex();
        getRelationalReference().moveParameterDown(info);
        handleInfoChanged();
        parametersViewer.getTable().select(selectedIndex + 1);
        downParameterButton.setEnabled(getRelationalReference().canMoveParameterDown(info));
        upParameterButton.setEnabled(getRelationalReference().canMoveParameterUp(info));
      }
    }
  }
);
  Table columnTable=new Table(thePanel,SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL| SWT.BORDER);
  columnTable.setHeaderVisible(true);
  columnTable.setLinesVisible(true);
  columnTable.setLayout(new TableLayout());
  this.parametersViewer=new TableViewer(columnTable);
  GridDataFactory.fillDefaults().grab(true,false).hint(SWT.DEFAULT,150).applyTo(this.parametersViewer.getControl());
  TableViewerColumn column=new TableViewerColumn(this.parametersViewer,SWT.LEFT);
  column.getColumn().setText(Messages.parameterNameLabel + "String_Node_Str");
  column.setEditingSupport(new ParameterNameEditingSupport(this.parametersViewer));
  column.setLabelProvider(new ParameterDataLabelProvider(0));
  column.getColumn().pack();
  column=new TableViewerColumn(this.parametersViewer,SWT.LEFT);
  column.getColumn().setText(Messages.dataTypeLabel + "String_Node_Str");
  column.setLabelProvider(new ParameterDataLabelProvider(1));
  column.setEditingSupport(new DatatypeEditingSupport(this.parametersViewer));
  column.getColumn().pack();
  column=new TableViewerColumn(this.parametersViewer,SWT.LEFT);
  column.getColumn().setText(Messages.lengthLabel);
  column.setLabelProvider(new ParameterDataLabelProvider(2));
  column.setEditingSupport(new ParameterWidthEditingSupport(this.parametersViewer));
  column.getColumn().pack();
  column=new TableViewerColumn(this.parametersViewer,SWT.LEFT);
  column.getColumn().setText(Messages.directionLabel);
  column.setLabelProvider(new ParameterDataLabelProvider(3));
  column.setEditingSupport(new DirectionEditingSupport(this.parametersViewer));
  column.getColumn().pack();
  if (getRelationalReference() != null) {
    for (    RelationalParameter row : this.getRelationalReference().getParameters()) {
      this.parametersViewer.add(row);
    }
  }
  this.parametersViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      IStructuredSelection sel=(IStructuredSelection)event.getSelection();
      if (sel.isEmpty()) {
        deleteParameterButton.setEnabled(false);
        upParameterButton.setEnabled(false);
        downParameterButton.setEnabled(false);
      }
 else {
        boolean enable=true;
        Object[] objs=sel.toArray();
        RelationalParameter columnInfo=null;
        for (        Object obj : objs) {
          if (!(obj instanceof RelationalParameter)) {
            enable=false;
            break;
          }
 else {
            columnInfo=(RelationalParameter)obj;
          }
        }
        if (objs.length == 0) {
          enable=false;
        }
        deleteParameterButton.setEnabled(enable);
        if (enable) {
          upParameterButton.setEnabled(getRelationalReference().canMoveParameterUp(columnInfo));
          downParameterButton.setEnabled(getRelationalReference().canMoveParameterDown(columnInfo));
        }
      }
    }
  }
);
  return thePanel;
}

Fixed version (ground truth):
private Composite createParameterTableGroup(Composite parent){
  Composite thePanel=WidgetFactory.createPanel(parent,SWT.NONE,1,1);
  GridLayoutFactory.fillDefaults().margins(10,10).applyTo(thePanel);
  GridDataFactory.fillDefaults().grab(true,true).applyTo(thePanel);
  Composite buttonPanel=WidgetFactory.createPanel(thePanel,SWT.NONE,1,4);
  GridLayoutFactory.fillDefaults().numColumns(4).applyTo(buttonPanel);
  GridDataFactory.fillDefaults().grab(true,false).applyTo(buttonPanel);
  addParameterButton=new Button(buttonPanel,SWT.PUSH);
  addParameterButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.ADD));
  GridDataFactory.fillDefaults().applyTo(addParameterButton);
  addParameterButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      getRelationalReference().createParameter();
      handleInfoChanged();
    }
  }
);
  deleteParameterButton=new Button(buttonPanel,SWT.PUSH);
  deleteParameterButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.DELETE));
  GridDataFactory.fillDefaults().applyTo(deleteParameterButton);
  deleteParameterButton.setEnabled(false);
  deleteParameterButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      RelationalParameter parameter=null;
      IStructuredSelection selection=(IStructuredSelection)parametersViewer.getSelection();
      for (      Object obj : selection.toArray()) {
        if (obj instanceof RelationalParameter) {
          parameter=(RelationalParameter)obj;
          break;
        }
      }
      if (parameter != null) {
        getRelationalReference().removeParameter(parameter);
        deleteParameterButton.setEnabled(false);
        handleInfoChanged();
      }
    }
  }
);
  upParameterButton=new Button(buttonPanel,SWT.PUSH);
  upParameterButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.MOVE_UP));
  GridDataFactory.fillDefaults().applyTo(upParameterButton);
  upParameterButton.setEnabled(false);
  upParameterButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      RelationalParameter info=null;
      IStructuredSelection selection=(IStructuredSelection)parametersViewer.getSelection();
      for (      Object obj : selection.toArray()) {
        if (obj instanceof RelationalParameter) {
          info=(RelationalParameter)obj;
          break;
        }
      }
      if (info != null) {
        int selectedIndex=parametersViewer.getTable().getSelectionIndex();
        getRelationalReference().moveParameterUp(info);
        handleInfoChanged();
        parametersViewer.getTable().select(selectedIndex - 1);
        downParameterButton.setEnabled(getRelationalReference().canMoveParameterDown(info));
        upParameterButton.setEnabled(getRelationalReference().canMoveParameterUp(info));
      }
    }
  }
);
  downParameterButton=new Button(buttonPanel,SWT.PUSH);
  downParameterButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.MOVE_DOWN));
  GridDataFactory.fillDefaults().applyTo(downParameterButton);
  downParameterButton.setEnabled(false);
  downParameterButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      RelationalParameter info=null;
      IStructuredSelection selection=(IStructuredSelection)parametersViewer.getSelection();
      for (      Object obj : selection.toArray()) {
        if (obj instanceof RelationalParameter) {
          info=(RelationalParameter)obj;
          break;
        }
      }
      if (info != null) {
        int selectedIndex=parametersViewer.getTable().getSelectionIndex();
        getRelationalReference().moveParameterDown(info);
        handleInfoChanged();
        parametersViewer.getTable().select(selectedIndex + 1);
        downParameterButton.setEnabled(getRelationalReference().canMoveParameterDown(info));
        upParameterButton.setEnabled(getRelationalReference().canMoveParameterUp(info));
      }
    }
  }
);
  Table columnTable=new Table(thePanel,SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL| SWT.BORDER);
  columnTable.setHeaderVisible(true);
  columnTable.setLinesVisible(true);
  columnTable.setLayout(new TableLayout());
  this.parametersViewer=new TableViewer(columnTable);
  GridDataFactory.fillDefaults().grab(true,true).hint(SWT.DEFAULT,150).applyTo(this.parametersViewer.getControl());
  TableViewerColumn column=new TableViewerColumn(this.parametersViewer,SWT.LEFT);
  column.getColumn().setText(Messages.parameterNameLabel + "String_Node_Str");
  column.setEditingSupport(new ParameterNameEditingSupport(this.parametersViewer));
  column.setLabelProvider(new ParameterDataLabelProvider(0));
  column.getColumn().pack();
  column=new TableViewerColumn(this.parametersViewer,SWT.LEFT);
  column.getColumn().setText(Messages.dataTypeLabel + "String_Node_Str");
  column.setLabelProvider(new ParameterDataLabelProvider(1));
  column.setEditingSupport(new DatatypeEditingSupport(this.parametersViewer));
  column.getColumn().pack();
  column=new TableViewerColumn(this.parametersViewer,SWT.LEFT);
  column.getColumn().setText(Messages.lengthLabel);
  column.setLabelProvider(new ParameterDataLabelProvider(2));
  column.setEditingSupport(new ParameterWidthEditingSupport(this.parametersViewer));
  column.getColumn().pack();
  column=new TableViewerColumn(this.parametersViewer,SWT.LEFT);
  column.getColumn().setText(Messages.directionLabel);
  column.setLabelProvider(new ParameterDataLabelProvider(3));
  column.setEditingSupport(new DirectionEditingSupport(this.parametersViewer));
  column.getColumn().pack();
  if (getRelationalReference() != null) {
    for (    RelationalParameter row : this.getRelationalReference().getParameters()) {
      this.parametersViewer.add(row);
    }
  }
  this.parametersViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      IStructuredSelection sel=(IStructuredSelection)event.getSelection();
      if (sel.isEmpty()) {
        deleteParameterButton.setEnabled(false);
        upParameterButton.setEnabled(false);
        downParameterButton.setEnabled(false);
      }
 else {
        boolean enable=true;
        Object[] objs=sel.toArray();
        RelationalParameter columnInfo=null;
        for (        Object obj : objs) {
          if (!(obj instanceof RelationalParameter)) {
            enable=false;
            break;
          }
 else {
            columnInfo=(RelationalParameter)obj;
          }
        }
        if (objs.length == 0) {
          enable=false;
        }
        deleteParameterButton.setEnabled(enable);
        if (enable) {
          upParameterButton.setEnabled(getRelationalReference().canMoveParameterUp(columnInfo));
          downParameterButton.setEnabled(getRelationalReference().canMoveParameterDown(columnInfo));
        }
      }
    }
  }
);
  return thePanel;
}