Program: 75264
Project: 75264
Buggy source:
public static void resetViewSelection(final EditPartViewer viewer,final boolean notofyToMedia){
  final List list=new ArrayList(((StructuredSelection)viewer.getSelection()).toList());
  boolean hasColumnOrRow=false;
  for (int i=0; i < list.size(); i++) {
    if (list.get(i) instanceof TableEditPart.DummyRowEditPart || list.get(i) instanceof TableEditPart.DummyColumnEditPart) {
      hasColumnOrRow=true;
      break;
    }
  }
  if (hasColumnOrRow) {
    int selectionType=0;
    TableEditPart part=null;
    int[] selectContents=new int[0];
    for (int i=0; i < list.size(); i++) {
      Object obj=list.get(i);
      int number=-1;
      if (obj instanceof TableEditPart.DummyRowEditPart) {
        selectionType=0;
        number=((TableEditPart.DummyRowEditPart)obj).getRowNumber();
      }
 else       if (obj instanceof TableEditPart.DummyColumnEditPart) {
        selectionType=1;
        number=((TableEditPart.DummyColumnEditPart)obj).getColumnNumber();
      }
 else       if (obj instanceof TableCellEditPart) {
        part=(TableEditPart)((TableCellEditPart)obj).getParent();
      }
      if (number != -1) {
        int lenegth=selectContents.length;
        int[] temp=new int[lenegth + 1];
        System.arraycopy(selectContents,0,temp,0,lenegth);
        temp[lenegth]=number;
        selectContents=temp;
      }
    }
    if (part == null || selectContents.length == 0 || !viewer.getControl().isVisible()) {
      return;
    }
    if (selectionType == 0) {
      part.selectRow(selectContents,notofyToMedia);
    }
 else     if (selectionType == 1) {
      part.selectColumn(selectContents,notofyToMedia);
    }
  }
 else {
    if (viewer.getControl().isVisible()) {
      if (viewer instanceof DeferredGraphicalViewer)       ((DeferredGraphicalViewer)viewer).setSelection(new StructuredSelection(list),notofyToMedia);
    }
  }
}

Fixed version (ground truth):
public static void resetViewSelection(final EditPartViewer viewer,final boolean notofyToMedia){
  final List list=new ArrayList(((StructuredSelection)viewer.getSelection()).toList());
  boolean hasColumnOrRow=false;
  for (int i=0; i < list.size(); i++) {
    if (list.get(i) instanceof TableEditPart.DummyRowEditPart || list.get(i) instanceof TableEditPart.DummyColumnEditPart) {
      hasColumnOrRow=true;
      break;
    }
  }
  if (hasColumnOrRow) {
    int selectionType=0;
    TableEditPart part=null;
    int[] selectContents=new int[0];
    for (int i=0; i < list.size(); i++) {
      Object obj=list.get(i);
      int number=-1;
      if (obj instanceof TableEditPart.DummyRowEditPart) {
        selectionType=0;
        number=((TableEditPart.DummyRowEditPart)obj).getRowNumber();
      }
 else       if (obj instanceof TableEditPart.DummyColumnEditPart) {
        selectionType=1;
        number=((TableEditPart.DummyColumnEditPart)obj).getColumnNumber();
      }
 else       if (obj instanceof TableCellEditPart) {
        part=(TableEditPart)((TableCellEditPart)obj).getParent();
      }
      if (number != -1) {
        int lenegth=selectContents.length;
        int[] temp=new int[lenegth + 1];
        System.arraycopy(selectContents,0,temp,0,lenegth);
        temp[lenegth]=number;
        selectContents=temp;
      }
    }
    if (part == null || selectContents.length == 0 || !viewer.getControl().isVisible()) {
      return;
    }
    if (selectionType == 0) {
      part.selectRow(selectContents,notofyToMedia);
    }
 else     if (selectionType == 1) {
      part.selectColumn(selectContents,notofyToMedia);
    }
  }
 else {
    if (!viewer.getControl().isDisposed()) {
      if (viewer instanceof DeferredGraphicalViewer)       ((DeferredGraphicalViewer)viewer).setSelection(new StructuredSelection(list),notofyToMedia);
    }
  }
}