nus-yam/ex-repair huggingface dataset:
Program: 29023
Project: 29023
Buggy source:
public Finder constructFinder(Expression expression,MetaComplexEvent matchingMetaComplexEvent,ExecutionPlanContext executionPlanContext,List<VariableExpressionExecutor> variableExpressionExecutors,Map<String,EventTable> eventTableMap,int matchingStreamIndex,long withinTime){
  if (expiredEventChunk == null) {
    expiredEventChunk=new ComplexEventChunk<StreamEvent>(false);
  }
  return CollectionOperatorParser.parse(expression,matchingMetaComplexEvent,executionPlanContext,variableExpressionExecutors,eventTableMap,matchingStreamIndex,inputDefinition,withinTime);
}

Fixed version (ground truth):
public Finder constructFinder(Expression expression,MetaComplexEvent matchingMetaComplexEvent,ExecutionPlanContext executionPlanContext,List<VariableExpressionExecutor> variableExpressionExecutors,Map<String,EventTable> eventTableMap,int matchingStreamIndex,long withinTime){
  if (expiredEventChunk == null) {
    expiredEventChunk=new ComplexEventChunk<StreamEvent>(false);
    storeExpiredEvents=true;
  }
  return CollectionOperatorParser.parse(expression,matchingMetaComplexEvent,executionPlanContext,variableExpressionExecutors,eventTableMap,matchingStreamIndex,inputDefinition,withinTime);
}
Program: 29025
Project: 29025
Buggy source:
private void flushToOutputChunk(StreamEventCloner streamEventCloner,List<ComplexEventChunk<StreamEvent>> complexEventChunks,long currentTime){
  ComplexEventChunk<StreamEvent> newEventChunk=new ComplexEventChunk<StreamEvent>(true);
  if (outputExpectsExpiredEvents) {
    if (expiredEventChunk.getFirst() != null) {
      expiredEventChunk.reset();
      while (expiredEventChunk.hasNext()) {
        StreamEvent expiredEvent=expiredEventChunk.next();
        expiredEvent.setTimestamp(currentTime);
      }
      newEventChunk.add(expiredEventChunk.getFirst());
    }
  }
  if (expiredEventChunk != null) {
    expiredEventChunk.clear();
  }
  if (currentEventChunk.getFirst() != null) {
    resetEvent.setTimestamp(currentTime);
    newEventChunk.add(resetEvent);
    resetEvent=null;
    if (expiredEventChunk != null) {
      currentEventChunk.reset();
      while (currentEventChunk.hasNext()) {
        StreamEvent currentEvent=currentEventChunk.next();
        StreamEvent toExpireEvent=streamEventCloner.copyStreamEvent(currentEvent);
        toExpireEvent.setType(StreamEvent.Type.EXPIRED);
        expiredEventChunk.add(toExpireEvent);
      }
    }
    newEventChunk.add(currentEventChunk.getFirst());
  }
  currentEventChunk.clear();
  if (newEventChunk.getFirst() != null) {
    complexEventChunks.add(newEventChunk);
  }
}

Fixed version (ground truth):
private void flushToOutputChunk(StreamEventCloner streamEventCloner,List<ComplexEventChunk<StreamEvent>> complexEventChunks,long currentTime,boolean preserveCurrentEvents){
  ComplexEventChunk<StreamEvent> newEventChunk=new ComplexEventChunk<StreamEvent>(true);
  if (outputExpectsExpiredEvents) {
    if (expiredEventChunk.getFirst() != null) {
      expiredEventChunk.reset();
      while (expiredEventChunk.hasNext()) {
        StreamEvent expiredEvent=expiredEventChunk.next();
        expiredEvent.setTimestamp(currentTime);
      }
      newEventChunk.add(expiredEventChunk.getFirst());
    }
  }
  if (expiredEventChunk != null) {
    expiredEventChunk.clear();
  }
  if (currentEventChunk.getFirst() != null) {
    resetEvent.setTimestamp(currentTime);
    newEventChunk.add(resetEvent);
    resetEvent=null;
    if (preserveCurrentEvents || storeExpiredEvents) {
      currentEventChunk.reset();
      while (currentEventChunk.hasNext()) {
        StreamEvent currentEvent=currentEventChunk.next();
        StreamEvent toExpireEvent=streamEventCloner.copyStreamEvent(currentEvent);
        toExpireEvent.setType(StreamEvent.Type.EXPIRED);
        expiredEventChunk.add(toExpireEvent);
      }
    }
    newEventChunk.add(currentEventChunk.getFirst());
  }
  currentEventChunk.clear();
  if (newEventChunk.getFirst() != null) {
    complexEventChunks.add(newEventChunk);
  }
}
Program: 29026
Project: 29026
Buggy source:
public Object[] currentState(){
  if (expiredEventChunk != null) {
    return new Object[]{currentEventChunk.getFirst(),endTime,startTime,isStartTimeEnabled,schedulerTimeout,resetEvent,expiredEventChunk.getFirst()};
  }
 else {
    return new Object[]{currentEventChunk.getFirst(),endTime,startTime,isStartTimeEnabled,schedulerTimeout,resetEvent};
  }
}

Fixed version (ground truth):
public Object[] currentState(){
  return new Object[]{currentEventChunk.getFirst(),expiredEventChunk != null ? expiredEventChunk.getFirst() : null,resetEvent,endTime,startTime,lastScheduledTime,lastCurrentEventTime,flushed};
}
Program: 29027
Project: 29027
Buggy source:
@Override public void receive(long timeStamp,Object[] data){
  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 (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);
    }
  }
}
Program: 29028
Project: 29028
Buggy source:
public MultiProcessStreamReceiver clone(String key){
  return new MultiProcessStreamReceiver(streamId + key,processCount,latencyTracker);
}

Fixed version (ground truth):
public MultiProcessStreamReceiver clone(String key){
  return new MultiProcessStreamReceiver(streamId + key,key,processCount,latencyTracker);
}
Program: 29029
Project: 29029
Buggy source:
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;
  }
}

Fixed version (ground truth):
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;
  }
}
Program: 29030
Project: 29030
Buggy source:
protected void processAndClear(int processIndex,StreamEvent streamEvent){
  ComplexEventChunk<StateEvent> retEventChunk=new ComplexEventChunk<StateEvent>(false);
  ComplexEventChunk<StreamEvent> currentStreamEventChunk=new ComplexEventChunk<StreamEvent>(streamEvent,streamEvent,false);
synchronized (lockKey) {
    ComplexEventChunk<StateEvent> eventChunk=((StreamPreStateProcessor)nextProcessors[processIndex]).processAndReturn(currentStreamEventChunk);
    if (eventChunk.getFirst() != null) {
      retEventChunk.add(eventChunk.getFirst());
    }
    eventChunk.clear();
  }
  if (querySelector != null) {
    while (retEventChunk.hasNext()) {
      StateEvent stateEvent=retEventChunk.next();
      retEventChunk.remove();
      querySelector.process(new ComplexEventChunk<StateEvent>(stateEvent,stateEvent,false));
    }
  }
}

Fixed version (ground truth):
protected void processAndClear(int processIndex,StreamEvent streamEvent){
  ComplexEventChunk<StateEvent> retEventChunk=new ComplexEventChunk<StateEvent>(false);
  ComplexEventChunk<StreamEvent> currentStreamEventChunk=new ComplexEventChunk<StreamEvent>(streamEvent,streamEvent,false);
  ComplexEventChunk<StateEvent> eventChunk=((StreamPreStateProcessor)nextProcessors[processIndex]).processAndReturn(currentStreamEventChunk);
  if (eventChunk.getFirst() != null) {
    retEventChunk.add(eventChunk.getFirst());
  }
  eventChunk.clear();
  if (querySelector != null) {
    while (retEventChunk.hasNext()) {
      StateEvent stateEvent=retEventChunk.next();
      retEventChunk.remove();
      querySelector.process(new ComplexEventChunk<StateEvent>(stateEvent,stateEvent,false));
    }
  }
}
Program: 29031
Project: 29031
Buggy source:
public StateMultiProcessStreamReceiver(String streamId,int processCount,String lockKey,LatencyTracker latencyTracker){
  super(streamId,processCount,latencyTracker);
  this.lockKey=lockKey;
}

Fixed version (ground truth):
public StateMultiProcessStreamReceiver(String streamId,int processCount,String lockKey,LatencyTracker latencyTracker){
  super(streamId,lockKey,processCount,latencyTracker);
}
Program: 29032
Project: 29032
Buggy source:
@Override public void restoreState(Object[] state){
  currentStateEventChunk=(ComplexEventChunk<StateEvent>)state[0];
  pendingStateEventList=(ConcurrentLinkedQueue<StateEvent>)state[1];
  newAndEveryStateEventList=(LinkedList<StateEvent>)state[2];
}

Fixed version (ground truth):
@Override public void restoreState(Object[] state){
  currentStateEventChunk=(ComplexEventChunk<StateEvent>)state[0];
  pendingStateEventList=(LinkedList<StateEvent>)state[1];
  newAndEveryStateEventList=(LinkedList<StateEvent>)state[2];
}
Program: 29033
Project: 29033
Buggy source:
@Override public void restoreState(Object[] state){
  eventsList=(LinkedList<StreamEvent>)state[0];
  eventsMap=(TreeMap<Object,StreamEvent>)state[1];
}

Fixed version (ground truth):
@Override public void restoreState(Object[] state){
  eventsList=(ConcurrentLinkedQueue<StreamEvent>)state[0];
  eventsMap=(ConcurrentSkipListMap<Object,StreamEvent>)state[1];
}
Program: 29034
Project: 29034
Buggy source:
public InMemoryEventTable(TableDefinition tableDefinition,ExecutionPlanContext executionPlanContext){
  this.tableDefinition=tableDefinition;
  this.executionPlanContext=executionPlanContext;
  MetaStreamEvent metaStreamEvent=new MetaStreamEvent();
  metaStreamEvent.addInputDefinition(tableDefinition);
  for (  Attribute attribute : tableDefinition.getAttributeList()) {
    metaStreamEvent.addOutputData(attribute);
  }
  Annotation annotation=AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_INDEX_BY,tableDefinition.getAnnotations());
  if (annotation != null) {
    if (annotation.getElements().size() > 1) {
      throw new OperationNotSupportedException(SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str" + annotation.getElements().size()+ "String_Node_Str");
    }
    if (annotation.getElements().size() == 0) {
      throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str" + annotation.getElements().size()+ "String_Node_Str");
    }
    indexAttribute=annotation.getElements().get(0).getValue();
    indexPosition=tableDefinition.getAttributePosition(indexAttribute);
    eventsMap=new TreeMap<Object,StreamEvent>();
  }
 else {
    eventsList=new LinkedList<StreamEvent>();
  }
  streamEventPool=new StreamEventPool(metaStreamEvent,10);
  streamEventCloner=new StreamEventCloner(metaStreamEvent,streamEventPool);
}

Fixed version (ground truth):
public InMemoryEventTable(TableDefinition tableDefinition,ExecutionPlanContext executionPlanContext){
  this.tableDefinition=tableDefinition;
  this.executionPlanContext=executionPlanContext;
  MetaStreamEvent metaStreamEvent=new MetaStreamEvent();
  metaStreamEvent.addInputDefinition(tableDefinition);
  for (  Attribute attribute : tableDefinition.getAttributeList()) {
    metaStreamEvent.addOutputData(attribute);
  }
  Annotation annotation=AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_INDEX_BY,tableDefinition.getAnnotations());
  if (annotation != null) {
    if (annotation.getElements().size() > 1) {
      throw new OperationNotSupportedException(SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str" + annotation.getElements().size()+ "String_Node_Str");
    }
    if (annotation.getElements().size() == 0) {
      throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_INDEX_BY + "String_Node_Str" + annotation.getElements().size()+ "String_Node_Str");
    }
    indexAttribute=annotation.getElements().get(0).getValue();
    indexPosition=tableDefinition.getAttributePosition(indexAttribute);
    eventsMap=new ConcurrentSkipListMap<Object,StreamEvent>();
  }
 else {
    eventsList=new ConcurrentLinkedQueue<StreamEvent>();
  }
  streamEventPool=new StreamEventPool(metaStreamEvent,10);
  streamEventCloner=new StreamEventCloner(metaStreamEvent,streamEventPool);
}
Program: 29036
Project: 29036
Buggy source:
@Override public synchronized Object processAdd(Object data){
  Long value=(Long)data;
  for (Iterator<Long> iterator=maxDeque.descendingIterator(); iterator.hasNext(); ) {
    if (iterator.next() < value) {
      iterator.remove();
    }
 else {
      break;
    }
  }
  maxDeque.addLast(value);
  if (maxValue == null) {
    maxValue=value;
  }
 else   if (maxValue < value) {
    maxValue=value;
  }
  return maxValue;
}

Fixed version (ground truth):
@Override public synchronized Object processAdd(Object data){
  Long value=(Long)data;
  for (Iterator<Long> iterator=maxDeque.descendingIterator(); iterator.hasNext(); ) {
    if (iterator.next() < value) {
      iterator.remove();
    }
 else {
      break;
    }
  }
  maxDeque.addLast(value);
  if (maxValue == null || maxValue < value) {
    maxValue=value;
  }
  return maxValue;
}
Program: 29037
Project: 29037
Buggy source:
@Override public synchronized Object processAdd(Object data){
  Long value=(Long)data;
  for (Iterator<Long> iterator=minDeque.descendingIterator(); iterator.hasNext(); ) {
    if (iterator.next() > value) {
      iterator.remove();
    }
  }
  minDeque.addLast(value);
  if (minValue == null) {
    minValue=value;
  }
 else   if (minValue > value) {
    minValue=value;
  }
  return minValue;
}

Fixed version (ground truth):
@Override public synchronized Object processAdd(Object data){
  Long value=(Long)data;
  for (Iterator<Long> iterator=minDeque.descendingIterator(); iterator.hasNext(); ) {
    if (iterator.next() > value) {
      iterator.remove();
    }
 else {
      break;
    }
  }
  minDeque.addLast(value);
  if (minValue == null || minValue > value) {
    minValue=value;
  }
  return minValue;
}
Program: 29038
Project: 29038
Buggy source:
public Object process(ComplexEvent event){
  if (attributeSize > 1) {
    Object[] data=new Object[attributeSize];
    for (int i=0; i < attributeSize; i++) {
      data[i]=attributeExpressionExecutors[i].execute(event);
    }
switch (event.getType()) {
case CURRENT:
      return processAdd(data);
case EXPIRED:
    return processRemove(data);
case RESET:
  return reset();
}
}
 else if (attributeSize == 1) {
switch (event.getType()) {
case CURRENT:
return processAdd(attributeExpressionExecutors[0].execute(event));
case EXPIRED:
return processRemove(attributeExpressionExecutors[0].execute(event));
case RESET:
return reset();
}
}
 else {
switch (event.getType()) {
case CURRENT:
return processAdd(null);
case EXPIRED:
return processRemove(null);
case RESET:
return reset();
}
}
return null;
}

Fixed version (ground truth):
public synchronized Object process(ComplexEvent event){
  if (attributeSize > 1) {
    Object[] data=new Object[attributeSize];
    for (int i=0; i < attributeSize; i++) {
      data[i]=attributeExpressionExecutors[i].execute(event);
    }
switch (event.getType()) {
case CURRENT:
      return processAdd(data);
case EXPIRED:
    return processRemove(data);
case RESET:
  return reset();
}
}
 else if (attributeSize == 1) {
switch (event.getType()) {
case CURRENT:
return processAdd(attributeExpressionExecutors[0].execute(event));
case EXPIRED:
return processRemove(attributeExpressionExecutors[0].execute(event));
case RESET:
return reset();
}
}
 else {
switch (event.getType()) {
case CURRENT:
return processAdd(null);
case EXPIRED:
return processRemove(null);
case RESET:
return reset();
}
}
return null;
}
Program: 29039
Project: 29039
Buggy source:
private void initializeConnection(){
  Statement stmt=null;
  Boolean tableExists=true;
  Connection con=null;
  try {
    con=dataSource.getConnection();
    stmt=con.createStatement();
    stmt.executeQuery(executionInfo.getPreparedTableExistenceCheckStatement());
  }
 catch (  SQLException e) {
    tableExists=false;
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + tableName + "String_Node_Str");
    }
  }
  try {
    if (!tableExists && stmt != null) {
      stmt.executeUpdate(executionInfo.getPreparedCreateTableStatement());
    }
  }
 catch (  SQLException e) {
    throw new ExecutionPlanRuntimeException("String_Node_Str" + e.getMessage(),e);
  }
 finally {
    cleanUpConnections(stmt,con);
  }
}

Fixed version (ground truth):
private void initializeConnection(){
  Statement stmt=null;
  Boolean tableExists=true;
  Connection con=null;
  try {
    con=dataSource.getConnection();
    stmt=con.createStatement();
    stmt.executeQuery(executionInfo.getPreparedTableExistenceCheckStatement());
  }
 catch (  SQLException e) {
    tableExists=false;
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + tableName + "String_Node_Str");
    }
  }
 finally {
    cleanUpConnections(stmt,con);
  }
  try {
    if (!tableExists) {
      con=dataSource.getConnection();
      stmt=con.createStatement();
      stmt.executeUpdate(executionInfo.getPreparedCreateTableStatement());
      if (con != null && !con.getAutoCommit()) {
        con.commit();
      }
    }
  }
 catch (  SQLException e) {
    try {
      if (con != null && !con.getAutoCommit()) {
        con.rollback();
      }
    }
 catch (    Exception ex) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + tableName + "String_Node_Str",ex);
      }
    }
    throw new ExecutionPlanRuntimeException("String_Node_Str" + e.getMessage(),e);
  }
 finally {
    cleanUpConnections(stmt,con);
  }
}
Program: 29040
Project: 29040
Buggy source:
/** 
 * When an object implementing interface <code>Runnable</code> is used to create a thread, starting the thread causes the object's <code>run</code> method to be called in that separately executing thread. <p> The general contract of the method <code>run</code> is that it may take any action whatsoever.
 * @see Thread#run()
 */
@Override public void run(){
  Long toNotifyTime=toNotifyQueue.peek();
  long currentTime=System.currentTimeMillis();
  while (toNotifyTime != null && toNotifyTime - currentTime <= 0) {
    toNotifyQueue.poll();
    StreamEvent timerEvent=streamEventPool.borrowEvent();
    timerEvent.setType(StreamEvent.Type.TIMER);
    timerEvent.setTimestamp(currentTime);
    streamEventChunk.add(timerEvent);
    if (latencyTracker != null) {
      try {
        latencyTracker.markIn();
        singleThreadEntryValve.process(streamEventChunk);
      }
  finally {
        latencyTracker.markOut();
      }
    }
 else {
      singleThreadEntryValve.process(streamEventChunk);
    }
    streamEventChunk.clear();
    toNotifyTime=toNotifyQueue.peek();
    currentTime=System.currentTimeMillis();
  }
  if (toNotifyTime != null) {
    scheduledExecutorService.schedule(eventCaller,toNotifyTime - currentTime,TimeUnit.MILLISECONDS);
  }
 else {
synchronized (toNotifyQueue) {
      running=false;
      if (toNotifyQueue.peek() != null) {
        running=true;
        scheduledExecutorService.schedule(eventCaller,0,TimeUnit.MILLISECONDS);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * When an object implementing interface <code>Runnable</code> is used to create a thread, starting the thread causes the object's <code>run</code> method to be called in that separately executing thread. <p/> The general contract of the method <code>run</code> is that it may take any action whatsoever.
 * @see Thread#run()
 */
@Override public void run(){
  try {
    Long toNotifyTime=toNotifyQueue.peek();
    long currentTime=System.currentTimeMillis();
    while (toNotifyTime != null && toNotifyTime - currentTime <= 0) {
      toNotifyQueue.poll();
      StreamEvent timerEvent=streamEventPool.borrowEvent();
      timerEvent.setType(StreamEvent.Type.TIMER);
      timerEvent.setTimestamp(currentTime);
      streamEventChunk.add(timerEvent);
      if (latencyTracker != null) {
        try {
          latencyTracker.markIn();
          singleThreadEntryValve.process(streamEventChunk);
        }
  finally {
          latencyTracker.markOut();
        }
      }
 else {
        singleThreadEntryValve.process(streamEventChunk);
      }
      streamEventChunk.clear();
      toNotifyTime=toNotifyQueue.peek();
      currentTime=System.currentTimeMillis();
    }
    if (toNotifyTime != null) {
      scheduledExecutorService.schedule(eventCaller,toNotifyTime - currentTime,TimeUnit.MILLISECONDS);
    }
 else {
synchronized (toNotifyQueue) {
        running=false;
        if (toNotifyQueue.peek() != null) {
          running=true;
          scheduledExecutorService.schedule(eventCaller,0,TimeUnit.MILLISECONDS);
        }
      }
    }
  }
 catch (  Throwable t) {
    log.error(t);
  }
}
Program: 29041
Project: 29041
Buggy source:
public void handleExceptionWith(ExceptionHandler<Object> exceptionHandler){
  executionPlanContext.setExceptionHandler(exceptionHandler);
}

Fixed version (ground truth):
public void handleExceptionWith(ExceptionHandler<Object> exceptionHandler){
  executionPlanContext.setDisruptorExceptionHandler(exceptionHandler);
}
Program: 29042
Project: 29042
Buggy source:
public SiddhiContext(){
  setSiddhiExtensions(SiddhiExtensionLoader.loadSiddhiExtensions());
  eventBufferSize=SiddhiConstants.DEFAULT_EVENT_BUFFER_SIZE;
  siddhiDataSources=new ConcurrentHashMap<String,DataSource>();
  statisticsConfiguration=new StatisticsConfiguration(new SiddhiMetricsFactory());
  extensionHolderMap=new ConcurrentHashMap<Class,AbstractExtensionHolder>();
  exceptionHandler=new ExceptionHandler<Object>(){
    @Override public void handleEventException(    Throwable throwable,    long l,    Object event){
      log.error("String_Node_Str" + "String_Node_Str" + l + "String_Node_Str"+ event.toString()+ "String_Node_Str",throwable);
    }
    @Override public void handleOnStartException(    Throwable throwable){
      log.error("String_Node_Str",throwable);
    }
    @Override public void handleOnShutdownException(    Throwable throwable){
      log.error("String_Node_Str",throwable);
    }
  }
;
}

Fixed version (ground truth):
public SiddhiContext(){
  setSiddhiExtensions(SiddhiExtensionLoader.loadSiddhiExtensions());
  eventBufferSize=SiddhiConstants.DEFAULT_EVENT_BUFFER_SIZE;
  siddhiDataSources=new ConcurrentHashMap<String,DataSource>();
  statisticsConfiguration=new StatisticsConfiguration(new SiddhiMetricsFactory());
  extensionHolderMap=new ConcurrentHashMap<Class,AbstractExtensionHolder>();
  defaultDisrupterExceptionHandler=new ExceptionHandler<Object>(){
    @Override public void handleEventException(    Throwable throwable,    long l,    Object event){
      log.error("String_Node_Str" + "String_Node_Str" + l + "String_Node_Str"+ event.toString()+ "String_Node_Str",throwable);
    }
    @Override public void handleOnStartException(    Throwable throwable){
      log.error("String_Node_Str",throwable);
    }
    @Override public void handleOnShutdownException(    Throwable throwable){
      log.error("String_Node_Str",throwable);
    }
  }
;
}
Program: 29043
Project: 29043
Buggy source:
public synchronized void startProcessing(){
  Boolean asyncEnabled=null;
  if (asyncEnabled != null && asyncEnabled || asyncEnabled == null) {
    for (    Constructor constructor : Disruptor.class.getConstructors()) {
      if (constructor.getParameterTypes().length == 5) {
        disruptor=new Disruptor<EventHolder>(new EventHolderFactory(),executionPlanContext.getSiddhiContext().getEventBufferSize(),executionPlanContext.getExecutorService(),ProducerType.SINGLE,PhasedBackoffWaitStrategy.withLiteLock(1,4,TimeUnit.SECONDS));
        break;
      }
    }
    if (disruptor == null) {
      disruptor=new Disruptor<EventHolder>(new EventHolderFactory(),executionPlanContext.getSiddhiContext().getEventBufferSize(),executionPlanContext.getExecutorService());
    }
    asyncEventHandler=new AsyncEventHandler(this);
    disruptor.handleExceptionsWith(executionPlanContext.getSiddhiContext().getExceptionHandler());
    disruptor.handleEventsWith(asyncEventHandler);
    ringBuffer=disruptor.start();
  }
}

Fixed version (ground truth):
public synchronized void startProcessing(){
  Boolean asyncEnabled=null;
  if (asyncEnabled != null && asyncEnabled || asyncEnabled == null) {
    for (    Constructor constructor : Disruptor.class.getConstructors()) {
      if (constructor.getParameterTypes().length == 5) {
        disruptor=new Disruptor<EventHolder>(new EventHolderFactory(),executionPlanContext.getSiddhiContext().getEventBufferSize(),executionPlanContext.getExecutorService(),ProducerType.SINGLE,PhasedBackoffWaitStrategy.withLiteLock(1,4,TimeUnit.SECONDS));
        break;
      }
    }
    if (disruptor == null) {
      disruptor=new Disruptor<EventHolder>(new EventHolderFactory(),executionPlanContext.getSiddhiContext().getEventBufferSize(),executionPlanContext.getExecutorService());
    }
    asyncEventHandler=new AsyncEventHandler(this);
    disruptor.handleExceptionsWith(executionPlanContext.getDisruptorExceptionHandler());
    disruptor.handleEventsWith(asyncEventHandler);
    ringBuffer=disruptor.start();
  }
}
Program: 29046
Project: 29046
Buggy source:
/** 
 * Create and start disruptor based on annotations given in the streamDefinition.
 */
public synchronized void startProcessing(){
  if (!receivers.isEmpty()) {
    if (parallel == null) {
      parallel=executionPlanContext.isParallel();
    }
    if (parallel) {
      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,PhasedBackoffWaitStrategy.withLiteLock(1,4,TimeUnit.SECONDS));
          disruptor.handleExceptionsWith(executionPlanContext.getSiddhiContext().getExceptionHandler());
          break;
        }
      }
      if (disruptor == null) {
        disruptor=new Disruptor<Event>(new EventFactory(streamDefinition.getAttributeList().size()),bufferSize,executorService);
        disruptor.handleExceptionsWith(executionPlanContext.getSiddhiContext().getExceptionHandler());
      }
      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()) {
    if (parallel == null) {
      parallel=executionPlanContext.isParallel();
    }
    if (parallel) {
      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,PhasedBackoffWaitStrategy.withLiteLock(1,4,TimeUnit.SECONDS));
          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: 29047
Project: 29047
Buggy source:
@Test public void FilterTest117() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String cseEventStream="String_Node_Str";
  String query="String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
      count=count + inEvents.length;
      eventArrived=true;
      if (count == 1) {
        Assert.assertEquals(1465.5f,inEvents[0].getData()[1]);
      }
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",700f,100l});
  inputHandler.send(new Object[]{"String_Node_Str",60.5f,200l});
  inputHandler.send(new Object[]{"String_Node_Str",700f,100l});
  Thread.sleep(1000);
  Assert.assertEquals(1,count);
  Assert.assertTrue(eventArrived);
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void FilterTest117() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String cseEventStream="String_Node_Str";
  String query="String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
      count=count + inEvents.length;
      eventArrived=true;
      if (count == 1) {
        Assert.assertEquals(1465.5,inEvents[0].getData()[1]);
      }
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",700f,100l});
  inputHandler.send(new Object[]{"String_Node_Str",60.5f,200l});
  inputHandler.send(new Object[]{"String_Node_Str",700f,100l});
  Thread.sleep(1000);
  Assert.assertEquals(1,count);
  Assert.assertTrue(eventArrived);
  executionPlanRuntime.shutdown();
}
Program: 29049
Project: 29049
Buggy source:
@Override protected synchronized void process(ComplexEventChunk<StreamEvent> streamEventChunk,Processor nextProcessor,StreamEventCloner streamEventCloner){
  while (streamEventChunk.hasNext()) {
    long currentTime=executionPlanContext.getTimestampGenerator().currentTime();
    while (streamEventChunk.hasNext()) {
      StreamEvent streamEvent=streamEventChunk.next();
      expiredEventChunk.reset();
      while (expiredEventChunk.hasNext()) {
        StreamEvent expiredEvent=expiredEventChunk.next();
        long timeDiff=expiredEvent.getTimestamp() - currentTime + timeInMilliSeconds;
        if (timeDiff <= 0) {
          expiredEventChunk.remove();
          expiredEvent.setTimestamp(currentTime);
          streamEventChunk.insertBeforeCurrent(expiredEvent);
        }
 else {
          break;
        }
      }
      if (streamEvent.getType() == StreamEvent.Type.CURRENT) {
        StreamEvent clonedEvent=streamEventCloner.copyStreamEvent(streamEvent);
        clonedEvent.setType(StreamEvent.Type.EXPIRED);
        this.expiredEventChunk.add(clonedEvent);
        if (lastTimestamp < clonedEvent.getTimestamp()) {
          scheduler.notifyAt(clonedEvent.getTimestamp() + timeInMilliSeconds);
          lastTimestamp=clonedEvent.getTimestamp();
        }
      }
    }
    expiredEventChunk.reset();
  }
  nextProcessor.process(streamEventChunk);
}

Fixed version (ground truth):
@Override protected synchronized void process(ComplexEventChunk<StreamEvent> streamEventChunk,Processor nextProcessor,StreamEventCloner streamEventCloner){
  while (streamEventChunk.hasNext()) {
    long currentTime=executionPlanContext.getTimestampGenerator().currentTime();
    StreamEvent streamEvent=streamEventChunk.next();
    expiredEventChunk.reset();
    while (expiredEventChunk.hasNext()) {
      StreamEvent expiredEvent=expiredEventChunk.next();
      long timeDiff=expiredEvent.getTimestamp() - currentTime + timeInMilliSeconds;
      if (timeDiff <= 0) {
        expiredEventChunk.remove();
        expiredEvent.setTimestamp(currentTime);
        streamEventChunk.insertBeforeCurrent(expiredEvent);
      }
 else {
        break;
      }
    }
    if (streamEvent.getType() == StreamEvent.Type.CURRENT) {
      StreamEvent clonedEvent=streamEventCloner.copyStreamEvent(streamEvent);
      clonedEvent.setType(StreamEvent.Type.EXPIRED);
      this.expiredEventChunk.add(clonedEvent);
      if (lastTimestamp < clonedEvent.getTimestamp()) {
        scheduler.notifyAt(clonedEvent.getTimestamp() + timeInMilliSeconds);
        lastTimestamp=clonedEvent.getTimestamp();
      }
    }
    expiredEventChunk.reset();
  }
  nextProcessor.process(streamEventChunk);
}
Program: 29050
Project: 29050
Buggy source:
@Override protected synchronized void process(ComplexEventChunk<StreamEvent> streamEventChunk,Processor nextProcessor,StreamEventCloner streamEventCloner){
  long currentTime=executionPlanContext.getTimestampGenerator().currentTime();
  while (streamEventChunk.hasNext()) {
    StreamEvent streamEvent=streamEventChunk.next();
    StreamEvent clonedEvent=streamEventCloner.copyStreamEvent(streamEvent);
    clonedEvent.setType(StreamEvent.Type.EXPIRED);
    boolean eventScheduled=false;
    while (expiredEventChunk.hasNext()) {
      StreamEvent expiredEvent=expiredEventChunk.next();
      long timeDiff=expiredEvent.getTimestamp() - currentTime + timeInMilliSeconds;
      if (timeDiff <= 0) {
        expiredEventChunk.remove();
        expiredEvent.setTimestamp(currentTime);
        streamEventChunk.insertBeforeCurrent(expiredEvent);
      }
 else {
        scheduler.notifyAt(expiredEvent.getTimestamp() + timeInMilliSeconds);
        expiredEventChunk.reset();
        eventScheduled=true;
        break;
      }
    }
    if (streamEvent.getType() == StreamEvent.Type.CURRENT) {
      this.expiredEventChunk.add(clonedEvent);
      if (!eventScheduled) {
        scheduler.notifyAt(clonedEvent.getTimestamp() + timeInMilliSeconds);
      }
    }
    expiredEventChunk.reset();
  }
  nextProcessor.process(streamEventChunk);
}

Fixed version (ground truth):
@Override protected synchronized void process(ComplexEventChunk<StreamEvent> streamEventChunk,Processor nextProcessor,StreamEventCloner streamEventCloner){
  long currentTime=executionPlanContext.getTimestampGenerator().currentTime();
  while (streamEventChunk.hasNext()) {
    StreamEvent streamEvent=streamEventChunk.next();
    StreamEvent clonedEvent=streamEventCloner.copyStreamEvent(streamEvent);
    clonedEvent.setType(StreamEvent.Type.EXPIRED);
    while (expiredEventChunk.hasNext()) {
      StreamEvent expiredEvent=expiredEventChunk.next();
      long timeDiff=expiredEvent.getTimestamp() - currentTime + timeInMilliSeconds;
      if (timeDiff <= 0) {
        expiredEventChunk.remove();
        expiredEvent.setTimestamp(currentTime);
        streamEventChunk.insertBeforeCurrent(expiredEvent);
      }
 else {
        scheduler.notifyAt(expiredEvent.getTimestamp() + timeInMilliSeconds);
        expiredEventChunk.reset();
        break;
      }
    }
    if (streamEvent.getType() == StreamEvent.Type.CURRENT) {
      this.expiredEventChunk.add(clonedEvent);
      if (lastTimestamp < clonedEvent.getTimestamp()) {
        scheduler.notifyAt(clonedEvent.getTimestamp() + timeInMilliSeconds);
      }
      scheduler.notifyAt(clonedEvent.getTimestamp());
      lastTimestamp=clonedEvent.getTimestamp();
    }
    expiredEventChunk.reset();
  }
  nextProcessor.process(streamEventChunk);
}
Program: 29051
Project: 29051
Buggy source:
@Override public void stop(){
  try {
    scheduler.deleteJob(new JobKey(jobName,jobGroup));
  }
 catch (  SchedulerException e) {
    log.error("String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void stop(){
  try {
    if (scheduler != null) {
      scheduler.deleteJob(new JobKey(jobName,jobGroup));
    }
  }
 catch (  SchedulerException e) {
    log.error("String_Node_Str" + e.getMessage(),e);
  }
}
Program: 29052
Project: 29052
Buggy source:
private void scheduleCronJob(String cronString,String elementId){
  try {
    SchedulerFactory schedulerFactory=new StdSchedulerFactory();
    scheduler=schedulerFactory.getScheduler();
    scheduler.start();
    JobDataMap dataMap=new JobDataMap();
    dataMap.put("String_Node_Str",this);
    jobName="String_Node_Str" + elementId;
    JobDetail job=org.quartz.JobBuilder.newJob(CronEventTrigger.class).withIdentity(jobName,jobGroup).usingJobData(dataMap).build();
    Trigger trigger=org.quartz.TriggerBuilder.newTrigger().withIdentity("String_Node_Str" + elementId,jobGroup).withSchedule(CronScheduleBuilder.cronSchedule(cronString)).build();
    scheduler.scheduleJob(job,trigger);
  }
 catch (  SchedulerException e) {
    log.error("String_Node_Str" + triggerDefinition.getId() + "String_Node_Str"+ e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void scheduleCronJob(String cronString,String elementId){
  try {
    SchedulerFactory schedulerFactory=new StdSchedulerFactory();
    scheduler=schedulerFactory.getScheduler();
    jobName="String_Node_Str" + elementId;
    JobKey jobKey=new JobKey(jobName,jobGroup);
    if (scheduler.checkExists(jobKey)) {
      scheduler.deleteJob(jobKey);
    }
    scheduler.start();
    JobDataMap dataMap=new JobDataMap();
    dataMap.put("String_Node_Str",this);
    JobDetail job=org.quartz.JobBuilder.newJob(CronEventTrigger.class).withIdentity(jobName,jobGroup).usingJobData(dataMap).build();
    Trigger trigger=org.quartz.TriggerBuilder.newTrigger().withIdentity("String_Node_Str" + elementId,jobGroup).withSchedule(CronScheduleBuilder.cronSchedule(cronString)).build();
    scheduler.scheduleJob(job,trigger);
  }
 catch (  SchedulerException e) {
    log.error("String_Node_Str" + triggerDefinition.getId() + "String_Node_Str"+ e.getMessage(),e);
  }
}
Program: 29055
Project: 29055
Buggy source:
@Test public void testQuery1() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  TableDefinition tableDefinition=TableDefinition.id("String_Node_Str").annotation(Annotation.annotation("String_Node_Str").element("String_Node_Str","String_Node_Str")).attribute("String_Node_Str",Attribute.Type.STRING).attribute("String_Node_Str",Attribute.Type.INT);
  ExecutionPlan executionPlan=new ExecutionPlan("String_Node_Str");
  executionPlan.defineTable(tableDefinition);
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  List<String> hciNames=new ArrayList<String>();
  for (  HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
    hciNames.add(hci.getName());
  }
  Assert.assertTrue(hciNames.contains(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void testQuery1() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  TableDefinition tableDefinition=TableDefinition.id("String_Node_Str").annotation(Annotation.annotation("String_Node_Str").element("String_Node_Str","String_Node_Str")).attribute("String_Node_Str",Attribute.Type.STRING).attribute("String_Node_Str",Attribute.Type.INT);
  ExecutionPlan executionPlan=new ExecutionPlan("String_Node_Str");
  executionPlan.defineTable(tableDefinition);
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  try {
    List<String> hciNames=new ArrayList<String>();
    for (    HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
      hciNames.add(hci.getName());
    }
    Assert.assertTrue(hciNames.contains(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}
Program: 29056
Project: 29056
Buggy source:
@Test public void testQuery3() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String tables="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(tables);
  List<String> hciNames=new ArrayList<String>();
  for (  HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
    hciNames.add(hci.getName());
  }
  Assert.assertTrue(hciNames.contains(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void testQuery3() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String tables="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(tables);
  try {
    List<String> hciNames=new ArrayList<String>();
    for (    HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
      hciNames.add(hci.getName());
    }
    Assert.assertTrue(hciNames.contains(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}
Program: 29059
Project: 29059
Buggy source:
@Test public void testQuery18() throws InterruptedException {
  log.info("String_Node_Str");
  String clusterName="String_Node_Str";
  String clusterPassword="String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  String tables="String_Node_Str" + "String_Node_Str" + clusterName + "String_Node_Str"+ clusterPassword+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(tables);
  Map<String,HazelcastInstance> instanceMap=new HashMap<String,HazelcastInstance>();
  for (  HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
    instanceMap.put(hci.getName(),hci);
  }
  Assert.assertTrue(instanceMap.containsKey(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  HazelcastInstance instance=instanceMap.get(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName());
  Assert.assertEquals(clusterName,instance.getConfig().getGroupConfig().getName());
  Assert.assertEquals(clusterPassword,instance.getConfig().getGroupConfig().getPassword());
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void testQuery18() throws InterruptedException {
  log.info("String_Node_Str");
  String clusterName="String_Node_Str";
  String clusterPassword="String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  String tables="String_Node_Str" + "String_Node_Str" + clusterName + "String_Node_Str"+ clusterPassword+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(tables);
  try {
    Map<String,HazelcastInstance> instanceMap=new HashMap<String,HazelcastInstance>();
    for (    HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
      instanceMap.put(hci.getName(),hci);
    }
    Assert.assertTrue(instanceMap.containsKey(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
    HazelcastInstance instance=instanceMap.get(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName());
    Assert.assertEquals(clusterName,instance.getConfig().getGroupConfig().getName());
    Assert.assertEquals(clusterPassword,instance.getConfig().getGroupConfig().getPassword());
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}
Program: 29060
Project: 29060
Buggy source:
@Test public void testQuery6() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String tables="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(tables);
  List<String> hciNames=new ArrayList<String>();
  for (  HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
    hciNames.add(hci.getName());
  }
  Assert.assertTrue(hciNames.contains(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void testQuery6() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String tables="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(tables);
  try {
    List<String> hciNames=new ArrayList<String>();
    for (    HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
      hciNames.add(hci.getName());
    }
    Assert.assertTrue(hciNames.contains(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}
Program: 29061
Project: 29061
Buggy source:
@Test public void testQuery17() throws InterruptedException {
  log.info("String_Node_Str");
  String clusterName="String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  String tables="String_Node_Str" + "String_Node_Str" + clusterName + "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(tables);
  Map<String,HazelcastInstance> instanceMap=new HashMap<String,HazelcastInstance>();
  for (  HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
    instanceMap.put(hci.getName(),hci);
  }
  Assert.assertTrue(instanceMap.containsKey(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  HazelcastInstance instance=instanceMap.get(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName());
  Assert.assertEquals(clusterName,instance.getConfig().getGroupConfig().getName());
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void testQuery17() throws InterruptedException {
  log.info("String_Node_Str");
  String clusterName="String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  String tables="String_Node_Str" + "String_Node_Str" + clusterName + "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(tables);
  try {
    Map<String,HazelcastInstance> instanceMap=new HashMap<String,HazelcastInstance>();
    for (    HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
      instanceMap.put(hci.getName(),hci);
    }
    Assert.assertTrue(instanceMap.containsKey(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
    HazelcastInstance instance=instanceMap.get(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName());
    Assert.assertEquals(clusterName,instance.getConfig().getGroupConfig().getName());
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}