Program: 75672
Project: 75672
Buggy source:
public EditPart createEditPart(EditPart context,Object model){
  if (context instanceof CrosstabCellEditPart) {
    if (model instanceof DataItemHandle) {
      CrosstabCellAdapter adapter=((CrosstabCellEditPart)context).getCrosstabCellAdapter();
      String position=adapter.getPositionType();
      if ((ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE.equals(position) || ICrosstabCellAdapterFactory.CELL_MEASURE.equals(position)) && adapter.getFirstDataItem() == model) {
        return new LevelHandleDataItemEditPart(model);
      }
 else       if (ICrosstabCellAdapterFactory.CELL_LEVEL_HANDLE.equals(position)) {
        return new LevelHandleDataItemEditPart(model);
      }
 else       if (ICrosstabCellAdapterFactory.CELL_MEASURE_HEADER.equals(position)) {
        return new MeasureHandleDataItemEditPart(model);
      }
    }
  }
  if (model instanceof VirtualCrosstabCellAdapter) {
    return new VirtualCellEditPart(model);
  }
  if (model instanceof CrosstabCellAdapter) {
    if (ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE.equals(((CrosstabCellAdapter)model).getPositionType()) || ICrosstabCellAdapterFactory.CELL_MEASURE.equals(((CrosstabCellAdapter)model).getPositionType())) {
      CrosstabFirstCellEditPart first=new CrosstabFirstCellEditPart(model);
      first.setManager(createMenuManager(((CrosstabCellAdapter)model).getPositionType(),context.getViewer()));
      return first;
    }
    return new CrosstabCellEditPart(model);
  }
  return null;
}

Fixed version (ground truth):
public EditPart createEditPart(EditPart context,Object model){
  if (context instanceof CrosstabCellEditPart) {
    if (model instanceof DataItemHandle) {
      CrosstabCellAdapter adapter=((CrosstabCellEditPart)context).getCrosstabCellAdapter();
      String position=adapter.getPositionType();
      if ((ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE.equals(position) || ICrosstabCellAdapterFactory.CELL_MEASURE.equals(position)) && adapter.getFirstDataItem() == model) {
        return new LevelHandleDataItemEditPart(model);
      }
 else       if (ICrosstabCellAdapterFactory.CELL_LEVEL_HANDLE.equals(position)) {
        return new LevelHandleDataItemEditPart(model);
      }
 else       if (ICrosstabCellAdapterFactory.CELL_MEASURE_HEADER.equals(position)) {
        return new MeasureHandleDataItemEditPart(model);
      }
 else       if (ICrosstabCellAdapterFactory.CELL_MEASURE_AGGREGATION.equals(position)) {
        return new MeasureAggregationEditPart(model);
      }
    }
  }
  if (model instanceof VirtualCrosstabCellAdapter) {
    return new VirtualCellEditPart(model);
  }
  if (model instanceof CrosstabCellAdapter) {
    if (ICrosstabCellAdapterFactory.CELL_FIRST_LEVEL_HANDLE.equals(((CrosstabCellAdapter)model).getPositionType()) || ICrosstabCellAdapterFactory.CELL_MEASURE.equals(((CrosstabCellAdapter)model).getPositionType())) {
      CrosstabFirstCellEditPart first=new CrosstabFirstCellEditPart(model);
      first.setManager(createMenuManager(((CrosstabCellAdapter)model).getPositionType(),context.getViewer()));
      return first;
    }
    return new CrosstabCellEditPart(model);
  }
  return null;
}