Program: 78837
Project: 78837
Buggy source:
/** 
 * Returns the created event if the given event is editpart event
 * @param event the selection changed event
 * @return the created event
 */
private List convertEventToGFE(ReportRequest event){
  if (event.getSource() == getGraphicalViewer()) {
    return null;
  }
  ArrayList tempList=new ArrayList();
  List list=event.getSelectionModelList();
  int size=list.size();
  if (size == 1 && list.get(0) instanceof RowHandle) {
    RowHandle handle=(RowHandle)list.get(0);
    if (handle.getRoot() == null) {
      return null;
    }
    RowHandleAdapter adapter=HandleAdapterFactory.getInstance().getRowHandleAdapter(handle);
    TableEditPart part=(TableEditPart)getGraphicalViewer().getEditPartRegistry().get(adapter.getTableParent());
    if (part != null) {
      part.selectRow(new int[]{adapter.getRowNumber()});
    }
    return null;
  }
  for (int i=0; i < size; i++) {
    Object obj=list.get(i);
    if (obj instanceof EditPart) {
      tempList.add(obj);
    }
 else {
      Object part=null;
      if (obj instanceof ReportElementModel) {
        obj=(((ReportElementModel)obj).getSlotHandle());
        part=getGraphicalViewer().getEditPartRegistry().get(new ListBandProxy((SlotHandle)obj));
      }
 else {
        part=getGraphicalViewer().getEditPartRegistry().get(obj);
      }
      if (part instanceof EditPart) {
        tempList.add(part);
      }
    }
  }
  if (tempList.isEmpty()) {
    return null;
  }
  return tempList;
}

Fixed version (ground truth):
/** 
 * Returns the created event if the given event is editpart event
 * @param event the selection changed event
 * @return the created event
 */
private List convertEventToGFE(ReportRequest event){
  if (event.getSource() == getGraphicalViewer()) {
    return null;
  }
  ArrayList tempList=new ArrayList();
  List list=event.getSelectionModelList();
  int size=list.size();
  if (size != 0 && list.get(0) instanceof RowHandle) {
    RowHandle handle=(RowHandle)list.get(0);
    RowHandleAdapter adapter=HandleAdapterFactory.getInstance().getRowHandleAdapter(handle);
    Object tableParent=adapter.getTableParent();
    TableEditPart part=(TableEditPart)getGraphicalViewer().getEditPartRegistry().get(tableParent);
    int[] selectRows=new int[]{adapter.getRowNumber()};
    for (int i=1; i < size; i++) {
      Object o=list.get(i);
      if (o instanceof RowHandle) {
        handle=(RowHandle)o;
        adapter=HandleAdapterFactory.getInstance().getRowHandleAdapter(handle);
        if (tableParent != adapter.getTableParent()) {
          return null;
        }
        int len=selectRows.length;
        int temp[]=new int[len + 1];
        System.arraycopy(selectRows,0,temp,0,len);
        temp[len]=adapter.getRowNumber();
        selectRows=temp;
      }
 else {
        return null;
      }
    }
    if (handle.getRoot() == null) {
      return null;
    }
    if (part != null) {
      Arrays.sort(selectRows);
      int len=selectRows.length;
      if (len > 1) {
        for (int i=0; i < len - 1; i++) {
          if (selectRows[i + 1] - selectRows[i] != 1) {
            return null;
          }
        }
      }
      part.selectRow(selectRows);
    }
    return null;
  }
  for (int i=0; i < size; i++) {
    Object obj=list.get(i);
    if (obj instanceof EditPart) {
      tempList.add(obj);
    }
 else {
      Object part=null;
      if (obj instanceof ReportElementModel) {
        obj=(((ReportElementModel)obj).getSlotHandle());
        part=getGraphicalViewer().getEditPartRegistry().get(new ListBandProxy((SlotHandle)obj));
      }
 else {
        part=getGraphicalViewer().getEditPartRegistry().get(obj);
      }
      if (part instanceof EditPart) {
        tempList.add(part);
      }
    }
  }
  if (tempList.isEmpty()) {
    return null;
  }
  return tempList;
}