Program: 65649
Project: 65649
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;
  }
  if (extendedHandle.getExtensionName().equals("String_Node_Str")) {
    try {
      reportHandle=(CrosstabReportItemHandle)extendedHandle.getReportItem();
    }
 catch (    ExtendedElementException e) {
      return false;
    }
  }
 else {
    measureViewHandle=CrosstabAdaptUtil.getMeasureViewHandle(extendedHandle);
    if (measureViewHandle == null) {
      return false;
    }
    reportHandle=measureViewHandle.getCrosstab();
  }
  if (DEUtil.isReferenceElement(reportHandle.getCrosstabHandle())) {
    return false;
  }
  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;
}

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;
  }
  if (extendedHandle.getExtensionName().equals("String_Node_Str")) {
    try {
      reportHandle=(CrosstabReportItemHandle)extendedHandle.getReportItem();
    }
 catch (    ExtendedElementException e) {
      return false;
    }
  }
 else {
    measureViewHandle=CrosstabAdaptUtil.getMeasureViewHandle(extendedHandle);
    if (measureViewHandle == null) {
      return false;
    }
    reportHandle=measureViewHandle.getCrosstab();
  }
  if (DEUtil.isReferenceElement(reportHandle.getCrosstabHandle())) {
    return false;
  }
  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;
}