Program: 29077
Project: 29077
Buggy source:
/** 
 * Parse Selector portion of a query and return corresponding QuerySelector
 * @param selector             selector to be parsed
 * @param outputStream         output stream
 * @param executionPlanContext query to be parsed
 * @param metaComplexEvent     Meta event used to collect execution info of stream associated with query
 * @param eventTableMap        EventTable Map
 * @return QuerySelector
 */
public static QuerySelector parse(Selector selector,OutputStream outputStream,ExecutionPlanContext executionPlanContext,MetaComplexEvent metaComplexEvent,Map<String,EventTable> eventTableMap,List<VariableExpressionExecutor> variableExpressionExecutors){
  boolean currentOn=false;
  boolean expiredOn=false;
  String id=null;
  if (outputStream.getOutputEventType() == OutputStream.OutputEventType.CURRENT_EVENTS || outputStream.getOutputEventType() == OutputStream.OutputEventType.ALL_EVENTS) {
    currentOn=true;
  }
  if (outputStream.getOutputEventType() == OutputStream.OutputEventType.EXPIRED_EVENTS || outputStream.getOutputEventType() == OutputStream.OutputEventType.ALL_EVENTS) {
    expiredOn=true;
  }
  id=outputStream.getId();
  QuerySelector querySelector=new QuerySelector(id,selector,currentOn,expiredOn,executionPlanContext);
  List<AttributeProcessor> attributeProcessors=getAttributeProcessors(selector,id,executionPlanContext,metaComplexEvent,eventTableMap,variableExpressionExecutors);
  querySelector.setAttributeProcessorList(attributeProcessors,"String_Node_Str".equals(containsAggregatorThreadLocal.get()));
  containsAggregatorThreadLocal.remove();
  ConditionExpressionExecutor havingCondition=generateHavingExecutor(selector.getHavingExpression(),metaComplexEvent,executionPlanContext,eventTableMap,variableExpressionExecutors);
  querySelector.setHavingConditionExecutor(havingCondition);
  if (!selector.getGroupByList().isEmpty()) {
    querySelector.setGroupByKeyGenerator(new GroupByKeyGenerator(selector.getGroupByList(),metaComplexEvent,null,variableExpressionExecutors,executionPlanContext));
  }
  return querySelector;
}

Fixed version (ground truth):
/** 
 * Parse Selector portion of a query and return corresponding QuerySelector
 * @param selector                    selector to be parsed
 * @param outputStream                output stream
 * @param executionPlanContext        query to be parsed
 * @param metaComplexEvent            Meta event used to collect execution info of stream associated with query
 * @param eventTableMap               EventTable Map
 * @param variableExpressionExecutors variable expression executors
 * @return QuerySelector
 */
public static QuerySelector parse(Selector selector,OutputStream outputStream,ExecutionPlanContext executionPlanContext,MetaComplexEvent metaComplexEvent,Map<String,EventTable> eventTableMap,List<VariableExpressionExecutor> variableExpressionExecutors){
  boolean currentOn=false;
  boolean expiredOn=false;
  String id=null;
  if (outputStream.getOutputEventType() == OutputStream.OutputEventType.CURRENT_EVENTS || outputStream.getOutputEventType() == OutputStream.OutputEventType.ALL_EVENTS) {
    currentOn=true;
  }
  if (outputStream.getOutputEventType() == OutputStream.OutputEventType.EXPIRED_EVENTS || outputStream.getOutputEventType() == OutputStream.OutputEventType.ALL_EVENTS) {
    expiredOn=true;
  }
  id=outputStream.getId();
  QuerySelector querySelector=new QuerySelector(id,selector,currentOn,expiredOn,executionPlanContext);
  List<AttributeProcessor> attributeProcessors=getAttributeProcessors(selector,id,executionPlanContext,metaComplexEvent,eventTableMap,variableExpressionExecutors);
  querySelector.setAttributeProcessorList(attributeProcessors,"String_Node_Str".equals(containsAggregatorThreadLocal.get()));
  containsAggregatorThreadLocal.remove();
  ConditionExpressionExecutor havingCondition=generateHavingExecutor(selector.getHavingExpression(),metaComplexEvent,executionPlanContext,eventTableMap,variableExpressionExecutors);
  querySelector.setHavingConditionExecutor(havingCondition);
  if (!selector.getGroupByList().isEmpty()) {
    querySelector.setGroupByKeyGenerator(new GroupByKeyGenerator(selector.getGroupByList(),metaComplexEvent,null,variableExpressionExecutors,executionPlanContext));
  }
  return querySelector;
}