Program: 67595
Project: 67595
Buggy source:
private static void addEdgeDefinition(ICubeQueryDefinition cubeQuery,CrosstabReportItemHandle crosstabItem,int axis,List<String> levelNameList,List<LevelViewHandle> levelViewList,Map<LevelHandle,ILevelDefinition> levelMapping,IModelAdapter modelAdapter) throws BirtException {
  IEdgeDefinition edge=cubeQuery.createEdge(axis == COLUMN_AXIS_TYPE ? ICubeQueryDefinition.COLUMN_EDGE : ICubeQueryDefinition.ROW_EDGE);
  LevelHandle mirrorLevel=crosstabItem.getCrosstabView(axis).getMirroredStartingLevel();
  for (int i=0; i < crosstabItem.getDimensionCount(axis); i++) {
    DimensionViewHandle dv=crosstabItem.getDimension(axis,i);
    if (dv.getCubeDimension() == null) {
      if (axis == COLUMN_AXIS_TYPE) {
        throw new CrosstabException(Messages.getString("String_Node_Str",dv.getCubeDimensionName()));
      }
 else {
        throw new CrosstabException(Messages.getString("String_Node_Str",dv.getCubeDimensionName()));
      }
    }
    IDimensionDefinition dimDef=edge.createDimension(dv.getCubeDimension().getName());
    IHierarchyDefinition hieDef=dimDef.createHierarchy(dv.getCubeDimension().getDefaultHierarchy().getName());
    for (int j=0; j < dv.getLevelCount(); j++) {
      LevelViewHandle lv=dv.getLevel(j);
      if (lv.getCubeLevel() == null) {
        if (axis == COLUMN_AXIS_TYPE) {
          throw new CrosstabException(Messages.getString("String_Node_Str",lv.getCubeLevelName()));
        }
 else {
          throw new CrosstabException(Messages.getString("String_Node_Str",lv.getCubeLevelName()));
        }
      }
      ILevelDefinition levelDef=hieDef.createLevel(lv.getCubeLevel().getName());
      levelNameList.add(lv.getCubeLevel().getFullName());
      if (mirrorLevel != null && mirrorLevel.getQualifiedName().equals(lv.getCubeLevelName())) {
        edge.setMirrorStartingLevel(levelDef);
      }
      levelViewList.add(lv);
      levelMapping.put(lv.getCubeLevel(),levelDef);
    }
  }
  CrosstabViewHandle view=crosstabItem.getCrosstabView(axis);
  if (view != null) {
    List members=view.getMembers();
    if (members != null && members.size() > 0) {
      for (int i=0; i < members.size(); i++) {
        MemberValueHandle mvh=(MemberValueHandle)members.get(i);
        if (mvh != null && mvh.getLevel() != null) {
          addDrillDefinition(edge,mvh,levelMapping);
        }
      }
      addEdgeMemberFilter(cubeQuery,modelAdapter,members,levelMapping);
    }
  }
}

Fixed version (ground truth):
private static void addEdgeDefinition(ICubeQueryDefinition cubeQuery,CrosstabReportItemHandle crosstabItem,int axis,List<String> levelNameList,List<LevelViewHandle> levelViewList,Map<LevelHandle,ILevelDefinition> levelMapping,IModelAdapter modelAdapter) throws BirtException {
  IEdgeDefinition edge=cubeQuery.createEdge(axis == COLUMN_AXIS_TYPE ? ICubeQueryDefinition.COLUMN_EDGE : ICubeQueryDefinition.ROW_EDGE);
  LevelHandle mirrorLevel=crosstabItem.getCrosstabView(axis).getMirroredStartingLevel();
  for (int i=0; i < crosstabItem.getDimensionCount(axis); i++) {
    DimensionViewHandle dv=crosstabItem.getDimension(axis,i);
    if (dv.getCubeDimension() == null) {
      if (axis == COLUMN_AXIS_TYPE) {
        throw new CrosstabException(Messages.getString("String_Node_Str",dv.getCubeDimensionName()));
      }
 else {
        throw new CrosstabException(Messages.getString("String_Node_Str",dv.getCubeDimensionName()));
      }
    }
    IDimensionDefinition dimDef=edge.createDimension(dv.getCubeDimension().getName());
    IHierarchyDefinition hieDef=dimDef.createHierarchy(dv.getCubeDimension().getDefaultHierarchy().getName());
    for (int j=0; j < dv.getLevelCount(); j++) {
      LevelViewHandle lv=dv.getLevel(j);
      if (lv.getCubeLevel() == null) {
        if (axis == COLUMN_AXIS_TYPE) {
          throw new CrosstabException(Messages.getString("String_Node_Str",lv.getCubeLevelName()));
        }
 else {
          throw new CrosstabException(Messages.getString("String_Node_Str",lv.getCubeLevelName()));
        }
      }
      ILevelDefinition levelDef=hieDef.createLevel(lv.getCubeLevel().getName());
      levelNameList.add(lv.getCubeLevel().getFullName());
      if (mirrorLevel != null && mirrorLevel.getFullName().equals(lv.getCubeLevelName())) {
        edge.setMirrorStartingLevel(levelDef);
      }
      levelViewList.add(lv);
      levelMapping.put(lv.getCubeLevel(),levelDef);
    }
  }
  CrosstabViewHandle view=crosstabItem.getCrosstabView(axis);
  if (view != null) {
    List members=view.getMembers();
    if (members != null && members.size() > 0) {
      for (int i=0; i < members.size(); i++) {
        MemberValueHandle mvh=(MemberValueHandle)members.get(i);
        if (mvh != null && mvh.getLevel() != null) {
          addDrillDefinition(edge,mvh,levelMapping);
        }
      }
      addEdgeMemberFilter(cubeQuery,modelAdapter,members,levelMapping);
    }
  }
}