nus-yam/ex-repair huggingface dataset:
Program: 28876
Project: 28876
Buggy source:
@Test public void jsonSourceMapperTest10() throws InterruptedException {
  log.info("String_Node_Str");
  String streams="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  executionPlanRuntime.addCallback("String_Node_Str",new StreamCallback(){
    @Override public void receive(    Event[] events){
      EventPrinter.print(events);
      for (      Event event : events) {
switch (count.incrementAndGet()) {
case 1:
          junit.framework.Assert.assertEquals(55.6f,event.getData(1));
        break;
case 2:
      junit.framework.Assert.assertEquals(56.6f,event.getData(1));
    break;
case 3:
  junit.framework.Assert.assertEquals(57.6f,event.getData(1));
break;
default :
Assert.fail();
}
}
}
}
);
executionPlanRuntime.start();
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
Thread.sleep(100);
Assert.assertEquals("String_Node_Str",3,count.get());
executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void jsonSourceMapperTest10() throws InterruptedException {
  log.info("String_Node_Str");
  String streams="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  executionPlanRuntime.addCallback("String_Node_Str",new StreamCallback(){
    @Override public void receive(    Event[] events){
      EventPrinter.print(events);
      for (      Event event : events) {
switch (count.incrementAndGet()) {
case 1:
          Assert.assertEquals(55.6f,event.getData(1));
        break;
case 2:
      Assert.assertEquals(56.6f,event.getData(1));
    break;
case 3:
  Assert.assertEquals(57.6f,event.getData(1));
break;
default :
Assert.fail();
}
}
}
}
);
executionPlanRuntime.start();
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
Thread.sleep(100);
Assert.assertEquals("String_Node_Str",3,count.get());
executionPlanRuntime.shutdown();
}
Program: 28878
Project: 28878
Buggy source:
@Test public void jsonSourceMapperTest5() throws InterruptedException {
  log.info("String_Node_Str");
  String streams="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  executionPlanRuntime.addCallback("String_Node_Str",new StreamCallback(){
    @Override public void receive(    Event[] events){
      EventPrinter.print(events);
      for (      Event event : events) {
switch (count.incrementAndGet()) {
case 1:
          junit.framework.Assert.assertEquals(55.6f,event.getData(1));
        break;
default :
      Assert.fail();
  }
}
}
}
);
executionPlanRuntime.start();
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
Thread.sleep(100);
Assert.assertEquals("String_Node_Str",1,count.get());
executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void jsonSourceMapperTest5() throws InterruptedException {
  log.info("String_Node_Str");
  String streams="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  SiddhiManager siddhiManager=new SiddhiManager();
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  executionPlanRuntime.addCallback("String_Node_Str",new StreamCallback(){
    @Override public void receive(    Event[] events){
      EventPrinter.print(events);
      for (      Event event : events) {
switch (count.incrementAndGet()) {
case 1:
          Assert.assertEquals(55.6f,event.getData(1));
        break;
default :
      Assert.fail();
  }
}
}
}
);
executionPlanRuntime.start();
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
InMemoryBroker.publish("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
Thread.sleep(100);
Assert.assertEquals("String_Node_Str",1,count.get());
executionPlanRuntime.shutdown();
}
Program: 28882
Project: 28882
Buggy source:
@Override protected void mapAndProcess(Object eventObject,InputEventHandler inputEventHandler) throws InterruptedException {
synchronized (this) {
    Object convertedEvent;
    convertedEvent=convertToEvent(eventObject);
    if (convertedEvent != null) {
      if (convertedEvent instanceof Event[]) {
        inputEventHandler.sendEvents((Event[])convertedEvent);
      }
 else {
        inputEventHandler.sendEvent((Event)convertedEvent);
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void mapAndProcess(Object eventObject,InputEventHandler inputEventHandler) throws InterruptedException {
  Object convertedEvent;
  convertedEvent=convertToEvent(eventObject);
  if (convertedEvent != null) {
    if (convertedEvent instanceof Event[]) {
      inputEventHandler.sendEvents((Event[])convertedEvent);
    }
 else {
      inputEventHandler.sendEvent((Event)convertedEvent);
    }
  }
}
Program: 28884
Project: 28884
Buggy source:
private Event processCustomEvent(ReadContext readContext){
  Configuration conf=Configuration.defaultConfiguration();
  Event event=new Event(attributesSize);
  Object[] data=event.getData();
  Object childObject=readContext.read(DEFAULT_ENCLOSING_ELEMENT);
  readContext=JsonPath.using(conf).parse(childObject);
  for (  MappingPositionData mappingPositionData : this.mappingPositions) {
    int position=mappingPositionData.getPosition();
    Object mappedValue;
    try {
      mappedValue=readContext.read(mappingPositionData.getMapping());
      if (mappedValue == null) {
        data[position]=null;
      }
 else {
        data[position]=attributeConverter.getPropertyValue(mappedValue.toString(),streamAttributes.get(position).getType());
      }
    }
 catch (    PathNotFoundException e) {
      if (failOnMissingAttribute) {
        throw new ExecutionPlanRuntimeException("String_Node_Str" + childObject.toString() + "String_Node_Str");
      }
      data[position]=null;
    }
  }
  return event;
}

Fixed version (ground truth):
private Event processCustomEvent(ReadContext readContext){
  Configuration conf=Configuration.defaultConfiguration();
  Event event=new Event(attributesSize);
  Object[] data=event.getData();
  Object childObject=readContext.read(DEFAULT_ENCLOSING_ELEMENT);
  readContext=JsonPath.using(conf).parse(childObject);
  for (  MappingPositionData mappingPositionData : this.mappingPositions) {
    int position=mappingPositionData.getPosition();
    Object mappedValue;
    try {
      mappedValue=readContext.read(mappingPositionData.getMapping());
      if (mappedValue == null) {
        data[position]=null;
      }
 else {
        data[position]=attributeConverter.getPropertyValue(mappedValue.toString(),streamAttributes.get(position).getType());
      }
    }
 catch (    PathNotFoundException e) {
      if (failOnMissingAttribute) {
        log.error("String_Node_Str" + childObject.toString() + "String_Node_Str");
        return null;
      }
      data[position]=null;
    }
  }
  return event;
}
Program: 28886
Project: 28886
Buggy source:
@Override public void mapAndSend(Event event,OptionHolder optionHolder,TemplateBuilder payloadTemplateBuilder,SinkListener sinkListener,DynamicOptions dynamicOptions) throws ConnectionUnavailableException {
  StringBuilder sb=null;
  if (payloadTemplateBuilder == null) {
    String jsonString=constructJsonForDefaultMapping(event);
    if (jsonString != null) {
      sb=new StringBuilder();
      sb.append(jsonString);
    }
  }
 else {
    sb=new StringBuilder();
    sb.append(constructJsonForCustomMapping(event,payloadTemplateBuilder));
  }
  if (sb != null) {
    if (!isJsonValidationEnabled) {
      sinkListener.publish(sb.toString(),dynamicOptions);
    }
 else     if (isJsonValidationEnabled && isValidJson(sb.toString())) {
      sinkListener.publish(sb.toString(),dynamicOptions);
    }
 else {
      log.error("String_Node_Str" + sb.toString());
    }
  }
}

Fixed version (ground truth):
@Override public void mapAndSend(Event event,OptionHolder optionHolder,TemplateBuilder payloadTemplateBuilder,SinkListener sinkListener,DynamicOptions dynamicOptions) throws ConnectionUnavailableException {
  StringBuilder sb=null;
  if (payloadTemplateBuilder == null) {
    String jsonString=constructJsonForDefaultMapping(event);
    if (jsonString != null) {
      sb=new StringBuilder();
      sb.append(jsonString);
    }
  }
 else {
    sb=new StringBuilder();
    sb.append(constructJsonForCustomMapping(event,payloadTemplateBuilder));
  }
  if (sb != null) {
    if (!isJsonValidationEnabled) {
      sinkListener.publish(sb.toString(),dynamicOptions);
    }
 else     if (isValidJson(sb.toString())) {
      sinkListener.publish(sb.toString(),dynamicOptions);
    }
 else {
      log.error("String_Node_Str" + sb.toString());
    }
  }
}
Program: 28887
Project: 28887
Buggy source:
@Override public void init(StreamDefinition streamDefinition,OptionHolder optionHolder,List<AttributeMapping> attributeMappingList,ConfigReader configReader){
  this.streamDefinition=streamDefinition;
  this.streamAttributes=this.streamDefinition.getAttributeList();
  attributesSize=this.streamDefinition.getAttributeList().size();
  this.mappingPositions=new MappingPositionData[attributesSize];
  failOnMissingAttribute=Boolean.parseBoolean(optionHolder.validateAndGetStaticValue(FAIL_ON_MISSING_ATTRIBUTE_IDENTIFIER,"String_Node_Str"));
  factory=new JsonFactory();
  if (attributeMappingList != null && attributeMappingList.size() > 0) {
    isCustomMappingEnabled=true;
    String ENCLOSING_ELEMENT_IDENTIFIER="String_Node_Str";
    enclosingElement=optionHolder.validateAndGetStaticValue(ENCLOSING_ELEMENT_IDENTIFIER,DEFAULT_ENCLOSING_ELEMENT);
    for (int i=0; i < attributeMappingList.size(); i++) {
      AttributeMapping attributeMapping=attributeMappingList.get(i);
      String attributeName=attributeMapping.getRename();
      int position;
      if (attributeName != null) {
        position=this.streamDefinition.getAttributePosition(attributeName);
      }
 else {
        position=i;
      }
      this.mappingPositions[i]=new MappingPositionData(position,attributeMapping.getMapping());
    }
  }
 else {
    for (int i=0; i < attributesSize; i++) {
      this.mappingPositions[i]=new MappingPositionData(i,DEFAULT_JSON_MAPPING_PREFIX + this.streamDefinition.getAttributeList().get(i).getName());
    }
  }
}

Fixed version (ground truth):
@Override public void init(StreamDefinition streamDefinition,OptionHolder optionHolder,List<AttributeMapping> attributeMappingList,ConfigReader configReader){
  this.streamDefinition=streamDefinition;
  this.streamAttributes=this.streamDefinition.getAttributeList();
  attributesSize=this.streamDefinition.getAttributeList().size();
  this.mappingPositions=new MappingPositionData[attributesSize];
  failOnMissingAttribute=Boolean.parseBoolean(optionHolder.validateAndGetStaticValue(FAIL_ON_MISSING_ATTRIBUTE_IDENTIFIER,"String_Node_Str"));
  factory=new JsonFactory();
  if (attributeMappingList != null && attributeMappingList.size() > 0) {
    isCustomMappingEnabled=true;
    enclosingElement=optionHolder.validateAndGetStaticValue(ENCLOSING_ELEMENT_IDENTIFIER,DEFAULT_ENCLOSING_ELEMENT);
    for (int i=0; i < attributeMappingList.size(); i++) {
      AttributeMapping attributeMapping=attributeMappingList.get(i);
      String attributeName=attributeMapping.getRename();
      int position;
      if (attributeName != null) {
        position=this.streamDefinition.getAttributePosition(attributeName);
      }
 else {
        position=i;
      }
      this.mappingPositions[i]=new MappingPositionData(position,attributeMapping.getMapping());
    }
  }
 else {
    for (int i=0; i < attributesSize; i++) {
      this.mappingPositions[i]=new MappingPositionData(i,DEFAULT_JSON_MAPPING_PREFIX + this.streamDefinition.getAttributeList().get(i).getName());
    }
  }
}
Program: 28889
Project: 28889
Buggy source:
private Event[] convertToEventArrayForDefaultMapping(Object eventObject){
  Gson gson=new Gson();
  JsonObject[] eventObjects=gson.fromJson(eventObject.toString(),JsonObject[].class);
  Event[] events=new Event[eventObjects.length];
  int index=0;
  JsonObject eventObj=null;
  for (  JsonObject jsonEvent : eventObjects) {
    if (jsonEvent.has(DEFAULT_JSON_EVENT_IDENTIFIER)) {
      eventObj=jsonEvent.get(DEFAULT_JSON_EVENT_IDENTIFIER).getAsJsonObject();
    }
 else {
      log.error("String_Node_Str" + eventObj.toString() + "String_Node_Str");
      continue;
    }
    Event event=new Event(streamAttributes.size());
    Object[] data=event.getData();
    if (failOnMissingAttribute && eventObj.size() < streamAttributes.size()) {
      log.error("String_Node_Str" + eventObj.toString() + "String_Node_Str");
      continue;
    }
    int position=0;
    for (    Attribute attribute : streamAttributes) {
      String attributeName=attribute.getName();
      Attribute.Type type=attribute.getType();
      Object attributeValue=eventObj.get(attributeName);
      if (attributeValue == null) {
        data[position++]=null;
      }
 else {
        data[position++]=attributeConverter.getPropertyValue(eventObj.get(attributeName).toString(),type);
      }
    }
    events[index++]=event;
  }
  return Arrays.copyOfRange(events,0,index);
}

Fixed version (ground truth):
private Event[] convertToEventArrayForDefaultMapping(Object eventObject){
  Gson gson=new Gson();
  JsonObject[] eventObjects=gson.fromJson(eventObject.toString(),JsonObject[].class);
  Event[] events=new Event[eventObjects.length];
  int index=0;
  JsonObject eventObj=null;
  for (  JsonObject jsonEvent : eventObjects) {
    if (jsonEvent.has(DEFAULT_JSON_EVENT_IDENTIFIER)) {
      eventObj=jsonEvent.get(DEFAULT_JSON_EVENT_IDENTIFIER).getAsJsonObject();
    }
 else {
      log.error("String_Node_Str" + eventObj.toString() + "String_Node_Str"+ "String_Node_Str");
      continue;
    }
    Event event=new Event(streamAttributes.size());
    Object[] data=event.getData();
    if (failOnMissingAttribute && eventObj.size() < streamAttributes.size()) {
      log.error("String_Node_Str" + eventObj.toString() + "String_Node_Str"+ "String_Node_Str");
      continue;
    }
    int position=0;
    for (    Attribute attribute : streamAttributes) {
      String attributeName=attribute.getName();
      Attribute.Type type=attribute.getType();
      Object attributeValue=eventObj.get(attributeName);
      if (attributeValue == null) {
        data[position++]=null;
      }
 else {
        data[position++]=attributeConverter.getPropertyValue(eventObj.get(attributeName).toString(),type);
      }
    }
    events[index++]=event;
  }
  return Arrays.copyOfRange(events,0,index);
}
Program: 28891
Project: 28891
Buggy source:
public Expression[] getParameters(){
  return Arrays.copyOfRange(parameters,0,parameters.length);
}

Fixed version (ground truth):
public Expression[] getParameters(){
  return parameters;
}
Program: 28892
Project: 28892
Buggy source:
public Expression[] getParameters(){
  return Arrays.copyOfRange(parameters,0,parameters.length);
}

Fixed version (ground truth):
public Expression[] getParameters(){
  return parameters;
}
Program: 28893
Project: 28893
Buggy source:
/** 
 * Receives an event as an XML string from   {@link Source}, converts it to a   {@link ComplexEventChunk}and send to the   {@link OutputCallback}.
 * @param eventObject  the input event, given as an XML string
 * @param inputHandler input handler
 */
@Override protected void mapAndProcess(Object eventObject,InputHandler inputHandler) throws InterruptedException {
  Event[] result;
  try {
    result=convertToEvents(eventObject);
    if (result.length > 0) {
      inputHandler.send(result);
    }
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
}

Fixed version (ground truth):
/** 
 * Receives an event as an XML string from   {@link Source}, converts it to a   {@link ComplexEventChunk}and send to the   {@link OutputCallback}.
 * @param eventObject  the input event, given as an XML string
 * @param inputEventHandler input handler
 */
@Override protected void mapAndProcess(Object eventObject,InputEventHandler inputEventHandler) throws InterruptedException {
  Event[] result;
  try {
    result=convertToEvents(eventObject);
    if (result.length > 0) {
      inputEventHandler.sendEvents(result);
    }
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
}
Program: 28894
Project: 28894
Buggy source:
public static void main(String[] args) throws InterruptedException {
  SiddhiManager siddhiManager=new SiddhiManager();
  siddhiManager.setExtension("String_Node_Str",CustomFunctionExtension.class);
  String executionPlan="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",700l,100l});
  inputHandler.send(new Object[]{"String_Node_Str",605l,200l});
  inputHandler.send(new Object[]{"String_Node_Str",60l,200l});
  Thread.sleep(500);
  executionPlanRuntime.shutdown();
  siddhiManager.shutdown();
}

Fixed version (ground truth):
public static void main(String[] args) throws InterruptedException {
  SiddhiManager siddhiManager=new SiddhiManager();
  siddhiManager.setExtension("String_Node_Str",CustomFunctionExtension.class);
  String executionPlan="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",700L,100L});
  inputHandler.send(new Object[]{"String_Node_Str",600L,200L});
  inputHandler.send(new Object[]{"String_Node_Str",60L,200L});
  Thread.sleep(500);
  executionPlanRuntime.shutdown();
  siddhiManager.shutdown();
}
Program: 28895
Project: 28895
Buggy source:
public static void main(String[] args) throws InterruptedException {
  SiddhiManager siddhiManager=new SiddhiManager();
  String executionPlan="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",50f,60f,60l,6});
  inputHandler.send(new Object[]{"String_Node_Str",70f,null,40l,10});
  inputHandler.send(new Object[]{"String_Node_Str",null,44f,200l,56});
  Thread.sleep(100);
  executionPlanRuntime.shutdown();
  siddhiManager.shutdown();
}

Fixed version (ground truth):
public static void main(String[] args) throws InterruptedException {
  SiddhiManager siddhiManager=new SiddhiManager();
  String executionPlan="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",50f,60f,60L,6});
  inputHandler.send(new Object[]{"String_Node_Str",70f,null,40L,10});
  inputHandler.send(new Object[]{"String_Node_Str",null,44f,200L,56});
  Thread.sleep(100);
  executionPlanRuntime.shutdown();
  siddhiManager.shutdown();
}
Program: 28896
Project: 28896
Buggy source:
public static void main(String[] args) throws InterruptedException {
  SiddhiManager siddhiManager=new SiddhiManager();
  String executionPlan="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
    }
  }
);
  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",50f,30l});
  inputHandler.send(new Object[]{"String_Node_Str",76.6f,400l});
  inputHandler.send(new Object[]{"String_Node_Str",45.6f,50l});
  Thread.sleep(500);
  executionPlanRuntime.shutdown();
  siddhiManager.shutdown();
}

Fixed version (ground truth):
public static void main(String[] args) throws InterruptedException {
  SiddhiManager siddhiManager=new SiddhiManager();
  String executionPlan="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
    }
  }
);
  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",50f,30L});
  inputHandler.send(new Object[]{"String_Node_Str",76.6f,400L});
  inputHandler.send(new Object[]{"String_Node_Str",45.6f,50L});
  Thread.sleep(500);
  executionPlanRuntime.shutdown();
  siddhiManager.shutdown();
}
Program: 28897
Project: 28897
Buggy source:
/** 
 * This method uses for validate @Extension -> @ReturnAttribute elements.
 * @param returnAttributes returnA attributes array which needs to be validate.
 * @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validateexception with proper message.
 */
public void returnAttributesValidation(ReturnAttribute[] returnAttributes) throws AnnotationValidationException {
  for (  ReturnAttribute returnAttribute : returnAttributes) {
    String returnAttributeName=returnAttribute.name();
    if (returnAttributeName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!camelCasePattern.matcher(returnAttributeName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
    if (returnAttribute.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
    if (returnAttribute.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
/** 
 * This method uses for validate @Extension -> @ReturnAttribute elements.
 * @param returnAttributes returnA attributes array which needs to be validate.
 * @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validateexception with proper message.
 */
public void returnAttributesValidation(ReturnAttribute[] returnAttributes) throws AnnotationValidationException {
  for (  ReturnAttribute returnAttribute : returnAttributes) {
    String returnAttributeName=returnAttribute.name();
    if (returnAttributeName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!CAMEL_CASE_PATTERN.matcher(returnAttributeName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
    if (returnAttribute.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
    if (returnAttribute.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
  }
}
Program: 28898
Project: 28898
Buggy source:
/** 
 * This method uses for validate @Extension -> @Parameter element.
 * @param parameters parameter array which needs to be validate.
 * @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validateexception with proper message.
 */
public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!parameterNamePattern.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
/** 
 * This method uses for validate @Extension -> @Parameter element.
 * @param parameters parameter array which needs to be validate.
 * @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validateexception with proper message.
 */
public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!PARAMETER_NAME_PATTERN.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}
Program: 28899
Project: 28899
Buggy source:
/** 
 * Basic @Extension annotation elements validation.
 * @param name        name of the @Extension which needs to be validate.
 * @param description description of the @Extension  which needs to be validate.
 * @param namespace   namespace of the @Extension  which needs to be validate.
 * @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validateexception with proper message.
 */
public void basicParameterValidation(String name,String description,String namespace) throws AnnotationValidationException {
  if (name.isEmpty()) {
    throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
  }
  if (description.isEmpty()) {
    throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
  }
  if (namespace.isEmpty()) {
    if (!corePackagePattern.matcher(extensionClassFullName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
/** 
 * Basic @Extension annotation elements validation.
 * @param name        name of the @Extension which needs to be validate.
 * @param description description of the @Extension  which needs to be validate.
 * @param namespace   namespace of the @Extension  which needs to be validate.
 * @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validateexception with proper message.
 */
public void basicParameterValidation(String name,String description,String namespace) throws AnnotationValidationException {
  if (name.isEmpty()) {
    throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
  }
  if (description.isEmpty()) {
    throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
  }
  if (namespace.isEmpty()) {
    if (!CORE_PACKAGE_PATTERN.matcher(extensionClassFullName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
  }
}
Program: 28900
Project: 28900
Buggy source:
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!parameterNamePattern.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!PARAMETER_NAME_PATTERN.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}
Program: 28901
Project: 28901
Buggy source:
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!parameterNamePattern.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!PARAMETER_NAME_PATTERN.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}
Program: 28902
Project: 28902
Buggy source:
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!parameterNamePattern.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!PARAMETER_NAME_PATTERN.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}
Program: 28903
Project: 28903
Buggy source:
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!parameterNamePattern.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!PARAMETER_NAME_PATTERN.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}
Program: 28904
Project: 28904
Buggy source:
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!parameterNamePattern.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
@Override public void parameterValidation(Parameter[] parameters) throws AnnotationValidationException {
  for (  Parameter parameter : parameters) {
    String parameterName=parameter.name();
    if (parameterName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!PARAMETER_NAME_PATTERN.matcher(parameterName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
    if (parameter.dynamic()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",parameterName,extensionClassFullName));
    }
  }
}
Program: 28905
Project: 28905
Buggy source:
@Override public void returnAttributesValidation(ReturnAttribute[] returnAttributes) throws AnnotationValidationException {
  for (  ReturnAttribute returnAttribute : returnAttributes) {
    String returnAttributeName=returnAttribute.name();
    if (returnAttributeName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!camelCasePattern.matcher(returnAttributeName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
    if (returnAttribute.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
    if (returnAttribute.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
  }
}

Fixed version (ground truth):
@Override public void returnAttributesValidation(ReturnAttribute[] returnAttributes) throws AnnotationValidationException {
  for (  ReturnAttribute returnAttribute : returnAttributes) {
    String returnAttributeName=returnAttribute.name();
    if (returnAttributeName.isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",extensionClassFullName));
    }
 else     if (!CAMEL_CASE_PATTERN.matcher(returnAttributeName).find()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
    if (returnAttribute.description().isEmpty()) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
    if (returnAttribute.type().length == 0) {
      throw new AnnotationValidationException(MessageFormat.format("String_Node_Str" + "String_Node_Str",returnAttributeName,extensionClassFullName));
    }
  }
}