Program: 29018
Project: 29018
Buggy source:
public static StateStreamRuntime parseInputStream(StateInputStream stateInputStream,ExecutionPlanContext executionPlanContext,MetaStateEvent metaStateEvent,Map<String,AbstractDefinition> streamDefinitionMap,Map<String,AbstractDefinition> tableDefinitionMap,Map<String,EventTable> eventTableMap,List<VariableExpressionExecutor> variableExpressionExecutors,LatencyTracker latencyTracker){
  Map<String,ProcessStreamReceiver> processStreamReceiverMap=new HashMap<String,ProcessStreamReceiver>();
  StateStreamRuntime stateStreamRuntime=new StateStreamRuntime(executionPlanContext,metaStateEvent);
  String defaultLockKey="String_Node_Str";
  for (  String streamId : stateInputStream.getAllStreamIds()) {
    int streamCount=stateInputStream.getStreamCount(streamId);
    if (streamCount == 1) {
      if (stateInputStream.getStateType() == StateInputStream.Type.SEQUENCE) {
        processStreamReceiverMap.put(streamId,new SequenceSingleProcessStreamReceiver(streamId,stateStreamRuntime,defaultLockKey,latencyTracker));
      }
 else {
        processStreamReceiverMap.put(streamId,new PatternSingleProcessStreamReceiver(streamId,defaultLockKey,latencyTracker));
      }
    }
 else {
      if (stateInputStream.getStateType() == StateInputStream.Type.SEQUENCE) {
        processStreamReceiverMap.put(streamId,new SequenceMultiProcessStreamReceiver(streamId,streamCount,stateStreamRuntime,defaultLockKey,latencyTracker));
      }
 else {
        processStreamReceiverMap.put(streamId,new PatternMultiProcessStreamReceiver(streamId,streamCount,defaultLockKey,latencyTracker));
      }
    }
  }
  StateElement stateElement=stateInputStream.getStateElement();
  InnerStateRuntime innerStateRuntime=parse(stateElement,streamDefinitionMap,tableDefinitionMap,eventTableMap,metaStateEvent,executionPlanContext,variableExpressionExecutors,processStreamReceiverMap,null,null,stateInputStream.getStateType(),new ArrayList<Map.Entry<Long,Set<Integer>>>(),latencyTracker);
  stateStreamRuntime.setInnerStateRuntime(innerStateRuntime);
  ((StreamPreStateProcessor)innerStateRuntime.getFirstProcessor()).setThisLastProcessor((StreamPostStateProcessor)innerStateRuntime.getLastProcessor());
  return stateStreamRuntime;
}

Fixed version (ground truth):
public static StateStreamRuntime parseInputStream(StateInputStream stateInputStream,ExecutionPlanContext executionPlanContext,MetaStateEvent metaStateEvent,Map<String,AbstractDefinition> streamDefinitionMap,Map<String,AbstractDefinition> tableDefinitionMap,Map<String,EventTable> eventTableMap,List<VariableExpressionExecutor> variableExpressionExecutors,LatencyTracker latencyTracker){
  Map<String,ProcessStreamReceiver> processStreamReceiverMap=new HashMap<String,ProcessStreamReceiver>();
  StateStreamRuntime stateStreamRuntime=new StateStreamRuntime(executionPlanContext,metaStateEvent);
  String defaultLockKey="String_Node_Str";
  for (  String streamId : stateInputStream.getAllStreamIds()) {
    int streamCount=stateInputStream.getStreamCount(streamId);
    if (streamCount == 1) {
      if (stateInputStream.getStateType() == StateInputStream.Type.SEQUENCE) {
        processStreamReceiverMap.put(streamId,new SequenceSingleProcessStreamReceiver(streamId,stateStreamRuntime,defaultLockKey,latencyTracker));
      }
 else {
        processStreamReceiverMap.put(streamId,new PatternSingleProcessStreamReceiver(streamId,defaultLockKey,latencyTracker));
      }
    }
 else {
      if (stateInputStream.getStateType() == StateInputStream.Type.SEQUENCE) {
        processStreamReceiverMap.put(streamId,new SequenceMultiProcessStreamReceiver(streamId,streamCount,stateStreamRuntime,latencyTracker));
      }
 else {
        processStreamReceiverMap.put(streamId,new PatternMultiProcessStreamReceiver(streamId,streamCount,latencyTracker));
      }
    }
  }
  StateElement stateElement=stateInputStream.getStateElement();
  InnerStateRuntime innerStateRuntime=parse(stateElement,streamDefinitionMap,tableDefinitionMap,eventTableMap,metaStateEvent,executionPlanContext,variableExpressionExecutors,processStreamReceiverMap,null,null,stateInputStream.getStateType(),new ArrayList<Map.Entry<Long,Set<Integer>>>(),latencyTracker);
  stateStreamRuntime.setInnerStateRuntime(innerStateRuntime);
  ((StreamPreStateProcessor)innerStateRuntime.getFirstProcessor()).setThisLastProcessor((StreamPostStateProcessor)innerStateRuntime.getLastProcessor());
  return stateStreamRuntime;
}