Program: 25283
Project: 25283
Buggy source:
private void doColLifeValidation(CubeQueryContext cubeql) throws SemanticException {
  Set<String> cubeColumns=cubeql.getColumnsQueried(cubeql.getCube().getName());
  if (cubeColumns == null || cubeColumns.isEmpty()) {
    return;
  }
  for (  String col : cubeql.getColumnsQueried(cubeql.getCube().getName())) {
    CubeColumn column=cubeql.getCube().getColumnByName(col);
    for (    TimeRange range : cubeql.getTimeRanges()) {
      if (column == null) {
        if (!cubeql.getCube().getTimedDimensions().contains(col)) {
          throw new SemanticException(ErrorMsg.NOT_A_CUBE_COLUMN);
        }
        continue;
      }
      if (isColumnLifeInvalid(column,range)) {
        throw new SemanticException(ErrorMsg.NOT_AVAILABLE_IN_RANGE,col,range.toString(),(column.getStartTime() == null ? "String_Node_Str" : "String_Node_Str" + column.getStartTime()),(column.getEndTime() == null ? "String_Node_Str" : "String_Node_Str" + column.getEndTime()));
      }
    }
  }
  Map<String,Set<ReferencedQueriedColumn>> refCols=cubeql.getDenormCtx().getReferencedCols();
  for (  String col : refCols.keySet()) {
    Iterator<ReferencedQueriedColumn> refColIter=refCols.get(col).iterator();
    while (refColIter.hasNext()) {
      ReferencedQueriedColumn refCol=refColIter.next();
      for (      TimeRange range : cubeql.getTimeRanges()) {
        if (isColumnLifeInvalid(refCol.col,range)) {
          LOG.debug("String_Node_Str" + refCol.col.getName() + "String_Node_Str");
          refColIter.remove();
          break;
        }
      }
    }
  }
  JoinResolver.AutoJoinContext joinContext=cubeql.getAutoJoinCtx();
  if (joinContext == null) {
    return;
  }
  Set<String> joinColumns=joinContext.getAllJoinPathColumnsOfTable((AbstractCubeTable)cubeql.getCube());
  if (joinColumns == null || joinColumns.isEmpty()) {
    return;
  }
  for (  String col : joinColumns) {
    CubeColumn column=cubeql.getCube().getColumnByName(col);
    for (    TimeRange range : cubeql.getTimeRanges()) {
      if (isColumnLifeInvalid(column,range)) {
        LOG.info("String_Node_Str" + column + "String_Node_Str");
        Map<Aliased<Dimension>,List<SchemaGraph.JoinPath>> allPaths=joinContext.getAllPaths();
        for (        Aliased<Dimension> dimension : allPaths.keySet()) {
          List<SchemaGraph.JoinPath> joinPaths=allPaths.get(dimension);
          Iterator<SchemaGraph.JoinPath> joinPathIterator=joinPaths.iterator();
          while (joinPathIterator.hasNext()) {
            SchemaGraph.JoinPath path=joinPathIterator.next();
            if (path.containsColumnOfTable(col,(AbstractCubeTable)cubeql.getCube())) {
              LOG.info("String_Node_Str" + path + "String_Node_Str"+ col+ "String_Node_Str");
              joinPathIterator.remove();
              if (joinPaths.isEmpty()) {
                throw new SemanticException(ErrorMsg.NO_JOIN_PATH,"String_Node_Str" + dimension + "String_Node_Str"+ range.getFromDate()+ "String_Node_Str"+ range.getToDate());
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void doColLifeValidation(CubeQueryContext cubeql) throws SemanticException {
  Set<String> cubeColumns=cubeql.getColumnsQueried(cubeql.getCube().getName());
  if (cubeColumns == null || cubeColumns.isEmpty()) {
    return;
  }
  for (  String col : cubeql.getColumnsQueried(cubeql.getCube().getName())) {
    CubeColumn column=cubeql.getCube().getColumnByName(col);
    for (    TimeRange range : cubeql.getTimeRanges()) {
      if (column == null) {
        if (!cubeql.getCube().getTimedDimensions().contains(col)) {
          throw new SemanticException(ErrorMsg.NOT_A_CUBE_COLUMN,col);
        }
        continue;
      }
      if (isColumnLifeInvalid(column,range)) {
        throw new SemanticException(ErrorMsg.NOT_AVAILABLE_IN_RANGE,col,range.toString(),(column.getStartTime() == null ? "String_Node_Str" : "String_Node_Str" + column.getStartTime()),(column.getEndTime() == null ? "String_Node_Str" : "String_Node_Str" + column.getEndTime()));
      }
    }
  }
  Map<String,Set<ReferencedQueriedColumn>> refCols=cubeql.getDenormCtx().getReferencedCols();
  for (  String col : refCols.keySet()) {
    Iterator<ReferencedQueriedColumn> refColIter=refCols.get(col).iterator();
    while (refColIter.hasNext()) {
      ReferencedQueriedColumn refCol=refColIter.next();
      for (      TimeRange range : cubeql.getTimeRanges()) {
        if (isColumnLifeInvalid(refCol.col,range)) {
          LOG.debug("String_Node_Str" + refCol.col.getName() + "String_Node_Str");
          refColIter.remove();
          break;
        }
      }
    }
  }
  JoinResolver.AutoJoinContext joinContext=cubeql.getAutoJoinCtx();
  if (joinContext == null) {
    return;
  }
  Set<String> joinColumns=joinContext.getAllJoinPathColumnsOfTable((AbstractCubeTable)cubeql.getCube());
  if (joinColumns == null || joinColumns.isEmpty()) {
    return;
  }
  for (  String col : joinColumns) {
    CubeColumn column=cubeql.getCube().getColumnByName(col);
    for (    TimeRange range : cubeql.getTimeRanges()) {
      if (isColumnLifeInvalid(column,range)) {
        LOG.info("String_Node_Str" + column + "String_Node_Str");
        Map<Aliased<Dimension>,List<SchemaGraph.JoinPath>> allPaths=joinContext.getAllPaths();
        for (        Aliased<Dimension> dimension : allPaths.keySet()) {
          List<SchemaGraph.JoinPath> joinPaths=allPaths.get(dimension);
          Iterator<SchemaGraph.JoinPath> joinPathIterator=joinPaths.iterator();
          while (joinPathIterator.hasNext()) {
            SchemaGraph.JoinPath path=joinPathIterator.next();
            if (path.containsColumnOfTable(col,(AbstractCubeTable)cubeql.getCube())) {
              LOG.info("String_Node_Str" + path + "String_Node_Str"+ col+ "String_Node_Str");
              joinPathIterator.remove();
              if (joinPaths.isEmpty()) {
                throw new SemanticException(ErrorMsg.NO_JOIN_PATH,"String_Node_Str" + dimension + "String_Node_Str"+ range.getFromDate()+ "String_Node_Str"+ range.getToDate());
              }
            }
          }
        }
      }
    }
  }
}