Program: 66615
Project: 66615
Buggy source:
public ColumnInfo getColumnInfo(DimColumn dimColumn) throws DataException {
  String dimensionName=dimColumn.getDimensionName();
  String levelName=dimColumn.getLevelName();
  String columnName=dimColumn.getColumnName();
  int dimIndex=getDimensionIndex(dimensionName);
  if (dimIndex < 0) {
    throw new DataException(DataResourceHandle.getInstance().getMessage(ResourceConstants.NONEXISTENT_DIMENSION) + dimensionName);
  }
  IDimensionResultIterator itr=dimensionResultIterators[dimIndex];
  int levelIndex=itr.getLevelIndex(levelName);
  if (levelIndex < 0) {
    throw new DataException(DataResourceHandle.getInstance().getMessage(ResourceConstants.NONEXISTENT_LEVEL) + "String_Node_Str" + dimensionName+ "String_Node_Str"+ levelName+ "String_Node_Str");
  }
  ILevel levelInfo=itr.getDimesion().getHierarchy().getLevels()[levelIndex];
  int columnIndex=-1;
  int dataType=DataType.UNKNOWN_TYPE;
  boolean isKey=false;
  for (int i=0; i < levelInfo.getKeyNames().length; i++) {
    if (levelInfo.getKeyNames()[i].equals(columnName)) {
      columnIndex=i;
      dataType=levelInfo.getKeyDataType(columnName);
      isKey=true;
      break;
    }
  }
  if (!isKey) {
    for (int i=0; i < levelInfo.getAttributeNames().length; i++) {
      if (levelInfo.getAttributeNames()[i].equals(columnName)) {
        columnIndex=i;
        dataType=levelInfo.getAttributeDataType(columnName);
        break;
      }
    }
  }
  if (columnIndex < 0) {
    throw new DataException(DataResourceHandle.getInstance().getMessage(ResourceConstants.NONEXISTENT_KEY_OR_ATTR) + "String_Node_Str" + dimensionName+ "String_Node_Str"+ levelName+ "String_Node_Str"+ columnName+ "String_Node_Str");
  }
  return new ColumnInfo(dimIndex,levelIndex,columnIndex,dataType,isKey);
}

Fixed version (ground truth):
public ColumnInfo getColumnInfo(DimColumn dimColumn) throws DataException {
  String dimensionName=dimColumn.getDimensionName();
  String levelName=dimColumn.getLevelName();
  String columnName=dimColumn.getColumnName();
  int dimIndex=getDimensionIndex(dimensionName);
  if (dimIndex < 0) {
    throw new DataException(DataResourceHandle.getInstance().getMessage(ResourceConstants.NONEXISTENT_DIMENSION) + dimensionName);
  }
  IDimensionResultIterator itr=dimensionResultIterators[dimIndex];
  int levelIndex=itr.getLevelIndex(levelName);
  if (levelIndex < 0) {
    throw new DataException(DataResourceHandle.getInstance().getMessage(ResourceConstants.NONEXISTENT_LEVEL) + "String_Node_Str" + dimensionName+ "String_Node_Str"+ levelName+ "String_Node_Str");
  }
  ILevel levelInfo=itr.getDimesion().getHierarchy().getLevels()[levelIndex];
  int columnIndex=-1;
  int dataType=DataType.UNKNOWN_TYPE;
  boolean isKey=false;
  for (int i=0; i < levelInfo.getKeyNames().length; i++) {
    if (levelInfo.getKeyNames()[i].equals(columnName)) {
      columnIndex=i;
      dataType=levelInfo.getKeyDataType(columnName);
      isKey=true;
      break;
    }
 else     if (levelInfo.getName().equals(columnName)) {
      columnIndex=i;
      dataType=levelInfo.getKeyDataType(levelInfo.getKeyNames()[0]);
      isKey=true;
      break;
    }
  }
  if (!isKey && levelInfo.getAttributeNames() != null) {
    for (int i=0; i < levelInfo.getAttributeNames().length; i++) {
      if (levelInfo.getAttributeNames()[i].equals(columnName)) {
        columnIndex=i;
        dataType=levelInfo.getAttributeDataType(columnName);
        break;
      }
    }
  }
  if (columnIndex < 0) {
    throw new DataException(DataResourceHandle.getInstance().getMessage(ResourceConstants.NONEXISTENT_KEY_OR_ATTR) + "String_Node_Str" + dimensionName+ "String_Node_Str"+ levelName+ "String_Node_Str"+ columnName+ "String_Node_Str");
  }
  return new ColumnInfo(dimIndex,levelIndex,columnIndex,dataType,isKey);
}