nus-yam/ex-repair huggingface dataset:
Program: 28737
Project: 28737
Buggy source:
/** 
 * @param timestamp                    the timestamp of the last event in the event chunk
 * @param updateCondition              the compiledCondition against which records should be matched for update
 * @param updateConditionParameterMaps map of matching StreamVariable Ids and their values corresponding to thecompiled condition based on which the records will be updated
 * @param updateSetExpressions         the set of updates mappings and related complied expressions
 * @param updateSetParameterMaps       map of matching StreamVariable Ids and their values corresponding to the
 * @param recordTableHandlerCallback   call back to do operations on the record table
 */
public abstract void update(long timestamp,CompiledCondition updateCondition,List<Map<String,Object>> updateConditionParameterMaps,LinkedHashMap<String,CompiledExpression> updateSetExpressions,List<Map<String,Object>> updateSetParameterMaps,RecordTableHandlerCallback recordTableHandlerCallback) throws ConnectionUnavailableException ;

Fixed version (ground truth):
/** 
 * @param timestamp                    the timestamp of the last event in the event chunk
 * @param updateCondition              the compiledCondition against which records should be matched for update
 * @param updateConditionParameterMaps map of matching StreamVariable Ids and their values corresponding to thecompiled condition based on which the records will be updated
 * @param updateSetExpressions         the set of updates mappings and related complied expressions
 * @param updateSetParameterMaps       map of matching StreamVariable Ids and their values corresponding to the
 * @param recordTableHandlerCallback   call back to do operations on the record table
 * @throws ConnectionUnavailableException
 */
public abstract void update(long timestamp,CompiledCondition updateCondition,List<Map<String,Object>> updateConditionParameterMaps,LinkedHashMap<String,CompiledExpression> updateSetExpressions,List<Map<String,Object>> updateSetParameterMaps,RecordTableHandlerCallback recordTableHandlerCallback) throws ConnectionUnavailableException ;
Program: 28738
Project: 28738
Buggy source:
/** 
 * @param timestamp                    the timestamp of the last event in the event chunk
 * @param updateCondition              the compiledCondition against which records should be matched for update
 * @param updateConditionParameterMaps map of matching StreamVariable Ids and their values corresponding to thecompiled condition based on which the records will be updated
 * @param updateSetExpressions         the set of updates mappings and related complied expressions
 * @param updateSetParameterMaps       map of matching StreamVariable Ids and their values corresponding to theupdate set
 * @param addingRecords                the values for adding new records if the update condition did not match
 * @param recordTableHandlerCallback   call back to do operations on the record table
 */
public abstract void updateOrAdd(long timestamp,CompiledCondition updateCondition,List<Map<String,Object>> updateConditionParameterMaps,LinkedHashMap<String,CompiledExpression> updateSetExpressions,List<Map<String,Object>> updateSetParameterMaps,List<Object[]> addingRecords,RecordTableHandlerCallback recordTableHandlerCallback) throws ConnectionUnavailableException ;

Fixed version (ground truth):
/** 
 * @param timestamp                    the timestamp of the last event in the event chunk
 * @param updateCondition              the compiledCondition against which records should be matched for update
 * @param updateConditionParameterMaps map of matching StreamVariable Ids and their values corresponding to thecompiled condition based on which the records will be updated
 * @param updateSetExpressions         the set of updates mappings and related complied expressions
 * @param updateSetParameterMaps       map of matching StreamVariable Ids and their values corresponding to theupdate set
 * @param addingRecords                the values for adding new records if the update condition did not match
 * @param recordTableHandlerCallback   call back to do operations on the record table
 * @throws ConnectionUnavailableException
 */
public abstract void updateOrAdd(long timestamp,CompiledCondition updateCondition,List<Map<String,Object>> updateConditionParameterMaps,LinkedHashMap<String,CompiledExpression> updateSetExpressions,List<Map<String,Object>> updateSetParameterMaps,List<Object[]> addingRecords,RecordTableHandlerCallback recordTableHandlerCallback) throws ConnectionUnavailableException ;
Program: 28739
Project: 28739
Buggy source:
/** 
 * @param timestamp                    the timestamp of the last event in the event chunk
 * @param deleteConditionParameterMaps map of matching StreamVariable Ids and their values corresponding to thecompiled condition
 * @param compiledCondition            the compiledCondition against which records should be matched for deletion
 * @param recordTableHandlerCallback   call back to do operations on the record table
 */
public abstract void delete(long timestamp,List<Map<String,Object>> deleteConditionParameterMaps,CompiledCondition compiledCondition,RecordTableHandlerCallback recordTableHandlerCallback) throws ConnectionUnavailableException ;

Fixed version (ground truth):
/** 
 * @param timestamp                    the timestamp of the last event in the event chunk
 * @param deleteConditionParameterMaps map of matching StreamVariable Ids and their values corresponding to thecompiled condition
 * @param compiledCondition            the compiledCondition against which records should be matched for deletion
 * @param recordTableHandlerCallback   call back to do operations on the record table
 * @throws ConnectionUnavailableException
 */
public abstract void delete(long timestamp,List<Map<String,Object>> deleteConditionParameterMaps,CompiledCondition compiledCondition,RecordTableHandlerCallback recordTableHandlerCallback) throws ConnectionUnavailableException ;
Program: 28744
Project: 28744
Buggy source:
/** 
 * @param eventBufferHolder
 * @return Name of the buffered event tracker.
 */
String getName(EventBufferHolder eventBufferHolder);

Fixed version (ground truth):
/** 
 * @param eventBufferHolder Event Buffer holder
 * @return Name of the buffered event tracker.
 */
String getName(EventBufferHolder eventBufferHolder);
Program: 28745
Project: 28745
Buggy source:
private Event[] executeSelector(StreamEvent streamEvents,MetaStreamEvent.EventType eventType){
  ComplexEventChunk<StateEvent> complexEventChunk=new ComplexEventChunk<>(true);
  while (streamEvents != null) {
    StateEvent stateEvent=stateEventPool.borrowEvent();
    if (eventType == MetaStreamEvent.EventType.AGGREGATE) {
      stateEvent.addEvent(1,streamEvents);
    }
 else {
      stateEvent.addEvent(0,streamEvents);
    }
    complexEventChunk.add(stateEvent);
    streamEvents=streamEvents.getNext();
  }
  ComplexEventChunk outputComplexEventChunk=selector.execute(complexEventChunk);
  if (outputComplexEventChunk != null) {
    List<Event> events=new ArrayList<>();
    outputComplexEventChunk.reset();
    while (outputComplexEventChunk.hasNext()) {
      ComplexEvent complexEvent=outputComplexEventChunk.next();
      events.add(new Event(complexEvent.getTimestamp(),complexEvent.getOutputData()));
    }
    return events.toArray(new Event[0]);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private Event[] executeSelector(StreamEvent streamEvents,MetaStreamEvent.EventType eventType){
  ComplexEventChunk<StateEvent> complexEventChunk=new ComplexEventChunk<>(true);
  while (streamEvents != null) {
    StreamEvent streamEvent=streamEvents;
    streamEvents=streamEvents.getNext();
    streamEvent.setNext(null);
    StateEvent stateEvent=stateEventPool.borrowEvent();
    if (eventType == MetaStreamEvent.EventType.AGGREGATE) {
      stateEvent.addEvent(1,streamEvent);
    }
 else {
      stateEvent.addEvent(0,streamEvent);
    }
    complexEventChunk.add(stateEvent);
  }
  ComplexEventChunk outputComplexEventChunk=selector.execute(complexEventChunk);
  if (outputComplexEventChunk != null) {
    List<Event> events=new ArrayList<>();
    outputComplexEventChunk.reset();
    while (outputComplexEventChunk.hasNext()) {
      ComplexEvent complexEvent=outputComplexEventChunk.next();
      events.add(new Event(complexEvent.getTimestamp(),complexEvent.getOutputData()));
    }
    return events.toArray(new Event[0]);
  }
 else {
    return null;
  }
}
Program: 28748
Project: 28748
Buggy source:
private void orderEventChunk(ComplexEventChunk complexEventChunk){
  complexEventChunk.reset();
  List<ComplexEvent> eventList=new ArrayList<>();
  while (complexEventChunk.hasNext()) {
    ComplexEvent event=complexEventChunk.next();
    complexEventChunk.remove();
    eventList.add(event);
  }
  complexEventChunk.clear();
  eventList.sort(orderByEventComparator);
  for (  ComplexEvent complexEvent : eventList) {
    complexEventChunk.add(complexEvent);
  }
}

Fixed version (ground truth):
private void orderEventChunk(ComplexEventChunk complexEventChunk){
  ComplexEventChunk orderingComplexEventChunk=new ComplexEventChunk(complexEventChunk.isBatch());
  List<ComplexEvent> eventList=new ArrayList<>();
  ComplexEvent.Type currentEventType=null;
  complexEventChunk.reset();
  if (complexEventChunk.getFirst() != null) {
    currentEventType=complexEventChunk.getFirst().getType();
    while (complexEventChunk.hasNext()) {
      ComplexEvent event=complexEventChunk.next();
      complexEventChunk.remove();
      if (currentEventType == event.getType()) {
        eventList.add(event);
      }
 else {
        currentEventType=event.getType();
        eventList.sort(orderByEventComparator);
        for (        ComplexEvent complexEvent : eventList) {
          orderingComplexEventChunk.add(complexEvent);
        }
        eventList.clear();
        eventList.add(event);
      }
    }
    eventList.sort(orderByEventComparator);
    for (    ComplexEvent complexEvent : eventList) {
      orderingComplexEventChunk.add(complexEvent);
    }
    complexEventChunk.clear();
    complexEventChunk.add(orderingComplexEventChunk.getFirst());
  }
}
Program: 28749
Project: 28749
Buggy source:
private ComplexEventChunk processNoGroupBy(ComplexEventChunk complexEventChunk){
  if (isOrderBy) {
    orderEventChunk(complexEventChunk);
  }
  complexEventChunk.reset();
synchronized (this) {
    long limitCount=0;
    while (complexEventChunk.hasNext()) {
      ComplexEvent event=complexEventChunk.next();
switch (event.getType()) {
case CURRENT:
case EXPIRED:
        eventPopulator.populateStateEvent(event);
      for (      AttributeProcessor attributeProcessor : attributeProcessorList) {
        attributeProcessor.process(event);
      }
    if (((event.getType() != StreamEvent.Type.CURRENT || !currentOn) && (event.getType() != StreamEvent.Type.EXPIRED || !expiredOn)) || ((havingConditionExecutor != null && !havingConditionExecutor.execute(event)))) {
      complexEventChunk.remove();
    }
 else {
      if (limit != SiddhiConstants.UNKNOWN_STATE) {
        if (limitCount >= limit) {
          complexEventChunk.remove();
        }
 else {
          limitCount++;
        }
      }
    }
  break;
case RESET:
for (AttributeProcessor attributeProcessor : attributeProcessorList) {
  attributeProcessor.process(event);
}
break;
case TIMER:
complexEventChunk.remove();
break;
}
}
}
complexEventChunk.reset();
if (complexEventChunk.hasNext()) {
return complexEventChunk;
}
return null;
}

Fixed version (ground truth):
private ComplexEventChunk processNoGroupBy(ComplexEventChunk complexEventChunk){
  complexEventChunk.reset();
synchronized (this) {
    while (complexEventChunk.hasNext()) {
      ComplexEvent event=complexEventChunk.next();
switch (event.getType()) {
case CURRENT:
case EXPIRED:
        eventPopulator.populateStateEvent(event);
      for (      AttributeProcessor attributeProcessor : attributeProcessorList) {
        attributeProcessor.process(event);
      }
    if (((event.getType() != StreamEvent.Type.CURRENT || !currentOn) && (event.getType() != StreamEvent.Type.EXPIRED || !expiredOn)) || ((havingConditionExecutor != null && !havingConditionExecutor.execute(event)))) {
      complexEventChunk.remove();
    }
  break;
case RESET:
for (AttributeProcessor attributeProcessor : attributeProcessorList) {
  attributeProcessor.process(event);
}
break;
case TIMER:
complexEventChunk.remove();
break;
}
}
}
if (isOrderBy) {
orderEventChunk(complexEventChunk);
}
if (limit != SiddhiConstants.UNKNOWN_STATE) {
limitEventChunk(complexEventChunk);
}
complexEventChunk.reset();
if (complexEventChunk.hasNext()) {
return complexEventChunk;
}
return null;
}
Program: 28750
Project: 28750
Buggy source:
@Override public void init(TableDefinition tableDefinition,StreamEventPool storeEventPool,StreamEventCloner storeEventCloner,ConfigReader configReader,SiddhiAppContext siddhiAppContext,RecordTableHandler recordTableHandler){
  this.tableDefinition=tableDefinition;
  this.tableStreamEventCloner=storeEventCloner;
  eventHolder=EventHolderPasser.parse(tableDefinition,storeEventPool);
  if (elementId == null) {
    elementId="String_Node_Str" + siddhiAppContext.getElementIdGenerator().createNewId();
  }
  siddhiAppContext.getSnapshotService().addSnapshotable(tableDefinition.getId(),this);
}

Fixed version (ground truth):
@Override public void init(TableDefinition tableDefinition,StreamEventPool storeEventPool,StreamEventCloner storeEventCloner,ConfigReader configReader,SiddhiAppContext siddhiAppContext,RecordTableHandler recordTableHandler){
  this.tableDefinition=tableDefinition;
  this.tableStreamEventCloner=storeEventCloner;
  eventHolder=EventHolderPasser.parse(tableDefinition,storeEventPool,siddhiAppContext);
  if (elementId == null) {
    elementId="String_Node_Str" + siddhiAppContext.getElementIdGenerator().createNewId();
  }
  siddhiAppContext.getSnapshotService().addSnapshotable(tableDefinition.getId(),this);
}
Program: 28751
Project: 28751
Buggy source:
private void add(StreamEvent streamEvent){
  StreamEvent existingValue=null;
  if (primaryKeyData != null) {
    Object primaryKey=constructPrimaryKey(streamEvent,primaryKeyReferenceHolders);
    existingValue=primaryKeyData.putIfAbsent(primaryKey,streamEvent);
    if (existingValue != null) {
      log.error("String_Node_Str" + streamEvent + "String_Node_Str"+ "String_Node_Str"+ primaryKey+ "String_Node_Str");
    }
  }
  if (indexData != null) {
    for (    Map.Entry<String,Integer> indexEntry : indexMetaData.entrySet()) {
      TreeMap<Object,Set<StreamEvent>> indexMap=indexData.get(indexEntry.getKey());
      Object key=streamEvent.getOutputData()[indexEntry.getValue()];
      Set<StreamEvent> values=indexMap.get(key);
      if (values == null) {
        values=new HashSet<StreamEvent>();
        values.add(streamEvent);
        indexMap.put(streamEvent.getOutputData()[indexEntry.getValue()],values);
      }
 else {
        values.add(streamEvent);
      }
    }
  }
}

Fixed version (ground truth):
private void add(StreamEvent streamEvent){
  StreamEvent existingValue=null;
  if (primaryKeyData != null) {
    Object primaryKey=constructPrimaryKey(streamEvent,primaryKeyReferenceHolders);
    existingValue=primaryKeyData.putIfAbsent(primaryKey,streamEvent);
    if (existingValue != null) {
      log.error("String_Node_Str" + siddhiAppName + "String_Node_Str"+ tableName+ "String_Node_Str"+ streamEvent+ "String_Node_Str"+ primaryKey+ "String_Node_Str");
    }
  }
  if (indexData != null) {
    for (    Map.Entry<String,Integer> indexEntry : indexMetaData.entrySet()) {
      TreeMap<Object,Set<StreamEvent>> indexMap=indexData.get(indexEntry.getKey());
      Object key=streamEvent.getOutputData()[indexEntry.getValue()];
      Set<StreamEvent> values=indexMap.get(key);
      if (values == null) {
        values=new HashSet<StreamEvent>();
        values.add(streamEvent);
        indexMap.put(streamEvent.getOutputData()[indexEntry.getValue()],values);
      }
 else {
        values.add(streamEvent);
      }
    }
  }
}
Program: 28754
Project: 28754
Buggy source:
private Event[] executeSelector(StreamEvent streamEvents,MetaStreamEvent.EventType eventType){
  ComplexEventChunk<StateEvent> complexEventChunk=new ComplexEventChunk<StateEvent>(true);
  while (streamEvents != null) {
    StateEvent stateEvent=stateEventPool.borrowEvent();
    stateEvent.addEvent(0,streamEvents);
    complexEventChunk.add(stateEvent);
    streamEvents=streamEvents.getNext();
  }
  ComplexEventChunk outputComplexEventChunk=selector.execute(complexEventChunk);
  if (outputComplexEventChunk != null) {
    List<Event> events=new ArrayList<>();
    outputComplexEventChunk.reset();
    while (outputComplexEventChunk.hasNext()) {
      ComplexEvent complexEvent=outputComplexEventChunk.next();
      if (eventType != MetaStreamEvent.EventType.AGGREGATE) {
        events.add(new Event(complexEvent.getTimestamp(),complexEvent.getOutputData()));
      }
 else {
        events.add(new Event(complexEvent.getTimestamp(),((StateEvent)complexEvent).getStreamEvent(0).getOutputData()));
      }
    }
    return events.toArray(new Event[0]);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private Event[] executeSelector(StreamEvent streamEvents,MetaStreamEvent.EventType eventType){
  ComplexEventChunk<StateEvent> complexEventChunk=new ComplexEventChunk<>(true);
  while (streamEvents != null) {
    StateEvent stateEvent=stateEventPool.borrowEvent();
    if (eventType == MetaStreamEvent.EventType.AGGREGATE) {
      stateEvent.addEvent(1,streamEvents);
    }
 else {
      stateEvent.addEvent(0,streamEvents);
    }
    complexEventChunk.add(stateEvent);
    streamEvents=streamEvents.getNext();
  }
  ComplexEventChunk outputComplexEventChunk=selector.execute(complexEventChunk);
  if (outputComplexEventChunk != null) {
    List<Event> events=new ArrayList<>();
    outputComplexEventChunk.reset();
    while (outputComplexEventChunk.hasNext()) {
      ComplexEvent complexEvent=outputComplexEventChunk.next();
      events.add(new Event(complexEvent.getTimestamp(),complexEvent.getOutputData()));
    }
    return events.toArray(new Event[0]);
  }
 else {
    return null;
  }
}
Program: 28758
Project: 28758
Buggy source:
private static void populateStoreQueryRuntime(StoreQueryRuntime storeQueryRuntime,MatchingMetaInfoHolder metaStreamInfoHolder,Selector selector,List<VariableExpressionExecutor> variableExpressionExecutors,SiddhiAppContext siddhiAppContext,Map<String,Table> tableMap,String queryName){
  QuerySelector querySelector=SelectorParser.parse(selector,new ReturnStream(OutputStream.OutputEventType.CURRENT_EVENTS),siddhiAppContext,metaStreamInfoHolder.getMetaStateEvent(),tableMap,variableExpressionExecutors,queryName);
  QueryParserHelper.reduceMetaComplexEvent(metaStreamInfoHolder.getMetaStateEvent());
  QueryParserHelper.updateVariablePosition(metaStreamInfoHolder.getMetaStateEvent(),variableExpressionExecutors);
  querySelector.setEventPopulator(StateEventPopulatorFactory.constructEventPopulator(metaStreamInfoHolder.getMetaStateEvent()));
  storeQueryRuntime.setStateEventPool(new StateEventPool(metaStreamInfoHolder.getMetaStateEvent(),5));
  storeQueryRuntime.setSelector(querySelector);
}

Fixed version (ground truth):
private static void populateStoreQueryRuntime(StoreQueryRuntime storeQueryRuntime,MatchingMetaInfoHolder metaStreamInfoHolder,Selector selector,List<VariableExpressionExecutor> variableExpressionExecutors,SiddhiAppContext siddhiAppContext,Map<String,Table> tableMap,String queryName,int metaPosition){
  QuerySelector querySelector=SelectorParser.parse(selector,new ReturnStream(OutputStream.OutputEventType.CURRENT_EVENTS),siddhiAppContext,metaStreamInfoHolder.getMetaStateEvent(),tableMap,variableExpressionExecutors,queryName,metaPosition);
  QueryParserHelper.reduceMetaComplexEvent(metaStreamInfoHolder.getMetaStateEvent());
  QueryParserHelper.updateVariablePosition(metaStreamInfoHolder.getMetaStateEvent(),variableExpressionExecutors);
  querySelector.setEventPopulator(StateEventPopulatorFactory.constructEventPopulator(metaStreamInfoHolder.getMetaStateEvent()));
  storeQueryRuntime.setStateEventPool(new StateEventPool(metaStreamInfoHolder.getMetaStateEvent(),5));
  storeQueryRuntime.setSelector(querySelector);
}
Program: 28760
Project: 28760
Buggy source:
@Override public void publish(Object payload,DynamicOptions dynamicOptions) throws ConnectionUnavailableException {
  System.out.println(payload + "String_Node_Str" + failOnce);
  if (fail || failOnce) {
    failOnce=false;
    numberOfErrorOccurred++;
    throw new ConnectionUnavailableException("String_Node_Str");
  }
  super.publish(payload,dynamicOptions);
}

Fixed version (ground truth):
@Override public void publish(Object payload,DynamicOptions dynamicOptions) throws ConnectionUnavailableException {
  if (fail || failOnce) {
    failOnce=false;
    numberOfErrorOccurred++;
    throw new ConnectionUnavailableException("String_Node_Str");
  }
  super.publish(payload,dynamicOptions);
}
Program: 28761
Project: 28761
Buggy source:
@Override public void publish(Object payload,DynamicOptions dynamicOptions) throws ConnectionUnavailableException {
  System.out.println(payload + "String_Node_Str" + failOnce);
  if (fail || failOnce) {
    failOnce=false;
    numberOfErrorOccurred++;
    throw new ConnectionUnavailableException("String_Node_Str");
  }
  super.publish(payload,dynamicOptions);
}

Fixed version (ground truth):
@Override public void publish(Object payload,DynamicOptions dynamicOptions) throws ConnectionUnavailableException {
  if (fail || failOnce) {
    failOnce=false;
    numberOfErrorOccurred++;
    throw new ConnectionUnavailableException("String_Node_Str");
  }
  super.publish(payload,dynamicOptions);
}
Program: 28762
Project: 28762
Buggy source:
private void monitorQueryMemoryUsage(){
  memoryUsageTracker=siddhiAppContext.getSiddhiContext().getStatisticsConfiguration().getFactory().createMemoryUsageTracker(siddhiAppContext.getStatisticsManager());
  for (  Map.Entry entry : queryProcessorMap.entrySet()) {
    registerForMemoryUsage(entry);
  }
  for (  Map.Entry entry : partitionMap.entrySet()) {
    ConcurrentMap<String,QueryRuntime> queryRuntime=((PartitionRuntime)entry.getValue()).getMetaQueryRuntimeMap();
    for (    Map.Entry queryEntry : queryRuntime.entrySet()) {
      registerForMemoryUsage(queryEntry);
    }
  }
}

Fixed version (ground truth):
private void monitorQueryMemoryUsage(){
  memoryUsageTracker=siddhiAppContext.getSiddhiContext().getStatisticsConfiguration().getFactory().createMemoryUsageTracker(siddhiAppContext.getStatisticsManager());
  for (  Map.Entry<String,QueryRuntime> entry : queryProcessorMap.entrySet()) {
    QueryParserHelper.registerMemoryUsageTracking(entry.getKey(),entry.getValue(),SiddhiConstants.METRIC_INFIX_QUERIES,siddhiAppContext,memoryUsageTracker);
  }
  for (  PartitionRuntime partitionRuntime : partitionMap.values()) {
    partitionRuntime.setMemoryUsageTracker(memoryUsageTracker);
  }
  for (  Map.Entry<String,Table> entry : tableMap.entrySet()) {
    QueryParserHelper.registerMemoryUsageTracking(entry.getKey(),entry.getValue(),SiddhiConstants.METRIC_INFIX_TABLES,siddhiAppContext,memoryUsageTracker);
  }
  for (  Map.Entry<String,Window> entry : windowMap.entrySet()) {
    QueryParserHelper.registerMemoryUsageTracking(entry.getKey(),entry.getValue(),SiddhiConstants.METRIC_INFIX_WINDOWS,siddhiAppContext,memoryUsageTracker);
  }
  for (  Map.Entry<String,AggregationRuntime> entry : aggregationMap.entrySet()) {
    QueryParserHelper.registerMemoryUsageTracking(entry.getKey(),entry.getValue(),SiddhiConstants.METRIC_INFIX_AGGREGATIONS,siddhiAppContext,memoryUsageTracker);
  }
}
Program: 28764
Project: 28764
Buggy source:
public abstract void publish(Object payload,DynamicOptions transportOptions,int destinationId) throws ConnectionUnavailableException ;

Fixed version (ground truth):
public abstract void publish(Object payload,DynamicOptions transportOptions,Integer destinationId) throws ConnectionUnavailableException ;
Program: 28765
Project: 28765
Buggy source:
/** 
 * Remove a given destination from available set of destination IDs. Once this method is called for a given destination ID, that particular destination ID will not included in the return value of subsequent getDestinationsToPublish() is calls
 * @param destinationId the ID of the destination to be removed
 */
public void destinationFailed(int destinationId){
  destinationIds.remove(destinationId);
}

Fixed version (ground truth):
/** 
 * Remove a given destination from available set of destination IDs. Once this method is called for a given destination ID, that particular destination ID will not included in the return value of subsequent getDestinationsToPublish() is calls
 * @param destinationId the ID of the destination to be removed
 */
public void destinationFailed(Integer destinationId){
  destinationIds.remove(destinationId);
}
Program: 28766
Project: 28766
Buggy source:
@Override public void publish(Object payload,DynamicOptions transportOptions,int destinationId) throws ConnectionUnavailableException {
  try {
    Sink transport=transports.get(destinationId);
    transport.publish(payload,transportOptions);
  }
 catch (  ConnectionUnavailableException e) {
    strategy.destinationFailed(destinationId);
    log.warn("String_Node_Str" + destinationId);
    throw e;
  }
}

Fixed version (ground truth):
@Override public void publish(Object payload,DynamicOptions transportOptions,Integer destinationId) throws ConnectionUnavailableException {
  try {
    Sink transport=transports.get(destinationId);
    transport.publish(payload,transportOptions);
  }
 catch (  ConnectionUnavailableException e) {
    strategy.destinationFailed(destinationId);
    log.warn("String_Node_Str" + destinationId);
    throw e;
  }
}
Program: 28767
Project: 28767
Buggy source:
@Override public void publish(Object payload,DynamicOptions transportOptions,int destinationId) throws ConnectionUnavailableException {
  try {
    transportOptions.setVariableOptionIndex(destinationId);
    sink.publish(payload,transportOptions);
  }
 catch (  ConnectionUnavailableException e) {
    strategy.destinationFailed(destinationId);
    throw e;
  }
}

Fixed version (ground truth):
@Override public void publish(Object payload,DynamicOptions transportOptions,Integer destinationId) throws ConnectionUnavailableException {
  try {
    transportOptions.setVariableOptionIndex(destinationId);
    sink.publish(payload,transportOptions);
  }
 catch (  ConnectionUnavailableException e) {
    strategy.destinationFailed(destinationId);
    throw e;
  }
}
Program: 28770
Project: 28770
Buggy source:
@Override public CompiledCondition cloneCompiledCondition(String key){
  Map<TimePeriod.Duration,CompiledCondition> copyOfWithinTableCompiledConditions=new HashMap<>();
  for (  Map.Entry<TimePeriod.Duration,CompiledCondition> entry : withinTableCompiledConditions.entrySet()) {
    copyOfWithinTableCompiledConditions.put(entry.getKey(),entry.getValue().cloneCompiledCondition(key));
  }
  return new IncrementalAggregateCompileCondition(copyOfWithinTableCompiledConditions,inMemoryStoreCompileCondition.cloneCompiledCondition(key),onCompiledCondition.cloneCompiledCondition(key),tableMetaStreamEvent,aggregateMetaStreamEvent,metaStreamArraySizes);
}

Fixed version (ground truth):
@Override public CompiledCondition cloneCompiledCondition(String key){
  Map<TimePeriod.Duration,CompiledCondition> copyOfWithinTableCompiledConditions=new HashMap<>();
  for (  Map.Entry<TimePeriod.Duration,CompiledCondition> entry : withinTableCompiledConditions.entrySet()) {
    copyOfWithinTableCompiledConditions.put(entry.getKey(),entry.getValue().cloneCompiledCondition(key));
  }
  return new IncrementalAggregateCompileCondition(copyOfWithinTableCompiledConditions,inMemoryStoreCompileCondition.cloneCompiledCondition(key),onCompiledCondition.cloneCompiledCondition(key),tableMetaStreamEvent,aggregateMetaStreamEvent);
}
Program: 28772
Project: 28772
Buggy source:
public IncrementalAggregateCompileCondition(Map<TimePeriod.Duration,CompiledCondition> withinTableCompiledConditions,CompiledCondition inMemoryStoreCompileCondition,CompiledCondition onCompiledCondition,MetaStreamEvent tableMetaStreamEvent,MetaStreamEvent aggregateMetaSteamEvent,int[] metaStreamArraySizes){
  this.withinTableCompiledConditions=withinTableCompiledConditions;
  this.inMemoryStoreCompileCondition=inMemoryStoreCompileCondition;
  this.onCompiledCondition=onCompiledCondition;
  this.tableMetaStreamEvent=tableMetaStreamEvent;
  this.aggregateMetaStreamEvent=aggregateMetaSteamEvent;
  this.streamEventPoolForTableMeta=new StreamEventPool(tableMetaStreamEvent,10);
  this.tableEventCloner=new StreamEventCloner(tableMetaStreamEvent,streamEventPoolForTableMeta);
  this.streamEventPoolForAggregateMeta=new StreamEventPool(aggregateMetaSteamEvent,10);
  this.aggregateEventCloner=new StreamEventCloner(aggregateMetaSteamEvent,streamEventPoolForAggregateMeta);
  this.metaStreamArraySizes=metaStreamArraySizes;
}

Fixed version (ground truth):
public IncrementalAggregateCompileCondition(Map<TimePeriod.Duration,CompiledCondition> withinTableCompiledConditions,CompiledCondition inMemoryStoreCompileCondition,CompiledCondition onCompiledCondition,MetaStreamEvent tableMetaStreamEvent,MetaStreamEvent aggregateMetaSteamEvent){
  this.withinTableCompiledConditions=withinTableCompiledConditions;
  this.inMemoryStoreCompileCondition=inMemoryStoreCompileCondition;
  this.onCompiledCondition=onCompiledCondition;
  this.tableMetaStreamEvent=tableMetaStreamEvent;
  this.aggregateMetaStreamEvent=aggregateMetaSteamEvent;
  this.streamEventPoolForTableMeta=new StreamEventPool(tableMetaStreamEvent,10);
  this.tableEventCloner=new StreamEventCloner(tableMetaStreamEvent,streamEventPoolForTableMeta);
  this.streamEventPoolForAggregateMeta=new StreamEventPool(aggregateMetaSteamEvent,10);
  this.aggregateEventCloner=new StreamEventCloner(aggregateMetaSteamEvent,streamEventPoolForAggregateMeta);
}
Program: 28774
Project: 28774
Buggy source:
public StreamEvent find(StateEvent matchingEvent,CompiledCondition compiledCondition){
  String perValueAsString=perExpressionExecutor.execute(matchingEvent).toString();
  TimePeriod.Duration perValue=TimePeriod.Duration.valueOf(perValueAsString.toUpperCase());
  if (!incrementalExecutorMap.keySet().contains(perValue)) {
    throw new SiddhiAppRuntimeException("String_Node_Str" + perValue.toString() + "String_Node_Str"+ aggregationDefinition.getId()+ "String_Node_Str"+ perValue.toString()+ "String_Node_Str");
  }
  Table tableForPerDuration=aggregationTables.get(perValue);
  return ((IncrementalAggregateCompileCondition)compiledCondition).find(matchingEvent,perValue,incrementalExecutorMap,incrementalDurations,tableForPerDuration,baseExecutors,timestampExecutor,outputExpressionExecutors);
}

Fixed version (ground truth):
public StreamEvent find(StateEvent matchingEvent,CompiledCondition compiledCondition){
  String perValueAsString=perExpressionExecutor.execute(matchingEvent).toString();
  TimePeriod.Duration perValue=TimePeriod.Duration.valueOf(perValueAsString.toUpperCase());
  if (!incrementalExecutorMap.keySet().contains(perValue)) {
    throw new SiddhiAppRuntimeException("String_Node_Str" + perValue.toString() + "String_Node_Str"+ aggregationDefinition.getId()+ "String_Node_Str"+ perValue.toString()+ "String_Node_Str");
  }
  Table tableForPerDuration=aggregationTables.get(perValue);
  Long[] startTimeEndTime=(Long[])startTimeEndTimeExpressionExecutor.execute(matchingEvent);
  return ((IncrementalAggregateCompileCondition)compiledCondition).find(matchingEvent,perValue,incrementalExecutorMap,incrementalDurations,tableForPerDuration,baseExecutors,timestampExecutor,outputExpressionExecutors,startTimeEndTime);
}
Program: 28776
Project: 28776
Buggy source:
@Override public void process(ComplexEventChunk complexEventChunk){
  complexEventChunk.reset();
  while (complexEventChunk.hasNext()) {
    ComplexEvent complexEvent=complexEventChunk.next();
    if (!(Boolean)conditionExecutor.execute(complexEvent)) {
      complexEventChunk.remove();
    }
  }
  if (complexEventChunk.getFirst() != null) {
    this.next.process(complexEventChunk);
  }
}

Fixed version (ground truth):
@Override public void process(ComplexEventChunk complexEventChunk){
  complexEventChunk.reset();
  while (complexEventChunk.hasNext()) {
    ComplexEvent complexEvent=complexEventChunk.next();
    Object result=conditionExecutor.execute(complexEvent);
    if (result == null || !(Boolean)result) {
      complexEventChunk.remove();
    }
  }
  if (complexEventChunk.getFirst() != null) {
    this.next.process(complexEventChunk);
  }
}
Program: 28777
Project: 28777
Buggy source:
@Override public void process(ComplexEventChunk complexEventChunk){
  complexEventChunk.reset();
  while (complexEventChunk.hasNext()) {
    ComplexEvent complexEvent=complexEventChunk.next();
    if (!(Boolean)conditionExecutor.execute(complexEvent)) {
      complexEventChunk.remove();
    }
  }
  if (complexEventChunk.getFirst() != null) {
    this.next.process(complexEventChunk);
  }
}

Fixed version (ground truth):
@Override public void process(ComplexEventChunk complexEventChunk){
  complexEventChunk.reset();
  while (complexEventChunk.hasNext()) {
    ComplexEvent complexEvent=complexEventChunk.next();
    Object result=conditionExecutor.execute(complexEvent);
    if (result == null || !(Boolean)result) {
      complexEventChunk.remove();
    }
  }
  if (complexEventChunk.getFirst() != null) {
    this.next.process(complexEventChunk);
  }
}
Program: 28778
Project: 28778
Buggy source:
/** 
 * Adding extensions to Siddhi siddhiExtensionsMap
 * @param extensionClass      extension class
 * @param siddhiExtensionsMap reference map for the Siddhi extension
 */
private static void addExtensionToMap(Class extensionClass,Map<String,Class> siddhiExtensionsMap){
  Extension siddhiExtensionAnnotation=(Extension)extensionClass.getAnnotation(Extension.class);
  if (siddhiExtensionAnnotation != null) {
    if (!siddhiExtensionAnnotation.name().isEmpty()) {
      Class previousClass=null;
      if (!siddhiExtensionAnnotation.namespace().isEmpty()) {
        String key=siddhiExtensionAnnotation.namespace() + SiddhiConstants.EXTENSION_SEPARATOR + siddhiExtensionAnnotation.name();
        Class existingValue=siddhiExtensionsMap.get(key);
        if (existingValue == null) {
          previousClass=siddhiExtensionsMap.put(key,extensionClass);
        }
        if (previousClass != null) {
          log.warn("String_Node_Str" + extensionClass + "String_Node_Str"+ previousClass+ "String_Node_Str"+ "String_Node_Str"+ siddhiExtensionAnnotation.namespace()+ SiddhiConstants.EXTENSION_SEPARATOR+ siddhiExtensionAnnotation.name()+ "String_Node_Str");
        }
      }
 else {
        previousClass=siddhiExtensionsMap.put(siddhiExtensionAnnotation.name(),extensionClass);
        if (previousClass != null) {
          log.warn("String_Node_Str" + extensionClass + "String_Node_Str"+ previousClass+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ siddhiExtensionAnnotation.name()+ "String_Node_Str");
        }
      }
    }
 else {
      log.error("String_Node_Str" + extensionClass.getName() + "String_Node_Str");
    }
  }
 else {
    log.error("String_Node_Str" + extensionClass.getName() + "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Adding extensions to Siddhi siddhiExtensionsMap
 * @param fqExtensionName     fully qualified extension name (namespace:extensionName or extensionName)
 * @param extensionClass      extension class
 * @param siddhiExtensionsMap reference map for the Siddhi extension
 */
private static void addExtensionToMap(String fqExtensionName,Class extensionClass,Map<String,Class> siddhiExtensionsMap){
  Class previousClass=null;
  Class existingValue=siddhiExtensionsMap.get(fqExtensionName);
  if (existingValue == null) {
    previousClass=siddhiExtensionsMap.put(fqExtensionName,extensionClass);
  }
  if (previousClass != null) {
    log.warn("String_Node_Str" + extensionClass + "String_Node_Str"+ previousClass+ "String_Node_Str"+ "String_Node_Str"+ fqExtensionName+ "String_Node_Str");
  }
}
Program: 28779
Project: 28779
Buggy source:
/** 
 * Load Siddhi extensions in java non OSGi environment
 * @param siddhiExtensionsMap reference map for the Siddhi extension
 */
private static void loadLocalExtensions(Map<String,Class> siddhiExtensionsMap){
  Iterable<Class<?>> extensions=ClassIndex.getAnnotated(Extension.class);
  for (  Class extension : extensions) {
    addExtensionToMap(extension,siddhiExtensionsMap);
  }
}

Fixed version (ground truth):
/** 
 * Load Siddhi extensions in java non OSGi environment
 * @param siddhiExtensionsMap reference map for the Siddhi extension
 */
private static void loadLocalExtensions(Map<String,Class> siddhiExtensionsMap){
  Iterable<Class<?>> extensions=ClassIndex.getAnnotated(Extension.class);
  for (  Class extension : extensions) {
    addExtensionToMap(extension,siddhiExtensionsMap);
  }
  addExtensionToMap("String_Node_Str",IncrementalWithinTimeFunctionExecutor.class,siddhiExtensionsMap);
  addExtensionToMap("String_Node_Str",IncrementalUnixTimeFunctionExecutor.class,siddhiExtensionsMap);
  addExtensionToMap("String_Node_Str",IncrementalTimeGetTimeZone.class,siddhiExtensionsMap);
}
Program: 28780
Project: 28780
Buggy source:
/** 
 * This is the activation method of SiddhiManagerService. This will be initilize the Siddhi Manager and register the ManagerService.
 * @param bundleContext the bundle context instance of this bundle.
 * @throws Exception this will be thrown if an issue occurs while executing the activate method
 */
@Activate protected void start(BundleContext bundleContext) throws Exception {
  ReferenceHolder.getInstance().setBundleContext(bundleContext);
  serviceRegistration=bundleContext.registerService(SiddhiComponentActivator.class.getName(),new SiddhiComponentActivator(),null);
}

Fixed version (ground truth):
/** 
 * This is the activation method of SiddhiManagerService. This will be initilize the Siddhi Manager and register the ManagerService.
 * @param bundleContext the bundle context instance of this bundle.
 * @throws Exception this will be thrown if an issue occurs while executing the activate method
 */
@Activate protected void start(BundleContext bundleContext) throws Exception {
  ReferenceHolder.getInstance().setBundleContext(bundleContext);
  SiddhiExtensionLoader.loadSiddhiExtensions(new HashMap<>());
  serviceRegistration=bundleContext.registerService(SiddhiComponentActivator.class.getName(),new SiddhiComponentActivator(),null);
}
Program: 28782
Project: 28782
Buggy source:
/** 
 * This method tells the ID(s) of the destination(s) to which a given messages should be sent. There can be cases where a given message is only sent to a specific destination(e.g., partition based) and message is sent to multiple endpoints(e.g., broadcast)
 * @param payload          payload of the message
 * @param transportOptions Dynamic transport options of the sink
 * @return Set of IDs of the destination to which the event should be sent
 */
@Override public List<Integer> getDestinationsToPublish(Object payload,DynamicOptions transportOptions){
  String partitionKeyValue=partitionOption.getValue(transportOptions);
  int destinationId=partitionKeyValue.hashCode() % totalDestinationCount;
  if (destinationIds.contains(destinationId)) {
    returnValue.clear();
    returnValue.add(destinationId);
    return returnValue;
  }
 else {
    return EMPTY_RETURN_VALUE;
  }
}

Fixed version (ground truth):
/** 
 * This method tells the ID(s) of the destination(s) to which a given messages should be sent. There can be cases where a given message is only sent to a specific destination(e.g., partition based) and message is sent to multiple endpoints(e.g., broadcast)
 * @param payload          payload of the message
 * @param transportOptions Dynamic transport options of the sink
 * @return Set of IDs of the destination to which the event should be sent
 */
@Override public List<Integer> getDestinationsToPublish(Object payload,DynamicOptions transportOptions){
  String partitionKeyValue=partitionOption.getValue(transportOptions);
  int destinationId=Math.abs(partitionKeyValue.hashCode() % totalDestinationCount);
  if (destinationIds.contains(destinationId)) {
    returnValue.clear();
    returnValue.add(destinationId);
    return returnValue;
  }
 else {
    return EMPTY_RETURN_VALUE;
  }
}
Program: 28783
Project: 28783
Buggy source:
void sendEvent(Event event) throws InterruptedException ;

Fixed version (ground truth):
public void sendEvent(Event event) throws InterruptedException {
  try {
    String[] transportProperties=trpProperties.get();
    trpProperties.remove();
    for (int i=0; i < transportMapping.size(); i++) {
      AttributeMapping attributeMapping=transportMapping.get(i);
      event.getData()[attributeMapping.getPosition()]=transportProperties[i];
    }
    inputEventHandlerCallback.sendEvent(event);
  }
 catch (  RuntimeException e) {
    LOG.error(ExceptionUtil.getMessageWithContext(e,siddhiAppContext) + "String_Node_Str" + sourceType+ "String_Node_Str"+ inputHandler.getStreamId()+ "String_Node_Str",e);
  }
 finally {
    trpProperties.remove();
  }
}
Program: 28784
Project: 28784
Buggy source:
void sendEvents(Event[] events) throws InterruptedException ;

Fixed version (ground truth):
public void sendEvents(Event[] events) throws InterruptedException {
  try {
    String[] transportProperties=trpProperties.get();
    for (int i=0; i < transportMapping.size(); i++) {
      AttributeMapping attributeMapping=transportMapping.get(i);
      for (      Event event : events) {
        event.getData()[attributeMapping.getPosition()]=transportProperties[i];
      }
    }
    inputEventHandlerCallback.sendEvents(events);
  }
 catch (  RuntimeException e) {
    LOG.error(ExceptionUtil.getMessageWithContext(e,siddhiAppContext) + "String_Node_Str" + sourceType+ "String_Node_Str"+ inputHandler.getStreamId()+ "String_Node_Str",e);
  }
 finally {
    trpProperties.remove();
  }
}
Program: 28785
Project: 28785
Buggy source:
@Override public void sendEvent(Event event) throws InterruptedException {
  handle(event,inputEventHandlerImpl);
}

Fixed version (ground truth):
public abstract void sendEvent(Event[] events,InputHandler inputHandler) throws InterruptedException ;
Program: 28786
Project: 28786
Buggy source:
@Override public void sendEvents(Event[] events) throws InterruptedException {
  handle(events,inputEventHandlerImpl);
}

Fixed version (ground truth):
@Override public void sendEvents(Event[] events) throws InterruptedException {
  sendEvent(events,inputHandler);
}
Program: 28787
Project: 28787
Buggy source:
public final void setInputHandler(InputHandler inputHandler){
  InputEventHandlerImpl inputEventHandlerImpl=new InputEventHandlerImpl(inputHandler,transportMappings,trpProperties,sourceType,siddhiAppContext);
  if (sourceHandler != null) {
    sourceHandler.setInputEventHandlerImpl(inputEventHandlerImpl);
    this.inputEventHandler=sourceHandler;
  }
 else {
    this.inputEventHandler=inputEventHandlerImpl;
  }
}

Fixed version (ground truth):
public final void setInputHandler(InputHandler inputHandler){
  InputEventHandlerCallback inputEventHandlerCallback;
  if (sourceHandler != null) {
    sourceHandler.setInputHandler(inputHandler);
    inputEventHandlerCallback=sourceHandler;
  }
 else {
    inputEventHandlerCallback=new PassThroughSourceHandler(inputHandler);
  }
  this.inputEventHandler=new InputEventHandler(inputHandler,transportMappings,trpProperties,sourceType,siddhiAppContext,inputEventHandlerCallback);
}
Program: 28788
Project: 28788
Buggy source:
@Override public int compare(String s1,String s2){
  String[] s1s=s1.split("String_Node_Str");
  String[] s2s=s2.split("String_Node_Str");
  int i=0;
  while (s1s.length > i || s2s.length > i) {
    String s1a="String_Node_Str";
    String s2a="String_Node_Str";
    if (s1s.length > i) {
      s1a=s1s[i];
    }
    if (s2s.length > i) {
      s2a=s2s[i];
    }
    System.out.println(s1a + "String_Node_Str" + s2a);
    int s1aInt=Integer.parseInt(s1a);
    int s2aInt=Integer.parseInt(s2a);
    if (s2aInt > s1aInt) {
      return 1;
    }
 else     if (s2aInt < s1aInt) {
      return -1;
    }
    i++;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(String s1,String s2){
  String[] s1s=s1.split("String_Node_Str");
  String[] s2s=s2.split("String_Node_Str");
  int i=0;
  while (s1s.length > i || s2s.length > i) {
    String s1a="String_Node_Str";
    String s2a="String_Node_Str";
    if (s1s.length > i) {
      s1a=s1s[i];
    }
    if (s2s.length > i) {
      s2a=s2s[i];
    }
    int s1aInt=Integer.parseInt(s1a);
    int s2aInt=Integer.parseInt(s2a);
    if (s2aInt > s1aInt) {
      return 1;
    }
 else     if (s2aInt < s1aInt) {
      return -1;
    }
    i++;
  }
  return 0;
}
Program: 28790
Project: 28790
Buggy source:
public SiddhiAppContext(){
  this.eternalReferencedHolders=new LinkedList<>();
  this.scriptFunctionMap=new HashMap<String,Script>();
}

Fixed version (ground truth):
public SiddhiAppContext(){
  this.eternalReferencedHolders=Collections.synchronizedList(new LinkedList<>());
  this.scriptFunctionMap=new HashMap<String,Script>();
}
Program: 28791
Project: 28791
Buggy source:
public void initExecutor(ExpressionExecutor[] attributeExpressionExecutors,SiddhiAppContext siddhiAppContext,String queryName,ConfigReader configReader){
  this.configReader=configReader;
  try {
    this.siddhiAppContext=siddhiAppContext;
    this.attributeExpressionExecutors=attributeExpressionExecutors;
    attributeSize=attributeExpressionExecutors.length;
    this.queryName=queryName;
    siddhiAppContext.addEternalReferencedHolder(this);
    if (elementId == null) {
      elementId="String_Node_Str" + siddhiAppContext.getElementIdGenerator().createNewId();
    }
    siddhiAppContext.getSnapshotService().addSnapshotable(queryName,this);
    init(attributeExpressionExecutors,configReader,siddhiAppContext);
  }
 catch (  Throwable t) {
    throw new SiddhiAppCreationException(t);
  }
}

Fixed version (ground truth):
public void initExecutor(ExpressionExecutor[] attributeExpressionExecutors,SiddhiAppContext siddhiAppContext,String queryName,ConfigReader configReader){
  this.configReader=configReader;
  try {
    this.siddhiAppContext=siddhiAppContext;
    this.attributeExpressionExecutors=attributeExpressionExecutors;
    attributeSize=attributeExpressionExecutors.length;
    this.queryName=queryName;
    if (elementId == null) {
      elementId="String_Node_Str" + siddhiAppContext.getElementIdGenerator().createNewId();
    }
    siddhiAppContext.getSnapshotService().addSnapshotable(queryName,this);
    init(attributeExpressionExecutors,configReader,siddhiAppContext);
  }
 catch (  Throwable t) {
    throw new SiddhiAppCreationException(t);
  }
}
Program: 28792
Project: 28792
Buggy source:
@Override public ExpressionExecutor cloneExecutor(String key){
  try {
    FunctionExecutor functionExecutor=this.getClass().newInstance();
    ExpressionExecutor[] innerExpressionExecutors=new ExpressionExecutor[attributeSize];
    for (int i=0; i < attributeSize; i++) {
      innerExpressionExecutors[i]=attributeExpressionExecutors[i].cloneExecutor(key);
    }
    functionExecutor.elementId=elementId + "String_Node_Str" + key;
    functionExecutor.functionId=functionId;
    functionExecutor.initExecutor(innerExpressionExecutors,siddhiAppContext,queryName,configReader);
    functionExecutor.start();
    return functionExecutor;
  }
 catch (  Exception e) {
    throw new SiddhiAppRuntimeException("String_Node_Str" + this.getClass().getCanonicalName(),e);
  }
}

Fixed version (ground truth):
@Override public ExpressionExecutor cloneExecutor(String key){
  try {
    FunctionExecutor functionExecutor=this.getClass().newInstance();
    ExpressionExecutor[] innerExpressionExecutors=new ExpressionExecutor[attributeSize];
    for (int i=0; i < attributeSize; i++) {
      innerExpressionExecutors[i]=attributeExpressionExecutors[i].cloneExecutor(key);
    }
    functionExecutor.elementId=elementId + "String_Node_Str" + key;
    functionExecutor.functionId=functionId;
    functionExecutor.initExecutor(innerExpressionExecutors,siddhiAppContext,queryName,configReader);
    return functionExecutor;
  }
 catch (  Exception e) {
    throw new SiddhiAppRuntimeException("String_Node_Str" + this.getClass().getCanonicalName(),e);
  }
}