nus-yam/ex-repair huggingface dataset:
Program: 28947
Project: 28947
Buggy source:
/** 
 * Create and start disruptor based on annotations given in the streamDefinition.
 */
public synchronized void startProcessing(){
  if (!receivers.isEmpty() && async) {
    for (    Constructor constructor : Disruptor.class.getConstructors()) {
      if (constructor.getParameterTypes().length == 5) {
        ProducerType producerType=ProducerType.SINGLE;
        if (publishers.size() > 1) {
          producerType=ProducerType.MULTI;
        }
        disruptor=new Disruptor<Event>(new EventFactory(streamDefinition.getAttributeList().size()),bufferSize,executorService,producerType,new BlockingWaitStrategy());
        disruptor.handleExceptionsWith(executionPlanContext.getDisruptorExceptionHandler());
        break;
      }
    }
    if (disruptor == null) {
      disruptor=new Disruptor<Event>(new EventFactory(streamDefinition.getAttributeList().size()),bufferSize,executorService);
      disruptor.handleExceptionsWith(executionPlanContext.getDisruptorExceptionHandler());
    }
    for (    Receiver receiver : receivers) {
      disruptor.handleEventsWith(new StreamHandler(receiver));
    }
    ringBuffer=disruptor.start();
  }
 else {
    for (    Receiver receiver : receivers) {
      if (receiver instanceof StreamCallback) {
        ((StreamCallback)receiver).startProcessing();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Create and start disruptor based on annotations given in the streamDefinition.
 */
public synchronized void startProcessing(){
  if (!receivers.isEmpty() && async) {
    for (    Constructor constructor : Disruptor.class.getConstructors()) {
      if (constructor.getParameterTypes().length == 5) {
        ProducerType producerType=ProducerType.MULTI;
        disruptor=new Disruptor<Event>(new EventFactory(streamDefinition.getAttributeList().size()),bufferSize,executorService,producerType,new BlockingWaitStrategy());
        disruptor.handleExceptionsWith(executionPlanContext.getDisruptorExceptionHandler());
        break;
      }
    }
    if (disruptor == null) {
      disruptor=new Disruptor<Event>(new EventFactory(streamDefinition.getAttributeList().size()),bufferSize,executorService);
      disruptor.handleExceptionsWith(executionPlanContext.getDisruptorExceptionHandler());
    }
    for (    Receiver receiver : receivers) {
      disruptor.handleEventsWith(new StreamHandler(receiver));
    }
    ringBuffer=disruptor.start();
  }
 else {
    for (    Receiver receiver : receivers) {
      if (receiver instanceof StreamCallback) {
        ((StreamCallback)receiver).startProcessing();
      }
    }
  }
}
Program: 28948
Project: 28948
Buggy source:
/** 
 * Helper method to clean/refactor MetaStreamEvent
 * @param metaStreamEvent MetaStreamEvent
 */
private static synchronized void reduceStreamAttributes(MetaStreamEvent metaStreamEvent){
  Set<Attribute> duplicateFinder=new HashSet<Attribute>();
  for (Iterator<Attribute> iterator=metaStreamEvent.getOutputData().iterator(); iterator.hasNext(); ) {
    Attribute attribute=iterator.next();
    if (attribute != null) {
      if (duplicateFinder.add(attribute)) {
        if (metaStreamEvent.getBeforeWindowData().contains(attribute)) {
          metaStreamEvent.getBeforeWindowData().remove(attribute);
        }
        if (metaStreamEvent.getOnAfterWindowData().contains(attribute)) {
          metaStreamEvent.getOnAfterWindowData().remove(attribute);
        }
      }
 else {
        iterator.remove();
      }
    }
  }
  duplicateFinder=new HashSet<Attribute>();
  for (Iterator<Attribute> iterator=metaStreamEvent.getOnAfterWindowData().iterator(); iterator.hasNext(); ) {
    Attribute attribute=iterator.next();
    if (attribute != null) {
      if (duplicateFinder.add(attribute)) {
        if (metaStreamEvent.getBeforeWindowData().contains(attribute)) {
          metaStreamEvent.getBeforeWindowData().remove(attribute);
        }
      }
 else {
        iterator.remove();
      }
    }
  }
  for (Iterator<Attribute> iterator=metaStreamEvent.getBeforeWindowData().iterator(); iterator.hasNext(); ) {
    Attribute attribute=iterator.next();
    if (attribute != null) {
      if (!duplicateFinder.add(attribute)) {
        iterator.remove();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper method to clean/refactor MetaStreamEvent
 * @param metaStreamEvent MetaStreamEvent
 */
private static synchronized void reduceStreamAttributes(MetaStreamEvent metaStreamEvent){
  for (  Attribute attribute : metaStreamEvent.getOutputData()) {
    if (metaStreamEvent.getBeforeWindowData().contains(attribute)) {
      metaStreamEvent.getBeforeWindowData().remove(attribute);
    }
    if (metaStreamEvent.getOnAfterWindowData().contains(attribute)) {
      metaStreamEvent.getOnAfterWindowData().remove(attribute);
    }
  }
  Set<Attribute> duplicateFinder=new HashSet<Attribute>();
  for (Iterator<Attribute> iterator=metaStreamEvent.getOnAfterWindowData().iterator(); iterator.hasNext(); ) {
    Attribute attribute=iterator.next();
    if (attribute != null) {
      if (duplicateFinder.add(attribute)) {
        if (metaStreamEvent.getBeforeWindowData().contains(attribute)) {
          metaStreamEvent.getBeforeWindowData().remove(attribute);
        }
      }
 else {
        iterator.remove();
      }
    }
  }
  for (Iterator<Attribute> iterator=metaStreamEvent.getBeforeWindowData().iterator(); iterator.hasNext(); ) {
    Attribute attribute=iterator.next();
    if (attribute != null) {
      if (!duplicateFinder.add(attribute)) {
        iterator.remove();
      }
    }
  }
}
Program: 28949
Project: 28949
Buggy source:
@Override public void receive(long timeStamp,Event[] inEvents,Event[] removeEvents){
  EventPrinter.print(timeStamp,inEvents,removeEvents);
  count=count + inEvents.length;
  eventArrived=true;
}

Fixed version (ground truth):
@Override public void receive(long timeStamp,Event[] inEvents,Event[] removeEvents){
  EventPrinter.print(timeStamp,inEvents,removeEvents);
  Assert.assertTrue("String_Node_Str".equals(inEvents[0].getData(2)));
  count=count + inEvents.length;
  eventArrived=true;
}
Program: 28951
Project: 28951
Buggy source:
/** 
 * Clone a copy of processor
 * @param key partition key
 * @return Cloned Processor
 */
@Override public Processor cloneProcessor(String key){
  JoinProcessor joinProcessor=new JoinProcessor(leftJoinProcessor,outerJoinProcessor,matchingStreamIndex);
  joinProcessor.setTrigger(trigger);
  if (trigger) {
    joinProcessor.setFinder(finder.cloneFinder(key));
  }
  return joinProcessor;
}

Fixed version (ground truth):
/** 
 * Clone a copy of processor
 * @param key partition key
 * @return Cloned Processor
 */
@Override public Processor cloneProcessor(String key){
  JoinProcessor joinProcessor=new JoinProcessor(leftJoinProcessor,preJoinProcessor,outerJoinProcessor,matchingStreamIndex);
  joinProcessor.setTrigger(trigger);
  if (trigger) {
    joinProcessor.setFinder(finder.cloneFinder(key));
  }
  return joinProcessor;
}
Program: 28952
Project: 28952
Buggy source:
public JoinProcessor(boolean leftJoinProcessor,boolean outerJoinProcessor,int matchingStreamIndex){
  this.leftJoinProcessor=leftJoinProcessor;
  this.outerJoinProcessor=outerJoinProcessor;
  this.matchingStreamIndex=matchingStreamIndex;
}

Fixed version (ground truth):
public JoinProcessor(boolean leftJoinProcessor,boolean preJoinProcessor,boolean outerJoinProcessor,int matchingStreamIndex){
  this.leftJoinProcessor=leftJoinProcessor;
  this.preJoinProcessor=preJoinProcessor;
  this.outerJoinProcessor=outerJoinProcessor;
  this.matchingStreamIndex=matchingStreamIndex;
}
Program: 28957
Project: 28957
Buggy source:
public void setJoinLock(Lock joinLock){
  this.joinLock=joinLock;
}

Fixed version (ground truth):
public void setJoinLock(LockWrapper joinLockWrapper){
  this.joinLockWrapper=joinLockWrapper;
}
Program: 28958
Project: 28958
Buggy source:
/** 
 * Clone a copy of processor
 * @param key partition key
 * @return Cloned Processor
 */
@Override public Processor cloneProcessor(String key){
  JoinProcessor joinProcessor=new JoinProcessor(leftJoinProcessor,preJoinProcessor,outerJoinProcessor,matchingStreamIndex);
  joinProcessor.setTrigger(trigger);
  if (trigger) {
    joinProcessor.setFinder(finder.cloneFinder(key));
  }
  return joinProcessor;
}

Fixed version (ground truth):
/** 
 * Clone a copy of processor
 * @param key partition key
 * @return Cloned Processor
 */
@Override public Processor cloneProcessor(String key){
  JoinProcessor joinProcessor=new JoinProcessor(leftJoinProcessor,outerJoinProcessor,matchingStreamIndex);
  joinProcessor.setTrigger(trigger);
  if (trigger) {
    joinProcessor.setFinder(finder.cloneFinder(key));
  }
  return joinProcessor;
}
Program: 28959
Project: 28959
Buggy source:
public JoinProcessor(boolean leftJoinProcessor,boolean preJoinProcessor,boolean outerJoinProcessor,int matchingStreamIndex){
  this.leftJoinProcessor=leftJoinProcessor;
  this.preJoinProcessor=preJoinProcessor;
  this.outerJoinProcessor=outerJoinProcessor;
  this.matchingStreamIndex=matchingStreamIndex;
}

Fixed version (ground truth):
public JoinProcessor(boolean leftJoinProcessor,boolean outerJoinProcessor,int matchingStreamIndex){
  this.leftJoinProcessor=leftJoinProcessor;
  this.outerJoinProcessor=outerJoinProcessor;
  this.matchingStreamIndex=matchingStreamIndex;
}
Program: 28965
Project: 28965
Buggy source:
/** 
 * Clone a copy of processor
 * @param key partition key
 * @return Cloned Processor
 */
@Override public Processor cloneProcessor(String key){
  JoinProcessor joinProcessor=new JoinProcessor(leftJoinProcessor,outerJoinProcessor,matchingStreamIndex);
  joinProcessor.setTrigger(trigger);
  if (trigger) {
    joinProcessor.setFinder(finder.cloneFinder(key));
  }
  return joinProcessor;
}

Fixed version (ground truth):
/** 
 * Clone a copy of processor
 * @param key partition key
 * @return Cloned Processor
 */
@Override public Processor cloneProcessor(String key){
  JoinProcessor joinProcessor=new JoinProcessor(leftJoinProcessor,preJoinProcessor,outerJoinProcessor,matchingStreamIndex);
  joinProcessor.setTrigger(trigger);
  if (trigger) {
    joinProcessor.setFinder(finder.cloneFinder(key));
  }
  return joinProcessor;
}
Program: 28966
Project: 28966
Buggy source:
public JoinProcessor(boolean leftJoinProcessor,boolean outerJoinProcessor,int matchingStreamIndex){
  this.leftJoinProcessor=leftJoinProcessor;
  this.outerJoinProcessor=outerJoinProcessor;
  this.matchingStreamIndex=matchingStreamIndex;
}

Fixed version (ground truth):
public JoinProcessor(boolean leftJoinProcessor,boolean preJoinProcessor,boolean outerJoinProcessor,int matchingStreamIndex){
  this.leftJoinProcessor=leftJoinProcessor;
  this.preJoinProcessor=preJoinProcessor;
  this.outerJoinProcessor=outerJoinProcessor;
  this.matchingStreamIndex=matchingStreamIndex;
}
Program: 28970
Project: 28970
Buggy source:
public void process(ComplexEventChunk complexEventChunk){
  complexEventChunk.reset();
  while (complexEventChunk.hasNext()) {
    ComplexEvent event=complexEventChunk.next();
    if (((event.getType() != StreamEvent.Type.CURRENT || !allowCurrentEvents) && (event.getType() != StreamEvent.Type.EXPIRED || !allowExpiredEvents))) {
      complexEventChunk.remove();
    }
  }
  complexEventChunk.reset();
  if (complexEventChunk.hasNext()) {
    outputPublisher.send(complexEventChunk.getFirst());
  }
}

Fixed version (ground truth):
public void process(ComplexEventChunk complexEventChunk){
  complexEventChunk.reset();
  while (complexEventChunk.hasNext()) {
    ComplexEvent event=complexEventChunk.next();
    if (((event.getType() != StreamEvent.Type.CURRENT || !allowCurrentEvents) && (event.getType() != StreamEvent.Type.EXPIRED || !allowExpiredEvents))) {
      complexEventChunk.remove();
    }
  }
  complexEventChunk.reset();
  if (complexEventChunk.hasNext()) {
    try {
      reentrantLock.lock();
      outputPublisher.send(complexEventChunk.getFirst());
    }
  finally {
      reentrantLock.unlock();
    }
  }
}
Program: 28972
Project: 28972
Buggy source:
private void deleteFromIndexesAndPrimaryKey(String currentAttribute,Set<StreamEvent> deletedEventSet){
  for (  StreamEvent deletedEvent : deletedEventSet) {
    primaryKeyData.remove(deletedEvent.getOutputData()[primaryKeyPosition]);
    for (    Map.Entry<String,Integer> indexEntry : indexMetaData.entrySet()) {
      if (!currentAttribute.equals(indexEntry.getKey())) {
        TreeMap<Object,Set<StreamEvent>> indexMap=indexData.get(indexEntry.getKey());
        Object key=deletedEvent.getOutputData()[indexEntry.getValue()];
        Set<StreamEvent> values=indexMap.get(key);
        values.remove(deletedEvent);
        if (values.size() == 0) {
          indexMap.remove(key);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void deleteFromIndexesAndPrimaryKey(String currentAttribute,Set<StreamEvent> deletedEventSet){
  for (  StreamEvent deletedEvent : deletedEventSet) {
    if (primaryKeyData != null) {
      primaryKeyData.remove(deletedEvent.getOutputData()[primaryKeyPosition]);
    }
    for (    Map.Entry<String,Integer> indexEntry : indexMetaData.entrySet()) {
      if (!currentAttribute.equals(indexEntry.getKey())) {
        TreeMap<Object,Set<StreamEvent>> indexMap=indexData.get(indexEntry.getKey());
        Object key=deletedEvent.getOutputData()[indexEntry.getValue()];
        Set<StreamEvent> values=indexMap.get(key);
        values.remove(deletedEvent);
        if (values.size() == 0) {
          indexMap.remove(key);
        }
      }
    }
  }
}
Program: 28974
Project: 28974
Buggy source:
public Set<StreamEvent> findEventSet(StateEvent matchingEvent,IndexedEventHolder indexedEventHolder){
  Set<StreamEvent> leftStreamEvents=leftCollectionExecutor.findEventSet(matchingEvent,indexedEventHolder);
  if (leftStreamEvents == null || (leftStreamEvents.size() > 0)) {
    return null;
  }
 else {
    Set<StreamEvent> rightStreamEvents=rightCollectionExecutor.findEventSet(matchingEvent,indexedEventHolder);
    if (rightStreamEvents == null || (rightStreamEvents.size() > 0)) {
      return null;
    }
 else {
      Set<StreamEvent> returnSet=new HashSet<StreamEvent>();
      for (      StreamEvent aStreamEvent : leftStreamEvents) {
        if (rightStreamEvents.contains(aStreamEvent)) {
          returnSet.add(aStreamEvent);
        }
      }
      return returnSet;
    }
  }
}

Fixed version (ground truth):
public Set<StreamEvent> findEventSet(StateEvent matchingEvent,IndexedEventHolder indexedEventHolder){
  Set<StreamEvent> leftStreamEvents=leftCollectionExecutor.findEventSet(matchingEvent,indexedEventHolder);
  if (leftStreamEvents == null) {
    return null;
  }
 else   if (leftStreamEvents.size() > 0) {
    Set<StreamEvent> rightStreamEvents=rightCollectionExecutor.findEventSet(matchingEvent,indexedEventHolder);
    if (rightStreamEvents == null) {
      return null;
    }
 else     if (rightStreamEvents.size() > 0) {
      Set<StreamEvent> returnSet=new HashSet<StreamEvent>();
      for (      StreamEvent aStreamEvent : leftStreamEvents) {
        if (rightStreamEvents.contains(aStreamEvent)) {
          returnSet.add(aStreamEvent);
        }
      }
      return returnSet;
    }
 else {
      return rightStreamEvents;
    }
  }
 else {
    return leftStreamEvents;
  }
}
Program: 28975
Project: 28975
Buggy source:
public CompareExhaustiveAndCollectionExecutor(CollectionExecutor compareCollectionExecutor,CollectionExecutor aCollectionExecutor){
  this.compareCollectionExecutor=compareCollectionExecutor;
  this.aCollectionExecutor=aCollectionExecutor;
}

Fixed version (ground truth):
public CompareExhaustiveAndCollectionExecutor(CollectionExecutor compareCollectionExecutor,ExhaustiveCollectionExecutor exhaustiveCollectionExecutor){
  this.compareCollectionExecutor=compareCollectionExecutor;
  this.exhaustiveCollectionExecutor=exhaustiveCollectionExecutor;
}
Program: 28976
Project: 28976
Buggy source:
@Override public boolean contains(StateEvent matchingEvent,IndexedEventHolder indexedEventHolder){
  Set<StreamEvent> compareStreamEvents=findEventSet(matchingEvent,indexedEventHolder);
  if (compareStreamEvents == null) {
    return aCollectionExecutor.contains(matchingEvent,indexedEventHolder);
  }
 else {
    return compareStreamEvents.size() > 0;
  }
}

Fixed version (ground truth):
@Override public boolean contains(StateEvent matchingEvent,IndexedEventHolder indexedEventHolder){
  Set<StreamEvent> compareStreamEvents=findEventSet(matchingEvent,indexedEventHolder);
  if (compareStreamEvents == null) {
    return exhaustiveCollectionExecutor.contains(matchingEvent,indexedEventHolder);
  }
 else {
    return compareStreamEvents.size() > 0;
  }
}
Program: 28977
Project: 28977
Buggy source:
public StreamEvent find(StateEvent matchingEvent,IndexedEventHolder indexedEventHolder,StreamEventCloner candidateEventCloner){
  Set<StreamEvent> compareStreamEvents=findEventSet(matchingEvent,indexedEventHolder);
  if (compareStreamEvents == null) {
    return aCollectionExecutor.find(matchingEvent,indexedEventHolder,candidateEventCloner);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public StreamEvent find(StateEvent matchingEvent,IndexedEventHolder indexedEventHolder,StreamEventCloner candidateEventCloner){
  ComplexEventChunk<StreamEvent> returnEventChunk=new ComplexEventChunk<StreamEvent>(false);
  Set<StreamEvent> resultEventSet=findEventSet(matchingEvent,indexedEventHolder);
  if (resultEventSet != null) {
    for (    StreamEvent resultEvent : resultEventSet) {
      if (candidateEventCloner != null) {
        returnEventChunk.add(candidateEventCloner.copyStreamEvent(resultEvent));
      }
 else {
        returnEventChunk.add(resultEvent);
      }
    }
    return returnEventChunk.getFirst();
  }
 else {
    return exhaustiveCollectionExecutor.find(matchingEvent,indexedEventHolder,candidateEventCloner);
  }
}
Program: 28978
Project: 28978
Buggy source:
public Set<StreamEvent> findEventSet(StateEvent matchingEvent,IndexedEventHolder indexedEventHolder){
  Set<StreamEvent> compareStreamEvents=compareCollectionExecutor.findEventSet(matchingEvent,indexedEventHolder);
  if (compareStreamEvents == null || compareStreamEvents.size() > 0) {
    return null;
  }
 else {
    return new HashSet<StreamEvent>();
  }
}

Fixed version (ground truth):
public Set<StreamEvent> findEventSet(StateEvent matchingEvent,IndexedEventHolder indexedEventHolder){
  Set<StreamEvent> compareStreamEvents=compareCollectionExecutor.findEventSet(matchingEvent,indexedEventHolder);
  if (compareStreamEvents == null) {
    return null;
  }
 else   if (compareStreamEvents.size() > 0) {
    if (exhaustiveCollectionExecutor != null) {
      return exhaustiveCollectionExecutor.findEventSet(matchingEvent,compareStreamEvents);
    }
 else {
      return null;
    }
  }
 else {
    return compareStreamEvents;
  }
}
Program: 28979
Project: 28979
Buggy source:
@Override public void delete(StateEvent deletingEvent,IndexedEventHolder indexedEventHolder){
  Set<StreamEvent> compareStreamEvents=findEventSet(deletingEvent,indexedEventHolder);
  if (compareStreamEvents == null) {
    aCollectionExecutor.delete(deletingEvent,indexedEventHolder);
  }
}

Fixed version (ground truth):
@Override public void delete(StateEvent deletingEvent,IndexedEventHolder indexedEventHolder){
  Set<StreamEvent> compareStreamEvents=findEventSet(deletingEvent,indexedEventHolder);
  if (compareStreamEvents == null) {
    exhaustiveCollectionExecutor.delete(deletingEvent,indexedEventHolder);
  }
}
Program: 28982
Project: 28982
Buggy source:
/** 
 * Method to integrate Carbon Metrics into Siddhi
 * @param statisticsConfiguration
 */
public void setStatisticsConfiguration(StatisticsConfiguration statisticsConfiguration){
  siddhiContext.setStatisticsConfiguration(statisticsConfiguration);
}

Fixed version (ground truth):
/** 
 * Method to integrate Carbon Metrics into Siddhi
 * @param statisticsConfiguration statistics configuration
 */
public void setStatisticsConfiguration(StatisticsConfiguration statisticsConfiguration){
  siddhiContext.setStatisticsConfiguration(statisticsConfiguration);
}
Program: 28983
Project: 28983
Buggy source:
/** 
 * Method to validate provided String representation of Execution Plan. Method will throw  {@link org.wso2.siddhi.query.api.exception.ExecutionPlanValidationException} if submitted Siddhi queries haveerrors.
 * @param executionPlan
 */
public void validateExecutionPlan(String executionPlan){
  validateExecutionPlan(SiddhiCompiler.parse(executionPlan));
}

Fixed version (ground truth):
/** 
 * Method to validate provided String representation of Execution Plan. Method will throw  {@link org.wso2.siddhi.query.api.exception.ExecutionPlanValidationException} if submitted Siddhi queries haveerrors.
 * @param executionPlan execution plan
 */
public void validateExecutionPlan(String executionPlan){
  validateExecutionPlan(SiddhiCompiler.parse(executionPlan));
}
Program: 28984
Project: 28984
Buggy source:
/** 
 * Join the given two event streams
 * @param leftStream  event left stream
 * @param rightStream event right stream
 */
public StateEvent joinEventBuilder(StreamEvent leftStream,StreamEvent rightStream){
  StateEvent returnEvent=stateEventPool.borrowEvent();
  returnEvent.setEvent(0,leftStream);
  returnEvent.setEvent(1,rightStream);
  if (preJoinProcessor) {
    returnEvent.setType(ComplexEvent.Type.CURRENT);
  }
 else {
    returnEvent.setType(ComplexEvent.Type.EXPIRED);
  }
  if (!leftJoinProcessor) {
    returnEvent.setTimestamp(rightStream.getTimestamp());
  }
 else {
    returnEvent.setTimestamp(leftStream.getTimestamp());
  }
  return returnEvent;
}

Fixed version (ground truth):
/** 
 * Join the given two event streams
 * @param leftStream  event left stream
 * @param rightStream event right stream
 * @return StateEvent state event
 */
public StateEvent joinEventBuilder(StreamEvent leftStream,StreamEvent rightStream){
  StateEvent returnEvent=stateEventPool.borrowEvent();
  returnEvent.setEvent(0,leftStream);
  returnEvent.setEvent(1,rightStream);
  if (preJoinProcessor) {
    returnEvent.setType(ComplexEvent.Type.CURRENT);
  }
 else {
    returnEvent.setType(ComplexEvent.Type.EXPIRED);
  }
  if (!leftJoinProcessor) {
    returnEvent.setTimestamp(rightStream.getTimestamp());
  }
 else {
    returnEvent.setTimestamp(leftStream.getTimestamp());
  }
  return returnEvent;
}
Program: 28985
Project: 28985
Buggy source:
/** 
 * The init method of the StreamProcessor, this method will be called before other methods
 * @param inputDefinition              the incoming stream definition
 * @param attributeExpressionExecutors the executors of each function parameters
 * @param executionPlanContext         the context of the execution plan
 * @param outputExpectsExpiredEvents
 * @return the additional output attributes introduced by the function
 */
protected abstract List<Attribute> init(AbstractDefinition inputDefinition,ExpressionExecutor[] attributeExpressionExecutors,ExecutionPlanContext executionPlanContext,boolean outputExpectsExpiredEvents);

Fixed version (ground truth):
/** 
 * The init method of the StreamProcessor, this method will be called before other methods
 * @param inputDefinition              the incoming stream definition
 * @param attributeExpressionExecutors the executors of each function parameters
 * @param executionPlanContext         the context of the execution plan
 * @param outputExpectsExpiredEvents   is output expects ExpiredEvents
 * @return the additional output attributes introduced by the function
 */
protected abstract List<Attribute> init(AbstractDefinition inputDefinition,ExpressionExecutor[] attributeExpressionExecutors,ExecutionPlanContext executionPlanContext,boolean outputExpectsExpiredEvents);
Program: 28986
Project: 28986
Buggy source:
/** 
 * The main processing method that will be called upon event arrival
 * @param streamEventChunk    the event chunk that need to be processed
 * @param nextProcessor        the next processor to which the success events need to be passed
 * @param streamEventCloner    helps to clone the incoming event for local storage or modification
 * @param complexEventPopulater helps to populate the events with the resultant attributes
 */
protected abstract void processEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk,Processor nextProcessor,StreamEventCloner streamEventCloner,ComplexEventPopulater complexEventPopulater);

Fixed version (ground truth):
/** 
 * The main processing method that will be called upon event arrival
 * @param streamEventChunk      the event chunk that need to be processed
 * @param nextProcessor         the next processor to which the success events need to be passed
 * @param streamEventCloner     helps to clone the incoming event for local storage or modification
 * @param complexEventPopulater helps to populate the events with the resultant attributes
 */
protected abstract void processEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk,Processor nextProcessor,StreamEventCloner streamEventCloner,ComplexEventPopulater complexEventPopulater);
Program: 28989
Project: 28989
Buggy source:
@Override public void deleteAll(Set<StreamEvent> candidateEventSet){
  for (  StreamEvent streamEvent : candidateEventSet) {
    if (primaryKeyData != null) {
      StreamEvent deletedEvent=primaryKeyData.remove(streamEvent.getOutputData()[primaryKeyPosition]);
      if (indexData != null) {
        deleteFromIndexes(deletedEvent);
      }
    }
 else     if (indexData != null) {
      deleteFromIndexes(streamEvent);
    }
  }
}

Fixed version (ground truth):
@Override public void deleteAll(Collection<StreamEvent> candidateEventSet){
  for (  StreamEvent streamEvent : candidateEventSet) {
    if (primaryKeyData != null) {
      StreamEvent deletedEvent=primaryKeyData.remove(streamEvent.getOutputData()[primaryKeyPosition]);
      if (indexData != null) {
        deleteFromIndexes(deletedEvent);
      }
    }
 else     if (indexData != null) {
      deleteFromIndexes(streamEvent);
    }
  }
}
Program: 28990
Project: 28990
Buggy source:
private void deleteFromIndexes(StreamEvent toDeleteEvent){
  for (  Map.Entry<String,Integer> indexEntry : indexMetaData.entrySet()) {
    TreeMap<Object,Set<StreamEvent>> indexMap=indexData.get(indexEntry.getKey());
    Object key=toDeleteEvent.getOutputData()[indexEntry.getValue()];
    Set<StreamEvent> values=indexMap.get(key);
    values.remove(toDeleteEvent);
    if (values.size() == 0) {
      indexMap.remove(key);
    }
  }
}

Fixed version (ground truth):
private void deleteFromIndexes(StreamEvent toDeleteEvent){
  if (indexMetaData != null) {
    for (    Map.Entry<String,Integer> indexEntry : indexMetaData.entrySet()) {
      TreeMap<Object,Set<StreamEvent>> indexMap=indexData.get(indexEntry.getKey());
      Object key=toDeleteEvent.getOutputData()[indexEntry.getValue()];
      Set<StreamEvent> values=indexMap.get(key);
      values.remove(toDeleteEvent);
      if (values.size() == 0) {
        indexMap.remove(key);
      }
    }
  }
}
Program: 28991
Project: 28991
Buggy source:
void deleteAll(Set<StreamEvent> candidateEventSet);

Fixed version (ground truth):
void deleteAll(Collection<StreamEvent> candidateEventSet);
Program: 28992
Project: 28992
Buggy source:
@Override public void deleteAll(Set<StreamEvent> candidateEventSet){
  for (  StreamEvent streamEvent : candidateEventSet) {
    data.remove(streamEvent.getOutputData()[primaryKeyPosition]);
  }
}

Fixed version (ground truth):
@Override public void deleteAll(Collection<StreamEvent> candidateEventSet){
  for (  StreamEvent streamEvent : candidateEventSet) {
    data.remove(streamEvent.getOutputData()[primaryKeyPosition]);
  }
}
Program: 28994
Project: 28994
Buggy source:
@Override public void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  if (indexAttribute != null) {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsMap,mappingPosition);
  }
 else {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsList,mappingPosition);
  }
}

Fixed version (ground truth):
@Override public void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  try {
    readWriteLock.writeLock().lock();
    if (indexAttribute != null) {
      operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsMap,mappingPosition);
    }
 else {
      operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsList,mappingPosition);
    }
  }
  finally {
    readWriteLock.writeLock().unlock();
  }
}
Program: 28995
Project: 28995
Buggy source:
/** 
 * Called when insert or overwriting the event table entries.
 * @param overwritingOrAddingEventChunk Event list that needs to be inserted or updated.
 * @param operator                      Operator that perform Hazelcast related operations.
 */
@Override public void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  if (indexAttribute != null) {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsMap,mappingPosition);
  }
 else {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsList,mappingPosition);
  }
}

Fixed version (ground truth):
/** 
 * Called when insert or overwriting the event table entries.
 * @param overwritingOrAddingEventChunk Event list that needs to be inserted or updated.
 * @param operator                      Operator that perform Hazelcast related operations.
 */
@Override public synchronized void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  if (indexAttribute != null) {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsMap,mappingPosition);
  }
 else {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsList,mappingPosition);
  }
}
Program: 28996
Project: 28996
Buggy source:
/** 
 * Called when having "in" condition, to check the existence of the event
 * @param matchingEvent Event that need to be check for existence
 * @param finder        Operator that perform RDBMS related search
 */
@Override public boolean contains(ComplexEvent matchingEvent,Finder finder){
  if (isCachingEnabled) {
    return ((RDBMSOperator)finder).getInMemoryEventTableOperator().contains(matchingEvent,cachedTable.getCacheList()) || finder.contains(matchingEvent,null);
  }
  return finder.contains(matchingEvent,null);
}

Fixed version (ground truth):
/** 
 * Called when having "in" condition, to check the existence of the event
 * @param matchingEvent Event that need to be check for existence
 * @param finder        Operator that perform RDBMS related search
 */
@Override public synchronized boolean contains(ComplexEvent matchingEvent,Finder finder){
  if (isCachingEnabled) {
    return ((RDBMSOperator)finder).getInMemoryEventTableOperator().contains(matchingEvent,cachedTable.getCacheList()) || finder.contains(matchingEvent,null);
  }
  return finder.contains(matchingEvent,null);
}
Program: 28997
Project: 28997
Buggy source:
@Override public void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  operator.overwriteOrAdd(overwritingOrAddingEventChunk,null,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().overwriteOrAdd(overwritingOrAddingEventChunk,cachedTable.getCacheList(),mappingPosition);
  }
}

Fixed version (ground truth):
@Override public synchronized void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  operator.overwriteOrAdd(overwritingOrAddingEventChunk,null,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().overwriteOrAdd(overwritingOrAddingEventChunk,cachedTable.getCacheList(),mappingPosition);
  }
}
Program: 28998
Project: 28998
Buggy source:
/** 
 * Called to find a event from event table
 */
@Override public StreamEvent find(ComplexEvent matchingEvent,Finder finder){
  return finder.find(matchingEvent,null,null);
}

Fixed version (ground truth):
/** 
 * Called to find a event from event table
 */
@Override public synchronized StreamEvent find(ComplexEvent matchingEvent,Finder finder){
  return finder.find(matchingEvent,null,null);
}
Program: 28999
Project: 28999
Buggy source:
/** 
 * Called when updating the event table entries
 * @param updatingEventChunk Event list that needs to be updated
 * @param operator           Operator that perform RDBMS related operations
 */
@Override public void update(ComplexEventChunk updatingEventChunk,Operator operator,int[] mappingPosition){
  operator.update(updatingEventChunk,null,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().update(updatingEventChunk,cachedTable.getCacheList(),mappingPosition);
  }
}

Fixed version (ground truth):
/** 
 * Called when updating the event table entries
 * @param updatingEventChunk Event list that needs to be updated
 * @param operator           Operator that perform RDBMS related operations
 */
@Override public synchronized void update(ComplexEventChunk updatingEventChunk,Operator operator,int[] mappingPosition){
  operator.update(updatingEventChunk,null,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().update(updatingEventChunk,cachedTable.getCacheList(),mappingPosition);
  }
}
Program: 29000
Project: 29000
Buggy source:
/** 
 * Called when deleting an event chunk from event table
 * @param deletingEventChunk Event list for deletion
 * @param operator           Operator that perform RDBMS related operations
 */
@Override public void delete(ComplexEventChunk deletingEventChunk,Operator operator){
  operator.delete(deletingEventChunk,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().delete(deletingEventChunk,cachedTable.getCacheList());
  }
}

Fixed version (ground truth):
/** 
 * Called when deleting an event chunk from event table
 * @param deletingEventChunk Event list for deletion
 * @param operator           Operator that perform RDBMS related operations
 */
@Override public synchronized void delete(ComplexEventChunk deletingEventChunk,Operator operator){
  operator.delete(deletingEventChunk,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().delete(deletingEventChunk,cachedTable.getCacheList());
  }
}
Program: 29001
Project: 29001
Buggy source:
@Override public void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  if (indexAttribute != null) {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsMap,mappingPosition);
  }
 else {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsList,mappingPosition);
  }
}

Fixed version (ground truth):
@Override public void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  try {
    readWriteLock.writeLock().lock();
    if (indexAttribute != null) {
      operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsMap,mappingPosition);
    }
 else {
      operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsList,mappingPosition);
    }
  }
  finally {
    readWriteLock.writeLock().unlock();
  }
}
Program: 29002
Project: 29002
Buggy source:
/** 
 * Called when insert or overwriting the event table entries.
 * @param overwritingOrAddingEventChunk Event list that needs to be inserted or updated.
 * @param operator                      Operator that perform Hazelcast related operations.
 */
@Override public void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  if (indexAttribute != null) {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsMap,mappingPosition);
  }
 else {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsList,mappingPosition);
  }
}

Fixed version (ground truth):
/** 
 * Called when insert or overwriting the event table entries.
 * @param overwritingOrAddingEventChunk Event list that needs to be inserted or updated.
 * @param operator                      Operator that perform Hazelcast related operations.
 */
@Override public synchronized void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  if (indexAttribute != null) {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsMap,mappingPosition);
  }
 else {
    operator.overwriteOrAdd(overwritingOrAddingEventChunk,eventsList,mappingPosition);
  }
}
Program: 29003
Project: 29003
Buggy source:
/** 
 * Called when having "in" condition, to check the existence of the event
 * @param matchingEvent Event that need to be check for existence
 * @param finder        Operator that perform RDBMS related search
 */
@Override public boolean contains(ComplexEvent matchingEvent,Finder finder){
  if (isCachingEnabled) {
    return ((RDBMSOperator)finder).getInMemoryEventTableOperator().contains(matchingEvent,cachedTable.getCacheList()) || finder.contains(matchingEvent,null);
  }
  return finder.contains(matchingEvent,null);
}

Fixed version (ground truth):
/** 
 * Called when having "in" condition, to check the existence of the event
 * @param matchingEvent Event that need to be check for existence
 * @param finder        Operator that perform RDBMS related search
 */
@Override public synchronized boolean contains(ComplexEvent matchingEvent,Finder finder){
  if (isCachingEnabled) {
    return ((RDBMSOperator)finder).getInMemoryEventTableOperator().contains(matchingEvent,cachedTable.getCacheList()) || finder.contains(matchingEvent,null);
  }
  return finder.contains(matchingEvent,null);
}
Program: 29004
Project: 29004
Buggy source:
@Override public void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  operator.overwriteOrAdd(overwritingOrAddingEventChunk,null,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().overwriteOrAdd(overwritingOrAddingEventChunk,cachedTable.getCacheList(),mappingPosition);
  }
}

Fixed version (ground truth):
@Override public synchronized void overwriteOrAdd(ComplexEventChunk overwritingOrAddingEventChunk,Operator operator,int[] mappingPosition){
  operator.overwriteOrAdd(overwritingOrAddingEventChunk,null,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().overwriteOrAdd(overwritingOrAddingEventChunk,cachedTable.getCacheList(),mappingPosition);
  }
}
Program: 29005
Project: 29005
Buggy source:
/** 
 * Called to find a event from event table
 */
@Override public StreamEvent find(ComplexEvent matchingEvent,Finder finder){
  return finder.find(matchingEvent,null,null);
}

Fixed version (ground truth):
/** 
 * Called to find a event from event table
 */
@Override public synchronized StreamEvent find(ComplexEvent matchingEvent,Finder finder){
  return finder.find(matchingEvent,null,null);
}
Program: 29006
Project: 29006
Buggy source:
/** 
 * Called when updating the event table entries
 * @param updatingEventChunk Event list that needs to be updated
 * @param operator           Operator that perform RDBMS related operations
 */
@Override public void update(ComplexEventChunk updatingEventChunk,Operator operator,int[] mappingPosition){
  operator.update(updatingEventChunk,null,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().update(updatingEventChunk,cachedTable.getCacheList(),mappingPosition);
  }
}

Fixed version (ground truth):
/** 
 * Called when updating the event table entries
 * @param updatingEventChunk Event list that needs to be updated
 * @param operator           Operator that perform RDBMS related operations
 */
@Override public synchronized void update(ComplexEventChunk updatingEventChunk,Operator operator,int[] mappingPosition){
  operator.update(updatingEventChunk,null,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().update(updatingEventChunk,cachedTable.getCacheList(),mappingPosition);
  }
}
Program: 29007
Project: 29007
Buggy source:
/** 
 * Called when deleting an event chunk from event table
 * @param deletingEventChunk Event list for deletion
 * @param operator           Operator that perform RDBMS related operations
 */
@Override public void delete(ComplexEventChunk deletingEventChunk,Operator operator){
  operator.delete(deletingEventChunk,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().delete(deletingEventChunk,cachedTable.getCacheList());
  }
}

Fixed version (ground truth):
/** 
 * Called when deleting an event chunk from event table
 * @param deletingEventChunk Event list for deletion
 * @param operator           Operator that perform RDBMS related operations
 */
@Override public synchronized void delete(ComplexEventChunk deletingEventChunk,Operator operator){
  operator.delete(deletingEventChunk,null);
  if (isCachingEnabled) {
    ((RDBMSOperator)operator).getInMemoryEventTableOperator().delete(deletingEventChunk,cachedTable.getCacheList());
  }
}
Program: 29008
Project: 29008
Buggy source:
@Override public void receive(long timeStamp,Object[] data){
synchronized (lockKey) {
    stabilizeStates();
    for (    int anEventSequence : eventSequence) {
      StreamEventConverter aStreamEventConverter=streamEventConverters[anEventSequence];
      StreamEventPool aStreamEventPool=streamEventPools[anEventSequence];
      StreamEvent borrowedEvent=aStreamEventPool.borrowEvent();
      aStreamEventConverter.convertData(timeStamp,data,borrowedEvent);
      process(anEventSequence,borrowedEvent);
    }
  }
}

Fixed version (ground truth):
@Override public void receive(long timeStamp,Object[] data){
synchronized (this) {
    stabilizeStates();
    for (    int anEventSequence : eventSequence) {
      StreamEventConverter aStreamEventConverter=streamEventConverters[anEventSequence];
      StreamEventPool aStreamEventPool=streamEventPools[anEventSequence];
      StreamEvent borrowedEvent=aStreamEventPool.borrowEvent();
      aStreamEventConverter.convertData(timeStamp,data,borrowedEvent);
      process(anEventSequence,borrowedEvent);
    }
  }
}
Program: 29009
Project: 29009
Buggy source:
public MultiProcessStreamReceiver clone(String key){
  return new MultiProcessStreamReceiver(streamId + key,key,processCount,latencyTracker);
}

Fixed version (ground truth):
public MultiProcessStreamReceiver clone(String key){
  return new MultiProcessStreamReceiver(streamId + key,processCount,latencyTracker);
}
Program: 29010
Project: 29010
Buggy source:
public MultiProcessStreamReceiver(String streamId,String lockKey,int processCount,LatencyTracker latencyTracker){
  super(streamId,latencyTracker);
  this.lockKey=lockKey;
  this.processCount=processCount;
  nextProcessors=new Processor[processCount];
  metaStreamEvents=new MetaStreamEvent[processCount];
  streamEventPools=new StreamEventPool[processCount];
  streamEventConverters=new StreamEventConverter[processCount];
  eventSequence=new int[processCount];
  for (int i=0; i < eventSequence.length; i++) {
    eventSequence[i]=i;
  }
}

Fixed version (ground truth):
public MultiProcessStreamReceiver(String streamId,int processCount,LatencyTracker latencyTracker){
  super(streamId,latencyTracker);
  this.processCount=processCount;
  nextProcessors=new Processor[processCount];
  metaStreamEvents=new MetaStreamEvent[processCount];
  streamEventPools=new StreamEventPool[processCount];
  streamEventConverters=new StreamEventConverter[processCount];
  eventSequence=new int[processCount];
  for (int i=0; i < eventSequence.length; i++) {
    eventSequence[i]=i;
  }
}
Program: 29011
Project: 29011
Buggy source:
public StateMultiProcessStreamReceiver clone(String key){
  return new StateMultiProcessStreamReceiver(streamId + key,processCount,key,latencyTracker);
}

Fixed version (ground truth):
public StateMultiProcessStreamReceiver clone(String key){
  return new StateMultiProcessStreamReceiver(streamId + key,processCount,latencyTracker);
}
Program: 29012
Project: 29012
Buggy source:
public StateMultiProcessStreamReceiver(String streamId,int processCount,String lockKey,LatencyTracker latencyTracker){
  super(streamId,lockKey,processCount,latencyTracker);
}

Fixed version (ground truth):
public StateMultiProcessStreamReceiver(String streamId,int processCount,LatencyTracker latencyTracker){
  super(streamId,processCount,latencyTracker);
}
Program: 29013
Project: 29013
Buggy source:
public PatternMultiProcessStreamReceiver(String streamId,int processCount,String lockKey,LatencyTracker latencyTracker){
  super(streamId,processCount,lockKey,latencyTracker);
  eventSequence=new int[processCount];
  int count=0;
  for (int i=eventSequence.length - 1; i >= 0; i--) {
    eventSequence[count]=i;
    count++;
  }
}

Fixed version (ground truth):
public PatternMultiProcessStreamReceiver(String streamId,int processCount,LatencyTracker latencyTracker){
  super(streamId,processCount,latencyTracker);
  eventSequence=new int[processCount];
  int count=0;
  for (int i=eventSequence.length - 1; i >= 0; i--) {
    eventSequence[count]=i;
    count++;
  }
}
Program: 29014
Project: 29014
Buggy source:
public PatternMultiProcessStreamReceiver clone(String key){
  return new PatternMultiProcessStreamReceiver(streamId + key,processCount,key,latencyTracker);
}

Fixed version (ground truth):
public PatternMultiProcessStreamReceiver clone(String key){
  return new PatternMultiProcessStreamReceiver(streamId + key,processCount,latencyTracker);
}
Program: 29015
Project: 29015
Buggy source:
public SequenceMultiProcessStreamReceiver clone(String key){
  return new SequenceMultiProcessStreamReceiver(streamId + key,processCount,null,key,latencyTracker);
}

Fixed version (ground truth):
public SequenceMultiProcessStreamReceiver clone(String key){
  return new SequenceMultiProcessStreamReceiver(streamId + key,processCount,null,latencyTracker);
}
Program: 29016
Project: 29016
Buggy source:
public SequenceMultiProcessStreamReceiver(String streamId,int processCount,StateStreamRuntime stateStreamRuntime,String lockKey,LatencyTracker latencyTracker){
  super(streamId,processCount,lockKey,latencyTracker);
  this.stateStreamRuntime=stateStreamRuntime;
  eventSequence=new int[processCount];
  int count=0;
  for (int i=eventSequence.length - 1; i >= 0; i--) {
    eventSequence[count]=i;
    count++;
  }
}

Fixed version (ground truth):
public SequenceMultiProcessStreamReceiver(String streamId,int processCount,StateStreamRuntime stateStreamRuntime,LatencyTracker latencyTracker){
  super(streamId,processCount,latencyTracker);
  this.stateStreamRuntime=stateStreamRuntime;
  eventSequence=new int[processCount];
  int count=0;
  for (int i=eventSequence.length - 1; i >= 0; i--) {
    eventSequence[count]=i;
    count++;
  }
}
Program: 29022
Project: 29022
Buggy source:
public void restoreState(Object[] state){
  currentEventChunk.clear();
  currentEventChunk.add((StreamEvent)state[0]);
  resetEvent=(StreamEvent)state[1];
  endTime=(Long)state[2];
  startTime=(Long)state[3];
  isStartTimeEnabled=(Boolean)state[4];
  schedulerTimeout=(Long)state[5];
  if (state.length > 6) {
    expiredEventChunk.clear();
    expiredEventChunk.add((StreamEvent)state[6]);
  }
}

Fixed version (ground truth):
public void restoreState(Object[] state){
  currentEventChunk.clear();
  currentEventChunk.add((StreamEvent)state[0]);
  if (state[1] != null) {
    expiredEventChunk.clear();
    expiredEventChunk.add((StreamEvent)state[1]);
  }
 else {
    expiredEventChunk=null;
  }
  resetEvent=(StreamEvent)state[2];
  endTime=(Long)state[3];
  startTime=(Long)state[4];
  lastScheduledTime=(Long)state[5];
  lastCurrentEventTime=(Long)state[6];
  flushed=(Boolean)state[7];
}