Program: 28988
Project: 28988
Buggy source:
/** 
 * Parse single InputStream and return SingleStreamRuntime
 * @param latencyTracker              latency tracker
 * @param inputStream                 single input stream to be parsed
 * @param executionPlanContext        query to be parsed
 * @param variableExpressionExecutors List to hold VariableExpressionExecutors to update after query parsing
 * @param streamDefinitionMap         Stream Definition Map
 * @param tableDefinitionMap          Table Definition Map
 * @param eventTableMap               EventTable Map
 * @param metaComplexEvent            MetaComplexEvent
 * @param processStreamReceiver       ProcessStreamReceiver
 * @param outputExpectsExpiredEvents
 * @return SingleStreamRuntime
 */
public static SingleStreamRuntime parseInputStream(SingleInputStream inputStream,ExecutionPlanContext executionPlanContext,List<VariableExpressionExecutor> variableExpressionExecutors,Map<String,AbstractDefinition> streamDefinitionMap,Map<String,AbstractDefinition> tableDefinitionMap,Map<String,EventTable> eventTableMap,MetaComplexEvent metaComplexEvent,ProcessStreamReceiver processStreamReceiver,boolean supportsBatchProcessing,boolean outputExpectsExpiredEvents){
  Processor processor=null;
  EntryValveProcessor entryValveProcessor=null;
  boolean first=true;
  MetaStreamEvent metaStreamEvent;
  if (metaComplexEvent instanceof MetaStateEvent) {
    metaStreamEvent=new MetaStreamEvent();
    ((MetaStateEvent)metaComplexEvent).addEvent(metaStreamEvent);
    initMetaStreamEvent(inputStream,streamDefinitionMap,tableDefinitionMap,metaStreamEvent);
  }
 else {
    metaStreamEvent=(MetaStreamEvent)metaComplexEvent;
    initMetaStreamEvent(inputStream,streamDefinitionMap,tableDefinitionMap,metaStreamEvent);
  }
  if (!inputStream.getStreamHandlers().isEmpty()) {
    for (    StreamHandler handler : inputStream.getStreamHandlers()) {
      Processor currentProcessor=generateProcessor(handler,metaComplexEvent,variableExpressionExecutors,executionPlanContext,eventTableMap,supportsBatchProcessing,outputExpectsExpiredEvents);
      if (currentProcessor instanceof SchedulingProcessor) {
        if (entryValveProcessor == null) {
          entryValveProcessor=new EntryValveProcessor(executionPlanContext);
          if (first) {
            processor=entryValveProcessor;
            first=false;
          }
 else {
            processor.setToLast(entryValveProcessor);
          }
        }
        Scheduler scheduler=new Scheduler(executionPlanContext.getScheduledExecutorService(),entryValveProcessor,executionPlanContext);
        ((SchedulingProcessor)currentProcessor).setScheduler(scheduler);
      }
      if (first) {
        processor=currentProcessor;
        first=false;
      }
 else {
        processor.setToLast(currentProcessor);
      }
    }
  }
  metaStreamEvent.initializeAfterWindowData();
  return new SingleStreamRuntime(processStreamReceiver,processor,metaComplexEvent);
}

Fixed version (ground truth):
/** 
 * Parse single InputStream and return SingleStreamRuntime
 * @param inputStream                 single input stream to be parsed
 * @param executionPlanContext        query to be parsed
 * @param variableExpressionExecutors List to hold VariableExpressionExecutors to update after query parsing
 * @param streamDefinitionMap         Stream Definition Map
 * @param tableDefinitionMap          Table Definition Map
 * @param eventTableMap               EventTable Map
 * @param metaComplexEvent            MetaComplexEvent
 * @param processStreamReceiver       ProcessStreamReceiver
 * @param supportsBatchProcessing     supports batch processing
 * @param outputExpectsExpiredEvents  is output expects ExpiredEvents
 * @return SingleStreamRuntime
 */
public static SingleStreamRuntime parseInputStream(SingleInputStream inputStream,ExecutionPlanContext executionPlanContext,List<VariableExpressionExecutor> variableExpressionExecutors,Map<String,AbstractDefinition> streamDefinitionMap,Map<String,AbstractDefinition> tableDefinitionMap,Map<String,EventTable> eventTableMap,MetaComplexEvent metaComplexEvent,ProcessStreamReceiver processStreamReceiver,boolean supportsBatchProcessing,boolean outputExpectsExpiredEvents){
  Processor processor=null;
  EntryValveProcessor entryValveProcessor=null;
  boolean first=true;
  MetaStreamEvent metaStreamEvent;
  if (metaComplexEvent instanceof MetaStateEvent) {
    metaStreamEvent=new MetaStreamEvent();
    ((MetaStateEvent)metaComplexEvent).addEvent(metaStreamEvent);
    initMetaStreamEvent(inputStream,streamDefinitionMap,tableDefinitionMap,metaStreamEvent);
  }
 else {
    metaStreamEvent=(MetaStreamEvent)metaComplexEvent;
    initMetaStreamEvent(inputStream,streamDefinitionMap,tableDefinitionMap,metaStreamEvent);
  }
  if (!inputStream.getStreamHandlers().isEmpty()) {
    for (    StreamHandler handler : inputStream.getStreamHandlers()) {
      Processor currentProcessor=generateProcessor(handler,metaComplexEvent,variableExpressionExecutors,executionPlanContext,eventTableMap,supportsBatchProcessing,outputExpectsExpiredEvents);
      if (currentProcessor instanceof SchedulingProcessor) {
        if (entryValveProcessor == null) {
          entryValveProcessor=new EntryValveProcessor(executionPlanContext);
          if (first) {
            processor=entryValveProcessor;
            first=false;
          }
 else {
            processor.setToLast(entryValveProcessor);
          }
        }
        Scheduler scheduler=new Scheduler(executionPlanContext.getScheduledExecutorService(),entryValveProcessor,executionPlanContext);
        ((SchedulingProcessor)currentProcessor).setScheduler(scheduler);
      }
      if (first) {
        processor=currentProcessor;
        first=false;
      }
 else {
        processor.setToLast(currentProcessor);
      }
    }
  }
  metaStreamEvent.initializeAfterWindowData();
  return new SingleStreamRuntime(processStreamReceiver,processor,metaComplexEvent);
}