Program: 66864
Project: 66864
Buggy source:
public static List<ComputedColumn> generateComputedColumns(ExtendedItemHandle itemHandle,CubeHandle cubeHandle){
  if (cubeHandle != null) {
    List<ComputedColumn> columnList=new ArrayList<ComputedColumn>();
    String exprType=UIUtil.getDefaultScriptType();
    IExpressionConverter exprConverter=ExpressionUtility.getExpressionConverter(exprType);
    for (    LevelHandle levelHandle : ChartCubeUtil.getAllLevels(cubeHandle)) {
      ComputedColumn column=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createLevelBindingName(levelHandle));
      column.setDataType(levelHandle.getDataType());
      column.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getDimensionExpression(levelHandle.getContainer().getContainer().getName(),levelHandle.getName(),null),exprType));
      columnList.add(column);
      Iterator itLevelAttr=levelHandle.attributesIterator();
      while (itLevelAttr.hasNext()) {
        LevelAttributeHandle laHandle=(LevelAttributeHandle)itLevelAttr.next();
        ComputedColumn columnLA=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createLevelAttrBindingName(levelHandle,laHandle));
        columnLA.setDataType(laHandle.getDataType());
        columnLA.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getDimensionExpression(levelHandle.getContainer().getContainer().getName(),levelHandle.getName(),laHandle.getName()),exprType));
        columnList.add(columnLA);
      }
    }
    for (    MeasureHandle measureHandle : ChartCubeUtil.getAllMeasures(cubeHandle)) {
      ComputedColumn column=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createMeasureBindingName(measureHandle));
      column.setDataType(measureHandle.getDataType());
      column.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getMeasureExpression(measureHandle.getName()),exprType));
      column.setAggregateFunction(measureHandle.getFunction());
      columnList.add(column);
    }
    return columnList;
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
public static List<ComputedColumn> generateComputedColumns(ExtendedItemHandle itemHandle,CubeHandle cubeHandle){
  if (cubeHandle != null) {
    List<ComputedColumn> columnList=new ArrayList<ComputedColumn>();
    String exprType=UIUtil.getDefaultScriptType();
    IExpressionConverter exprConverter=ExpressionUtility.getExpressionConverter(exprType);
    for (    LevelHandle levelHandle : ChartCubeUtil.getAllLevels(cubeHandle)) {
      String displayNameAttr=null;
      if (levelHandle instanceof TabularLevelHandle && ((TabularLevelHandle)levelHandle).getDisplayColumnName() != null && ((TabularLevelHandle)levelHandle).getDisplayColumnName().trim().length() > 0) {
        displayNameAttr=ICubeQueryUtil.DISPLAY_NAME_ATTR;
      }
      ComputedColumn column=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createLevelBindingName(levelHandle));
      column.setDataType(levelHandle.getDataType());
      column.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getDimensionExpression(levelHandle.getContainer().getContainer().getName(),levelHandle.getName(),displayNameAttr),exprType));
      columnList.add(column);
      Iterator itLevelAttr=levelHandle.attributesIterator();
      while (itLevelAttr.hasNext()) {
        LevelAttributeHandle laHandle=(LevelAttributeHandle)itLevelAttr.next();
        ComputedColumn columnLA=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createLevelAttrBindingName(levelHandle,laHandle));
        columnLA.setDataType(laHandle.getDataType());
        columnLA.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getDimensionExpression(levelHandle.getContainer().getContainer().getName(),levelHandle.getName(),laHandle.getName()),exprType));
        columnList.add(columnLA);
      }
    }
    for (    MeasureHandle measureHandle : ChartCubeUtil.getAllMeasures(cubeHandle)) {
      ComputedColumn column=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createMeasureBindingName(measureHandle));
      column.setDataType(measureHandle.getDataType());
      column.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getMeasureExpression(measureHandle.getName()),exprType));
      column.setAggregateFunction(measureHandle.getFunction());
      columnList.add(column);
    }
    return columnList;
  }
  return Collections.emptyList();
}