Program: 66044
Project: 66044
Buggy source:
@Override public boolean isEnabled(){
  Object selection=getSelection();
  if (selection == null && !(selection instanceof DesignElementHandle)) {
    return false;
  }
  ExtendedItemHandle extendedHandle=CrosstabAdaptUtil.getExtendedItemHandle((DesignElementHandle)selection);
  if (extendedHandle == null) {
    return false;
  }
  measureViewHandle=CrosstabAdaptUtil.getMeasureViewHandle(extendedHandle);
  if (measureViewHandle == null) {
    return false;
  }
  if (DEUtil.isReferenceElement(measureViewHandle.getCrosstabHandle())) {
    return false;
  }
  CrosstabReportItemHandle reportHandle=measureViewHandle.getCrosstab();
  CubeHandle cube=reportHandle.getCube();
  if (cube == null) {
    return false;
  }
  List list=cube.getPropertyHandle(ICubeModel.DIMENSIONS_PROP).getContents();
  for (int i=0; i < list.size(); i++) {
    DimensionHandle dimension=(DimensionHandle)list.get(i);
    if (CrosstabAdaptUtil.isTimeDimension(dimension)) {
      DimensionViewHandle viewHandle=reportHandle.getDimension(dimension.getName());
      if (viewHandle == null) {
        int count=dimension.getDefaultHierarchy().getLevelCount();
        if (count == 0) {
          continue;
        }
        LevelHandle levelHandle=dimension.getDefaultHierarchy().getLevel(0);
        if (DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_YEAR.equals(levelHandle.getDateTimeLevelType())) {
          return true;
        }
      }
 else {
        int count=viewHandle.getLevelCount();
        if (count == 0) {
          continue;
        }
        LevelViewHandle levelViewHandle=viewHandle.getLevel(0);
        if (DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_YEAR.equals(levelViewHandle.getCubeLevel().getDateTimeLevelType())) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  Object selection=getSelection();
  if (selection == null && !(selection instanceof DesignElementHandle)) {
    return false;
  }
  ExtendedItemHandle extendedHandle=CrosstabAdaptUtil.getExtendedItemHandle((DesignElementHandle)selection);
  if (extendedHandle == null) {
    return false;
  }
  measureViewHandle=CrosstabAdaptUtil.getMeasureViewHandle(extendedHandle);
  if (measureViewHandle == null) {
    return false;
  }
  if (DEUtil.isReferenceElement(measureViewHandle.getCrosstabHandle())) {
    return false;
  }
  CrosstabReportItemHandle reportHandle=measureViewHandle.getCrosstab();
  CubeHandle cube=reportHandle.getCube();
  if (cube == null) {
    return false;
  }
  if (cube.getPropertyHandle(ICubeModel.DIMENSIONS_PROP) == null) {
    return false;
  }
  List list=cube.getPropertyHandle(ICubeModel.DIMENSIONS_PROP).getContents();
  for (int i=0; i < list.size(); i++) {
    DimensionHandle dimension=(DimensionHandle)list.get(i);
    if (CrosstabAdaptUtil.isTimeDimension(dimension)) {
      DimensionViewHandle viewHandle=reportHandle.getDimension(dimension.getName());
      if (viewHandle == null) {
        int count=dimension.getDefaultHierarchy().getLevelCount();
        if (count == 0) {
          continue;
        }
        LevelHandle levelHandle=dimension.getDefaultHierarchy().getLevel(0);
        if (DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_YEAR.equals(levelHandle.getDateTimeLevelType())) {
          return true;
        }
      }
 else {
        int count=viewHandle.getLevelCount();
        if (count == 0) {
          continue;
        }
        LevelViewHandle levelViewHandle=viewHandle.getLevel(0);
        if (DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_YEAR.equals(levelViewHandle.getCubeLevel().getDateTimeLevelType())) {
          return true;
        }
      }
    }
  }
  return false;
}