Program: 28963
Project: 28963
Buggy source:
private static void initSingleStreamRuntime(SingleStreamRuntime singleStreamRuntime,int streamEventChainIndex,MetaComplexEvent metaComplexEvent,StateEventPool stateEventPool,LockWrapper lockWrapper){
  MetaStreamEvent metaStreamEvent;
  if (metaComplexEvent instanceof MetaStateEvent) {
    metaStreamEvent=((MetaStateEvent)metaComplexEvent).getMetaStreamEvent(streamEventChainIndex);
  }
 else {
    metaStreamEvent=(MetaStreamEvent)metaComplexEvent;
  }
  StreamEventPool streamEventPool=new StreamEventPool(metaStreamEvent,5);
  ProcessStreamReceiver processStreamReceiver=singleStreamRuntime.getProcessStreamReceiver();
  processStreamReceiver.setMetaStreamEvent(metaStreamEvent);
  processStreamReceiver.setStreamEventPool(streamEventPool);
  processStreamReceiver.setLockWrapper(lockWrapper);
  processStreamReceiver.init();
  Processor processor=singleStreamRuntime.getProcessorChain();
  while (processor != null) {
    if (processor instanceof SchedulingProcessor) {
      ((SchedulingProcessor)processor).getScheduler().setStreamEventPool(streamEventPool);
      ((SchedulingProcessor)processor).getScheduler().init(lockWrapper);
    }
    if (processor instanceof AbstractStreamProcessor) {
      ((AbstractStreamProcessor)processor).setStreamEventCloner(new StreamEventCloner(metaStreamEvent,streamEventPool));
      ((AbstractStreamProcessor)processor).constructStreamEventPopulater(metaStreamEvent,streamEventChainIndex);
    }
    if (stateEventPool != null && processor instanceof JoinProcessor) {
      ((JoinProcessor)processor).setStateEventPool(stateEventPool);
    }
    if (stateEventPool != null && processor instanceof StreamPreStateProcessor) {
      ((StreamPreStateProcessor)processor).setStateEventPool(stateEventPool);
      ((StreamPreStateProcessor)processor).setStreamEventPool(streamEventPool);
      ((StreamPreStateProcessor)processor).setStreamEventCloner(new StreamEventCloner(metaStreamEvent,streamEventPool));
      if (metaComplexEvent instanceof MetaStateEvent) {
        ((StreamPreStateProcessor)processor).setStateEventCloner(new StateEventCloner(((MetaStateEvent)metaComplexEvent),stateEventPool));
      }
    }
    processor=processor.getNextProcessor();
  }
}

Fixed version (ground truth):
private static void initSingleStreamRuntime(SingleStreamRuntime singleStreamRuntime,int streamEventChainIndex,MetaComplexEvent metaComplexEvent,StateEventPool stateEventPool,LockWrapper lockWrapper){
  MetaStreamEvent metaStreamEvent;
  if (metaComplexEvent instanceof MetaStateEvent) {
    metaStreamEvent=((MetaStateEvent)metaComplexEvent).getMetaStreamEvent(streamEventChainIndex);
  }
 else {
    metaStreamEvent=(MetaStreamEvent)metaComplexEvent;
  }
  StreamEventPool streamEventPool=new StreamEventPool(metaStreamEvent,5);
  ProcessStreamReceiver processStreamReceiver=singleStreamRuntime.getProcessStreamReceiver();
  processStreamReceiver.setMetaStreamEvent(metaStreamEvent);
  processStreamReceiver.setStreamEventPool(streamEventPool);
  processStreamReceiver.setLockWrapper(lockWrapper);
  processStreamReceiver.init();
  Processor processor=singleStreamRuntime.getProcessorChain();
  while (processor != null) {
    if (processor instanceof SchedulingProcessor) {
      ((SchedulingProcessor)processor).getScheduler().setStreamEventPool(streamEventPool);
      ((SchedulingProcessor)processor).getScheduler().init(lockWrapper);
    }
    if (processor instanceof AbstractStreamProcessor) {
      ((AbstractStreamProcessor)processor).setStreamEventCloner(new StreamEventCloner(metaStreamEvent,streamEventPool));
      ((AbstractStreamProcessor)processor).constructStreamEventPopulater(metaStreamEvent,streamEventChainIndex);
    }
    if (stateEventPool != null && processor instanceof JoinProcessor) {
      ((JoinProcessor)processor).setStateEventPool(stateEventPool);
      ((JoinProcessor)processor).setJoinLock(lockWrapper);
    }
    if (stateEventPool != null && processor instanceof StreamPreStateProcessor) {
      ((StreamPreStateProcessor)processor).setStateEventPool(stateEventPool);
      ((StreamPreStateProcessor)processor).setStreamEventPool(streamEventPool);
      ((StreamPreStateProcessor)processor).setStreamEventCloner(new StreamEventCloner(metaStreamEvent,streamEventPool));
      if (metaComplexEvent instanceof MetaStateEvent) {
        ((StreamPreStateProcessor)processor).setStateEventCloner(new StateEventCloner(((MetaStateEvent)metaComplexEvent),stateEventPool));
      }
    }
    processor=processor.getNextProcessor();
  }
}