Program: 28740
Project: 28740
Buggy source:
/** 
 * Parse an InputStream returning corresponding StreamRuntime
 * @param inputStream                input stream to be parsed
 * @param siddhiAppContext           associated siddhi siddhiAppContext
 * @param streamDefinitionMap        map containing user given stream definitions
 * @param tableDefinitionMap         table definition map
 * @param windowDefinitionMap        window definition map
 * @param tableMap                   Table Map
 * @param windowMap                  event window map
 * @param aggregationMap             aggregator map
 * @param executors                  List to hold VariableExpressionExecutors to update after query parsing
 * @param latencyTracker             latency tracker
 * @param outputExpectsExpiredEvents is output expects ExpiredEvents
 * @param queryName                  query name of input stream belongs to.
 * @return StreamRuntime
 */
public static StreamRuntime parse(InputStream inputStream,SiddhiAppContext siddhiAppContext,Map<String,AbstractDefinition> streamDefinitionMap,Map<String,AbstractDefinition> tableDefinitionMap,Map<String,AbstractDefinition> windowDefinitionMap,Map<String,AbstractDefinition> aggregationDefinitionMap,Map<String,Table> tableMap,Map<String,Window> windowMap,Map<String,AggregationRuntime> aggregationMap,List<VariableExpressionExecutor> executors,LatencyTracker latencyTracker,boolean outputExpectsExpiredEvents,String queryName){
  if (inputStream instanceof BasicSingleInputStream || inputStream instanceof SingleInputStream) {
    SingleInputStream singleInputStream=(SingleInputStream)inputStream;
    Window window=windowMap.get(singleInputStream.getStreamId());
    boolean batchProcessingAllowed=window != null;
    ProcessStreamReceiver processStreamReceiver=new ProcessStreamReceiver(singleInputStream.getStreamId(),latencyTracker,queryName,siddhiAppContext);
    processStreamReceiver.setBatchProcessingAllowed(batchProcessingAllowed);
    return SingleInputStreamParser.parseInputStream((SingleInputStream)inputStream,siddhiAppContext,executors,streamDefinitionMap,null,windowDefinitionMap,aggregationDefinitionMap,tableMap,new MetaStreamEvent(),processStreamReceiver,true,outputExpectsExpiredEvents,queryName);
  }
 else   if (inputStream instanceof JoinInputStream) {
    return JoinInputStreamParser.parseInputStream(((JoinInputStream)inputStream),siddhiAppContext,streamDefinitionMap,tableDefinitionMap,windowDefinitionMap,aggregationDefinitionMap,tableMap,windowMap,aggregationMap,executors,latencyTracker,outputExpectsExpiredEvents,queryName);
  }
 else   if (inputStream instanceof StateInputStream) {
    MetaStateEvent metaStateEvent=new MetaStateEvent(inputStream.getAllStreamIds().size());
    return StateInputStreamParser.parseInputStream(((StateInputStream)inputStream),siddhiAppContext,metaStateEvent,streamDefinitionMap,null,null,aggregationDefinitionMap,tableMap,executors,latencyTracker,queryName);
  }
 else {
    throw new OperationNotSupportedException();
  }
}

Fixed version (ground truth):
/** 
 * Parse an InputStream returning corresponding StreamRuntime
 * @param inputStream                input stream to be parsed
 * @param siddhiAppContext           associated siddhi siddhiAppContext
 * @param streamDefinitionMap        map containing user given stream definitions
 * @param tableDefinitionMap         table definition map
 * @param windowDefinitionMap        window definition map
 * @param aggregationDefinitionMap   aggregation definition map
 * @param tableMap                   Table Map
 * @param windowMap                  event window map
 * @param aggregationMap             aggregator map
 * @param executors                  List to hold VariableExpressionExecutors to update after query parsing
 * @param latencyTracker             latency tracker
 * @param outputExpectsExpiredEvents is output expects ExpiredEvents
 * @param queryName                  query name of input stream belongs to.
 * @return StreamRuntime
 */
public static StreamRuntime parse(InputStream inputStream,SiddhiAppContext siddhiAppContext,Map<String,AbstractDefinition> streamDefinitionMap,Map<String,AbstractDefinition> tableDefinitionMap,Map<String,AbstractDefinition> windowDefinitionMap,Map<String,AbstractDefinition> aggregationDefinitionMap,Map<String,Table> tableMap,Map<String,Window> windowMap,Map<String,AggregationRuntime> aggregationMap,List<VariableExpressionExecutor> executors,LatencyTracker latencyTracker,boolean outputExpectsExpiredEvents,String queryName){
  if (inputStream instanceof BasicSingleInputStream || inputStream instanceof SingleInputStream) {
    SingleInputStream singleInputStream=(SingleInputStream)inputStream;
    Window window=windowMap.get(singleInputStream.getStreamId());
    boolean batchProcessingAllowed=window != null;
    ProcessStreamReceiver processStreamReceiver=new ProcessStreamReceiver(singleInputStream.getStreamId(),latencyTracker,queryName,siddhiAppContext);
    processStreamReceiver.setBatchProcessingAllowed(batchProcessingAllowed);
    return SingleInputStreamParser.parseInputStream((SingleInputStream)inputStream,siddhiAppContext,executors,streamDefinitionMap,null,windowDefinitionMap,aggregationDefinitionMap,tableMap,new MetaStreamEvent(),processStreamReceiver,true,outputExpectsExpiredEvents,queryName);
  }
 else   if (inputStream instanceof JoinInputStream) {
    return JoinInputStreamParser.parseInputStream(((JoinInputStream)inputStream),siddhiAppContext,streamDefinitionMap,tableDefinitionMap,windowDefinitionMap,aggregationDefinitionMap,tableMap,windowMap,aggregationMap,executors,latencyTracker,outputExpectsExpiredEvents,queryName);
  }
 else   if (inputStream instanceof StateInputStream) {
    MetaStateEvent metaStateEvent=new MetaStateEvent(inputStream.getAllStreamIds().size());
    return StateInputStreamParser.parseInputStream(((StateInputStream)inputStream),siddhiAppContext,metaStateEvent,streamDefinitionMap,null,null,aggregationDefinitionMap,tableMap,executors,latencyTracker,queryName);
  }
 else {
    throw new OperationNotSupportedException();
  }
}