Program: 72785
Project: 72785
Buggy source:
public IDataQueryDefinition[] createReportQueries(IDataQueryDefinition parent) throws BirtException {
  if (crosstabItem == null) {
    throw new CrosstabException(Messages.getString("String_Node_Str"));
  }
  IDataQueryDefinition cubeQuery=CrosstabQueryUtil.createCubeQuery(crosstabItem,parent,true,true,true,true,true,true);
  String emptyValue=crosstabItem.getEmptyCellValue();
  if (context != null) {
    processChildQuery(cubeQuery,crosstabItem.getHeader(),emptyValue);
    for (int i=0; i < crosstabItem.getMeasureCount(); i++) {
      MeasureViewHandle mv=crosstabItem.getMeasure(i);
      processChildQuery(cubeQuery,mv.getCell(),emptyValue);
      processChildQuery(cubeQuery,mv.getHeader(),emptyValue);
      for (int j=0; j < mv.getAggregationCount(); j++) {
        processChildQuery(cubeQuery,mv.getAggregationCell(j),emptyValue);
      }
    }
    if (crosstabItem.getDimensionCount(ROW_AXIS_TYPE) > 0) {
      for (int i=0; i < crosstabItem.getDimensionCount(ROW_AXIS_TYPE); i++) {
        DimensionViewHandle dv=crosstabItem.getDimension(ROW_AXIS_TYPE,i);
        for (int j=0; j < dv.getLevelCount(); j++) {
          LevelViewHandle lv=dv.getLevel(j);
          processChildQuery(cubeQuery,lv.getCell(),emptyValue);
          processChildQuery(cubeQuery,lv.getAggregationHeader(),emptyValue);
        }
      }
    }
    if (crosstabItem.getDimensionCount(COLUMN_AXIS_TYPE) > 0) {
      for (int i=0; i < crosstabItem.getDimensionCount(COLUMN_AXIS_TYPE); i++) {
        DimensionViewHandle dv=crosstabItem.getDimension(COLUMN_AXIS_TYPE,i);
        for (int j=0; j < dv.getLevelCount(); j++) {
          LevelViewHandle lv=dv.getLevel(j);
          processChildQuery(cubeQuery,lv.getCell(),emptyValue);
          processChildQuery(cubeQuery,lv.getAggregationHeader(),emptyValue);
        }
      }
    }
    processChildQuery(cubeQuery,crosstabItem.getGrandTotal(ROW_AXIS_TYPE),emptyValue);
    processChildQuery(cubeQuery,crosstabItem.getGrandTotal(COLUMN_AXIS_TYPE),emptyValue);
  }
  return new IDataQueryDefinition[]{cubeQuery};
}

Fixed version (ground truth):
public IDataQueryDefinition[] createReportQueries(IDataQueryDefinition parent) throws BirtException {
  if (crosstabItem == null) {
    throw new CrosstabException(Messages.getString("String_Node_Str"));
  }
  IDataQueryDefinition cubeQuery=CrosstabQueryUtil.createCubeQuery(crosstabItem,parent,true,true,true,true,true,true);
  if (context != null) {
    processChildQuery(cubeQuery,crosstabItem.getHeader());
    for (int i=0; i < crosstabItem.getMeasureCount(); i++) {
      MeasureViewHandle mv=crosstabItem.getMeasure(i);
      processChildQuery(cubeQuery,mv.getCell());
      processChildQuery(cubeQuery,mv.getHeader());
      for (int j=0; j < mv.getAggregationCount(); j++) {
        processChildQuery(cubeQuery,mv.getAggregationCell(j));
      }
    }
    if (crosstabItem.getDimensionCount(ROW_AXIS_TYPE) > 0) {
      for (int i=0; i < crosstabItem.getDimensionCount(ROW_AXIS_TYPE); i++) {
        DimensionViewHandle dv=crosstabItem.getDimension(ROW_AXIS_TYPE,i);
        for (int j=0; j < dv.getLevelCount(); j++) {
          LevelViewHandle lv=dv.getLevel(j);
          processChildQuery(cubeQuery,lv.getCell());
          processChildQuery(cubeQuery,lv.getAggregationHeader());
        }
      }
    }
    if (crosstabItem.getDimensionCount(COLUMN_AXIS_TYPE) > 0) {
      for (int i=0; i < crosstabItem.getDimensionCount(COLUMN_AXIS_TYPE); i++) {
        DimensionViewHandle dv=crosstabItem.getDimension(COLUMN_AXIS_TYPE,i);
        for (int j=0; j < dv.getLevelCount(); j++) {
          LevelViewHandle lv=dv.getLevel(j);
          processChildQuery(cubeQuery,lv.getCell());
          processChildQuery(cubeQuery,lv.getAggregationHeader());
        }
      }
    }
    processChildQuery(cubeQuery,crosstabItem.getGrandTotal(ROW_AXIS_TYPE));
    processChildQuery(cubeQuery,crosstabItem.getGrandTotal(COLUMN_AXIS_TYPE));
  }
  return new IDataQueryDefinition[]{cubeQuery};
}