nus-yam/ex-repair huggingface dataset:
Program: 29063
Project: 29063
Buggy source:
@Test public void deleteFromTableTest1() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String streams="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"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  InputHandler stockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
  InputHandler deleteStockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  stockStream.send(new Object[]{"String_Node_Str",55.6f,100l});
  stockStream.send(new Object[]{"String_Node_Str",75.6f,100l});
  stockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
  deleteStockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
  Thread.sleep(RESULT_WAIT);
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void deleteFromTableTest1() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String streams="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"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  try {
    InputHandler stockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
    InputHandler deleteStockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
    executionPlanRuntime.start();
    stockStream.send(new Object[]{"String_Node_Str",55.6f,100l});
    stockStream.send(new Object[]{"String_Node_Str",75.6f,100l});
    stockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
    deleteStockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
    Thread.sleep(RESULT_WAIT);
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}
Program: 29064
Project: 29064
Buggy source:
@Test public void deleteFromTableTest2() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String streams="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"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  InputHandler stockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
  InputHandler deleteStockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  stockStream.send(new Object[]{"String_Node_Str",55.6f,100l});
  stockStream.send(new Object[]{"String_Node_Str",75.6f,100l});
  stockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
  deleteStockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
  Thread.sleep(RESULT_WAIT);
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void deleteFromTableTest2() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String streams="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"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  try {
    InputHandler stockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
    InputHandler deleteStockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
    executionPlanRuntime.start();
    stockStream.send(new Object[]{"String_Node_Str",55.6f,100l});
    stockStream.send(new Object[]{"String_Node_Str",75.6f,100l});
    stockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
    deleteStockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
    Thread.sleep(RESULT_WAIT);
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}
Program: 29066
Project: 29066
Buggy source:
@Test public void deleteFromTableTest3() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String streams="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"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  InputHandler stockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
  InputHandler deleteStockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  stockStream.send(new Object[]{"String_Node_Str",55.6f,100l});
  stockStream.send(new Object[]{"String_Node_Str",75.6f,100l});
  stockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
  deleteStockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
  Thread.sleep(RESULT_WAIT);
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void deleteFromTableTest3() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String streams="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"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(streams + query);
  try {
    InputHandler stockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
    InputHandler deleteStockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
    executionPlanRuntime.start();
    stockStream.send(new Object[]{"String_Node_Str",55.6f,100l});
    stockStream.send(new Object[]{"String_Node_Str",75.6f,100l});
    stockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
    deleteStockStream.send(new Object[]{"String_Node_Str",57.6f,100l});
    Thread.sleep(RESULT_WAIT);
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}
Program: 29068
Project: 29068
Buggy source:
public PatternMultiProcessStreamReceiver(String streamId,int processCount,LatencyTracker latencyTracker){
  super(streamId,processCount,latencyTracker);
  eventSequence=new int[processCount];
  int count=0;
  for (int i=eventSequence.length - 1; i >= 0; i--) {
    eventSequence[count]=i;
    count++;
  }
}

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

Fixed version (ground truth):
public PatternMultiProcessStreamReceiver clone(String key){
  return new PatternMultiProcessStreamReceiver(streamId + key,processCount,key,latencyTracker);
}
Program: 29070
Project: 29070
Buggy source:
public PatternSingleProcessStreamReceiver(String streamId,LatencyTracker latencyTracker){
  super(streamId,latencyTracker);
}

Fixed version (ground truth):
public PatternSingleProcessStreamReceiver(String streamId,String lockKey,LatencyTracker latencyTracker){
  super(streamId,latencyTracker);
  this.lockKey=lockKey;
}
Program: 29071
Project: 29071
Buggy source:
public PatternSingleProcessStreamReceiver clone(String key){
  return new PatternSingleProcessStreamReceiver(streamId + key,latencyTracker);
}

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

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

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

Fixed version (ground truth):
public SequenceSingleProcessStreamReceiver clone(String key){
  return new SequenceSingleProcessStreamReceiver(streamId + key,null,key,latencyTracker);
}
Program: 29075
Project: 29075
Buggy source:
public SequenceSingleProcessStreamReceiver(String streamId,StateStreamRuntime stateStreamRuntime,LatencyTracker latencyTracker){
  super(streamId,latencyTracker);
  this.stateStreamRuntime=stateStreamRuntime;
}

Fixed version (ground truth):
public SequenceSingleProcessStreamReceiver(String streamId,StateStreamRuntime stateStreamRuntime,String lockKey,LatencyTracker latencyTracker){
  super(streamId,latencyTracker);
  this.stateStreamRuntime=stateStreamRuntime;
  this.lockKey=lockKey;
}
Program: 29079
Project: 29079
Buggy source:
/** 
 * @return Name of the mem tracker
 */
String getName(Object object);

Fixed version (ground truth):
/** 
 * @param object Object
 * @return Name of the mem tracker
 */
String getName(Object object);
Program: 29080
Project: 29080
Buggy source:
/** 
 * Register the object that needs to be measured the memory usage
 * @param object Object
 * @param name An unique value to identify the object.
 */
void registerObject(Object object,String name);

Fixed version (ground truth):
/** 
 * Register the object that needs to be measured the memory usage
 * @param object Object
 * @param name   An unique value to identify the object.
 */
void registerObject(Object object,String name);
Program: 29081
Project: 29081
Buggy source:
/** 
 * This method is to notify receive of multiple events to calculate the throughput
 */
void eventsIn(int eventCount);

Fixed version (ground truth):
/** 
 * This method is to notify receive of multiple events to calculate the throughput
 * @param eventCount number of events passing through
 */
void eventsIn(int eventCount);
Program: 29082
Project: 29082
Buggy source:
/** 
 * Returns the parent chain, from which this chain was created.
 * @throws IllegalStateException if {@code !hasParent()}, then an
 */
public Chain getParent(){
  Preconditions.checkState(parent != null,"String_Node_Str");
  return parent;
}

Fixed version (ground truth):
/** 
 * @return the parent chain, from which this chain was created.
 * @throws IllegalStateException if {@code !hasParent()}, then an
 */
public Chain getParent(){
  Preconditions.checkState(parent != null,"String_Node_Str");
  return parent;
}
Program: 29083
Project: 29083
Buggy source:
/** 
 * Returns the value that this chain leads to. If the value is a primitive, a wrapper object is returned instead.
 */
public Object getValue(){
  return value;
}

Fixed version (ground truth):
/** 
 * @return the value that this chain leads to. If the value is a primitive,a wrapper object is returned instead.
 */
public Object getValue(){
  return value;
}
Program: 29084
Project: 29084
Buggy source:
/** 
 * Returns the root object of this chain.
 */
public Object getRoot(){
  Chain current=this;
  while (current.hasParent()) {
    current=current.getParent();
  }
  return current.getValue();
}

Fixed version (ground truth):
/** 
 * @return the root object of this chain.
 */
public Object getRoot(){
  Chain current=this;
  while (current.hasParent()) {
    current=current.getParent();
  }
  return current.getValue();
}
Program: 29085
Project: 29085
Buggy source:
/** 
 * Returns whether the value of this chain represents a primitive.
 */
public boolean isPrimitive(){
  return getValueType().isPrimitive();
}

Fixed version (ground truth):
/** 
 * @return whether the value of this chain represents a primitive.
 */
public boolean isPrimitive(){
  return getValueType().isPrimitive();
}
Program: 29086
Project: 29086
Buggy source:
/** 
 * Returns whether this chain has a parent. This returns false only when this chain represents the root object itself.
 */
public boolean hasParent(){
  return parent != null;
}

Fixed version (ground truth):
/** 
 * @return whether this chain has a parent. This returns false only whenthis chain represents the root object itself.
 */
public boolean hasParent(){
  return parent != null;
}
Program: 29087
Project: 29087
Buggy source:
/** 
 * Constructs a Footprint, by specifying the number of objects, references, and primitives (represented as a   {@link Multiset}).
 * @param objects the number of objects
 * @param references the number of references
 * @param primitives the number of primitives (represented by therespective primitive classes, e.g.  {@code int.class} etc)
 */
public Footprint(int objects,int references,Multiset<Class<?>> primitives){
  Preconditions.checkArgument(objects >= 0,"String_Node_Str");
  Preconditions.checkArgument(references >= 0,"String_Node_Str");
  Preconditions.checkArgument(primitiveTypes.containsAll(primitives.elementSet()),"String_Node_Str");
  this.objects=objects;
  this.references=references;
  this.primitives=ImmutableMultiset.copyOf(primitives);
}

Fixed version (ground truth):
/** 
 * Constructs a Footprint, by specifying the number of objects, references, and primitives (represented as a   {@link Multiset}).
 * @param objects    the number of objects
 * @param references the number of references
 * @param primitives the number of primitives (represented by therespective primitive classes, e.g.  {@code int.class} etc)
 */
public Footprint(int objects,int references,Multiset<Class<?>> primitives){
  Preconditions.checkArgument(objects >= 0,"String_Node_Str");
  Preconditions.checkArgument(references >= 0,"String_Node_Str");
  Preconditions.checkArgument(primitiveTypes.containsAll(primitives.elementSet()),"String_Node_Str");
  this.objects=objects;
  this.references=references;
  this.primitives=ImmutableMultiset.copyOf(primitives);
}
Program: 29088
Project: 29088
Buggy source:
/** 
 * Returns the number of references of this footprint.
 */
public int getReferences(){
  return references;
}

Fixed version (ground truth):
/** 
 * @return the number of references of this footprint.
 */
public int getReferences(){
  return references;
}
Program: 29089
Project: 29089
Buggy source:
/** 
 * Measures the footprint of the specified object graph. The object graph is defined by a root object and whatever object can be reached through that, excluding static fields,   {@code Class} objects,and fields defined in  {@code enum}s (all these are considered shared values, which should not contribute to the cost of any single object graph), and any object for which the user-provided predicate returns  {@code false}.
 * @param rootObject the root object of the object graph
 * @param objectAcceptor a predicate that returns {@code true} for objectsto be explored (and treated as part of the footprint), or  {@code false}to forbid the traversal to traverse the given object
 * @return the footprint of the object graph
 */
public static Footprint measure(Object rootObject,Predicate<Object> objectAcceptor){
  Preconditions.checkNotNull(objectAcceptor,"String_Node_Str");
  Predicate<Chain> completePredicate=Predicates.and(ImmutableList.of(ObjectExplorer.notEnumFieldsOrClasses,Predicates.compose(objectAcceptor,ObjectExplorer.chainToObject),new ObjectExplorer.AtMostOncePredicate()));
  return ObjectExplorer.exploreObject(rootObject,new ObjectGraphVisitor(completePredicate),EnumSet.of(ObjectExplorer.Feature.VISIT_PRIMITIVES,ObjectExplorer.Feature.VISIT_NULL));
}

Fixed version (ground truth):
/** 
 * Measures the footprint of the specified object graph. The object graph is defined by a root object and whatever object can be reached through that, excluding static fields,   {@code Class} objects,and fields defined in  {@code enum}s (all these are considered shared values, which should not contribute to the cost of any single object graph), and any object for which the user-provided predicate returns  {@code false}.
 * @param rootObject     the root object of the object graph
 * @param objectAcceptor a predicate that returns {@code true} for objectsto be explored (and treated as part of the footprint), or  {@code false}to forbid the traversal to traverse the given object
 * @return the footprint of the object graph
 */
public static Footprint measure(Object rootObject,Predicate<Object> objectAcceptor){
  Preconditions.checkNotNull(objectAcceptor,"String_Node_Str");
  Predicate<Chain> completePredicate=Predicates.and(ImmutableList.of(ObjectExplorer.notEnumFieldsOrClasses,Predicates.compose(objectAcceptor,ObjectExplorer.chainToObject),new ObjectExplorer.AtMostOncePredicate()));
  return ObjectExplorer.exploreObject(rootObject,new ObjectGraphVisitor(completePredicate),EnumSet.of(ObjectExplorer.Feature.VISIT_PRIMITIVES,ObjectExplorer.Feature.VISIT_NULL));
}
Program: 29090
Project: 29090
Buggy source:
/** 
 * Returns the number of primitives of this footprint (represented by the respective primitive classes,  {@literal e.g.} {@code int.class} etc).
 */
public ImmutableMultiset<Class<?>> getPrimitives(){
  return primitives;
}

Fixed version (ground truth):
/** 
 * @return the number of primitives of this footprint(represented by the respective primitive classes, {@literal e.g.} {@code int.class} etc).
 */
public ImmutableMultiset<Class<?>> getPrimitives(){
  return primitives;
}
Program: 29091
Project: 29091
Buggy source:
/** 
 * Returns the number of objects of this footprint.
 */
public int getObjects(){
  return objects;
}

Fixed version (ground truth):
/** 
 * @return the number of objects of this footprint.
 */
public int getObjects(){
  return objects;
}
Program: 29092
Project: 29092
Buggy source:
/** 
 * Returns an arbitrary value (presumably constructed during the object graph traversal).
 */
T result();

Fixed version (ground truth):
/** 
 * @return  an arbitrary value (presumably constructed during the objectgraph traversal).
 */
T result();
Program: 29093
Project: 29093
Buggy source:
public SiddhiContext(){
  setSiddhiExtensions(SiddhiExtensionLoader.loadSiddhiExtensions());
  eventBufferSize=SiddhiConstants.DEFAULT_EVENT_BUFFER_SIZE;
  this.siddhiDataSources=new ConcurrentHashMap<String,DataSource>();
}

Fixed version (ground truth):
public SiddhiContext(){
  setSiddhiExtensions(SiddhiExtensionLoader.loadSiddhiExtensions());
  eventBufferSize=SiddhiConstants.DEFAULT_EVENT_BUFFER_SIZE;
  siddhiDataSources=new ConcurrentHashMap<String,DataSource>();
  extensionHolderMap=new ConcurrentHashMap<Class,AbstractExtensionHolder>();
}
Program: 29094
Project: 29094
Buggy source:
@Override public void receive(long timeStamp,Event[] inEvents,Event[] removeEvents){
  EventPrinter.print(timeStamp,inEvents,removeEvents);
  for (  Event event : inEvents) {
    count.incrementAndGet();
    if (count.get() == 1) {
      Assert.assertEquals(100.3d,event.getData(2));
      eventArrived=true;
    }
    if (count.get() == 2) {
      Assert.assertEquals(null,event.getData(2));
      eventArrived=true;
    }
    if (count.get() == 3) {
      Assert.assertEquals(300d,event.getData(2));
      eventArrived=true;
    }
  }
}

Fixed version (ground truth):
@Override public void receive(long timeStamp,Event[] inEvents,Event[] removeEvents){
  EventPrinter.print(timeStamp,inEvents,removeEvents);
  for (  Event event : inEvents) {
    count.incrementAndGet();
    if (count.get() == 1) {
      Assert.assertEquals(100.3d,event.getData(2));
      eventArrived=true;
    }
    if (count.get() == 2) {
      Assert.assertEquals(true,event.getData(2));
      eventArrived=true;
    }
    if (count.get() == 3) {
      Assert.assertEquals(300d,event.getData(2));
      eventArrived=true;
    }
  }
}
Program: 29095
Project: 29095
Buggy source:
@Test public void testCastFunctionExtension() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String inStreamDefinition="String_Node_Str";
  String query=("String_Node_Str" + "String_Node_Str");
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
      for (      Event event : inEvents) {
        count.incrementAndGet();
        if (count.get() == 1) {
          Assert.assertEquals(100.3d,event.getData(2));
          eventArrived=true;
        }
        if (count.get() == 2) {
          Assert.assertEquals(null,event.getData(2));
          eventArrived=true;
        }
        if (count.get() == 3) {
          Assert.assertEquals(300d,event.getData(2));
          eventArrived=true;
        }
      }
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",100.3,100l});
  inputHandler.send(new Object[]{"String_Node_Str",true,200l});
  inputHandler.send(new Object[]{"String_Node_Str",300d,200l});
  SiddhiTestHelper.waitForEvents(100,3,count,60000);
  Assert.assertEquals(3,count.get());
  Assert.assertTrue(eventArrived);
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void testCastFunctionExtension() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String inStreamDefinition="String_Node_Str";
  String query=("String_Node_Str" + "String_Node_Str");
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
      for (      Event event : inEvents) {
        count.incrementAndGet();
        if (count.get() == 1) {
          Assert.assertEquals(100.3d,event.getData(2));
          eventArrived=true;
        }
        if (count.get() == 2) {
          Assert.assertEquals(true,event.getData(2));
          eventArrived=true;
        }
        if (count.get() == 3) {
          Assert.assertEquals(300d,event.getData(2));
          eventArrived=true;
        }
      }
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",100.3,100l});
  inputHandler.send(new Object[]{"String_Node_Str",true,200l});
  inputHandler.send(new Object[]{"String_Node_Str",300d,200l});
  SiddhiTestHelper.waitForEvents(100,3,count,60000);
  Assert.assertEquals(3,count.get());
  Assert.assertTrue(eventArrived);
  executionPlanRuntime.shutdown();
}
Program: 29096
Project: 29096
Buggy source:
private Object getMapFromXML(String data) throws XMLStreamException {
  Map<Object,Object> topLevelMap=new LinkedHashMap<Object,Object>();
  Map<Object,Object> map=new LinkedHashMap<Object,Object>();
  OMElement parentElement=AXIOMUtil.stringToOM(data);
  Iterator iterator=parentElement.getChildElements();
  while (iterator.hasNext()) {
    OMElement streamAttributeElement=(OMElement)iterator.next();
    String key=streamAttributeElement.getQName().toString();
    Object value;
    if (streamAttributeElement.getFirstElement() != null) {
      value=getMapFromXML(streamAttributeElement.toString());
    }
 else {
      String elementText=streamAttributeElement.getText();
      if (elementText.equals("String_Node_Str") || elementText.equals("String_Node_Str")) {
        value=Boolean.parseBoolean(elementText);
      }
 else {
        try {
          value=nf.parse(elementText);
        }
 catch (        ParseException e) {
          value=elementText;
        }
      }
    }
    map.put(key,value);
  }
  topLevelMap.put(parentElement.getQName().toString(),map);
  return topLevelMap;
}

Fixed version (ground truth):
private Object getMapFromXML(OMElement parentElement) throws XMLStreamException {
  Map<Object,Object> map=new HashMap<Object,Object>();
  Iterator iterator=parentElement.getChildElements();
  while (iterator.hasNext()) {
    OMElement streamAttributeElement=(OMElement)iterator.next();
    String key=streamAttributeElement.getQName().toString();
    Object value;
    if (streamAttributeElement.getFirstElement() != null) {
      value=getMapFromXML(streamAttributeElement);
    }
 else {
      String elementText=streamAttributeElement.getText();
      if (elementText.equals("String_Node_Str") || elementText.equals("String_Node_Str")) {
        value=Boolean.parseBoolean(elementText);
      }
 else {
        try {
          value=numberFormat.parse(elementText);
        }
 catch (        ParseException e) {
          value=elementText;
        }
      }
    }
    map.put(key,value);
  }
  return map;
}
Program: 29097
Project: 29097
Buggy source:
@Override protected Object execute(Object data){
  if (data instanceof String) {
    try {
      return getMapFromXML(data.toString());
    }
 catch (    XMLStreamException e) {
      throw new ExecutionPlanRuntimeException("String_Node_Str" + e.getMessage(),e);
    }
  }
 else {
    throw new ExecutionPlanRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected Object execute(Object data){
  if (data instanceof String) {
    try {
      Map<Object,Object> topLevelMap=new HashMap<Object,Object>();
      OMElement parentElement=AXIOMUtil.stringToOM(data.toString());
      topLevelMap.put(parentElement.getQName().toString(),getMapFromXML(parentElement));
      return topLevelMap;
    }
 catch (    XMLStreamException e) {
      throw new ExecutionPlanRuntimeException("String_Node_Str" + e.getMessage(),e);
    }
  }
 else {
    throw new ExecutionPlanRuntimeException("String_Node_Str");
  }
}
Program: 29098
Project: 29098
Buggy source:
@Override public void receive(Event[] inEvents){
  EventPrinter.print(inEvents);
  for (  Event event : inEvents) {
    count.incrementAndGet();
    if (count.get() == 1) {
      JSONAssert.assertEquals(new JSONObject("String_Node_Str"),new JSONObject(event.getData(0)),false);
      eventArrived=true;
    }
    if (count.get() == 2) {
      JSONAssert.assertEquals(new JSONObject("String_Node_Str"),new JSONObject(event.getData(0)),false);
      eventArrived=true;
    }
    if (count.get() == 3) {
      JSONAssert.assertEquals(new JSONObject("String_Node_Str"),new JSONObject(event.getData(0)),false);
      eventArrived=true;
    }
  }
}

Fixed version (ground truth):
@Override public void receive(Event[] inEvents){
  EventPrinter.print(inEvents);
  for (  Event event : inEvents) {
    count.incrementAndGet();
    if (count.get() == 1) {
      Assert.assertEquals(event.getData(0) instanceof String,true);
      JSONAssert.assertEquals(new JSONObject("String_Node_Str"),new JSONObject((String)event.getData(0)),false);
      eventArrived=true;
    }
    if (count.get() == 2) {
      Assert.assertEquals(event.getData(0) instanceof String,true);
      JSONAssert.assertEquals(new JSONObject("String_Node_Str"),new JSONObject((String)event.getData(0)),false);
      eventArrived=true;
    }
    if (count.get() == 3) {
      Assert.assertEquals(event.getData(0) instanceof String,true);
      JSONAssert.assertEquals(new JSONObject("String_Node_Str"),new JSONObject((String)event.getData(0)),false);
      eventArrived=true;
    }
  }
}
Program: 29100
Project: 29100
Buggy source:
@Override public void receive(Event[] inEvents){
  EventPrinter.print(inEvents);
  for (  Event event : inEvents) {
    count.incrementAndGet();
    if (count.get() == 1) {
      Assert.assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",event.getData(0));
      eventArrived=true;
    }
    if (count.get() == 2) {
      Assert.assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",event.getData(0));
      eventArrived=true;
    }
    if (count.get() == 3) {
      Assert.assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",event.getData(0));
      eventArrived=true;
    }
  }
}

Fixed version (ground truth):
@Override public void receive(Event[] inEvents){
  EventPrinter.print(inEvents);
  for (  Event event : inEvents) {
    count.incrementAndGet();
    if (count.get() == 1) {
      try {
        Assert.assertEquals(true,new XMLComparator().compare(AXIOMUtil.stringToOM("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"),AXIOMUtil.stringToOM((String)event.getData(0))));
      }
 catch (      XMLComparisonException e) {
        log.error("String_Node_Str" + e.getMessage(),e);
      }
catch (      XMLStreamException e) {
        log.error("String_Node_Str" + e.getMessage(),e);
      }
      eventArrived=true;
    }
    if (count.get() == 2) {
      try {
        Assert.assertEquals(true,new XMLComparator().compare(AXIOMUtil.stringToOM("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"),AXIOMUtil.stringToOM((String)event.getData(0))));
      }
 catch (      XMLComparisonException e) {
        log.error("String_Node_Str" + e.getMessage(),e);
      }
catch (      XMLStreamException e) {
        log.error("String_Node_Str" + e.getMessage(),e);
      }
      eventArrived=true;
    }
    if (count.get() == 3) {
      try {
        Assert.assertEquals(true,new XMLComparator().compare(AXIOMUtil.stringToOM("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"),AXIOMUtil.stringToOM((String)event.getData(0))));
      }
 catch (      XMLComparisonException e) {
        log.error("String_Node_Str" + e.getMessage(),e);
      }
catch (      XMLStreamException e) {
        log.error("String_Node_Str" + e.getMessage(),e);
      }
      eventArrived=true;
    }
  }
}
Program: 29103
Project: 29103
Buggy source:
private AttributeAggregatorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(AttributeAggregator.class,executionPlanContext);
}

Fixed version (ground truth):
private AttributeAggregatorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(clazz,executionPlanContext);
}
Program: 29104
Project: 29104
Buggy source:
public static AttributeAggregatorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  if (instance == null) {
    instance=new AttributeAggregatorExtensionHolder(executionPlanContext);
  }
  return instance;
}

Fixed version (ground truth):
public static AttributeAggregatorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  ConcurrentHashMap<Class,AbstractExtensionHolder> extensionHolderMap=executionPlanContext.getSiddhiContext().getExtensionHolderMap();
  AbstractExtensionHolder abstractExtensionHolder=extensionHolderMap.get(clazz);
  if (abstractExtensionHolder == null) {
    abstractExtensionHolder=new AttributeAggregatorExtensionHolder(executionPlanContext);
    extensionHolderMap.putIfAbsent(clazz,abstractExtensionHolder);
  }
  return (AttributeAggregatorExtensionHolder)extensionHolderMap.get(clazz);
}
Program: 29105
Project: 29105
Buggy source:
protected EvalScriptExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(EvalScript.class,executionPlanContext);
}

Fixed version (ground truth):
protected EvalScriptExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(clazz,executionPlanContext);
}
Program: 29106
Project: 29106
Buggy source:
public static EvalScriptExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  if (instance == null) {
    instance=new EvalScriptExtensionHolder(executionPlanContext);
  }
  return instance;
}

Fixed version (ground truth):
public static EvalScriptExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  ConcurrentHashMap<Class,AbstractExtensionHolder> extensionHolderMap=executionPlanContext.getSiddhiContext().getExtensionHolderMap();
  AbstractExtensionHolder abstractExtensionHolder=extensionHolderMap.get(clazz);
  if (abstractExtensionHolder == null) {
    abstractExtensionHolder=new EvalScriptExtensionHolder(executionPlanContext);
    extensionHolderMap.putIfAbsent(clazz,abstractExtensionHolder);
  }
  return (EvalScriptExtensionHolder)extensionHolderMap.get(clazz);
}
Program: 29107
Project: 29107
Buggy source:
public static EventTableExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  if (instance == null) {
    instance=new EventTableExtensionHolder(executionPlanContext);
  }
  return instance;
}

Fixed version (ground truth):
public static EventTableExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  ConcurrentHashMap<Class,AbstractExtensionHolder> extensionHolderMap=executionPlanContext.getSiddhiContext().getExtensionHolderMap();
  AbstractExtensionHolder abstractExtensionHolder=extensionHolderMap.get(clazz);
  if (abstractExtensionHolder == null) {
    abstractExtensionHolder=new EventTableExtensionHolder(executionPlanContext);
    extensionHolderMap.putIfAbsent(clazz,abstractExtensionHolder);
  }
  return (EventTableExtensionHolder)extensionHolderMap.get(clazz);
}
Program: 29108
Project: 29108
Buggy source:
protected EventTableExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(EventTable.class,executionPlanContext);
}

Fixed version (ground truth):
protected EventTableExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(clazz,executionPlanContext);
}
Program: 29109
Project: 29109
Buggy source:
private FunctionExecutorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(FunctionExecutor.class,executionPlanContext);
}

Fixed version (ground truth):
private FunctionExecutorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(clazz,executionPlanContext);
}
Program: 29110
Project: 29110
Buggy source:
public static FunctionExecutorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  if (instance == null) {
    instance=new FunctionExecutorExtensionHolder(executionPlanContext);
  }
  return instance;
}

Fixed version (ground truth):
public static FunctionExecutorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  ConcurrentHashMap<Class,AbstractExtensionHolder> extensionHolderMap=executionPlanContext.getSiddhiContext().getExtensionHolderMap();
  AbstractExtensionHolder abstractExtensionHolder=extensionHolderMap.get(clazz);
  if (abstractExtensionHolder == null) {
    abstractExtensionHolder=new FunctionExecutorExtensionHolder(executionPlanContext);
    extensionHolderMap.putIfAbsent(clazz,abstractExtensionHolder);
  }
  return (FunctionExecutorExtensionHolder)extensionHolderMap.get(clazz);
}
Program: 29111
Project: 29111
Buggy source:
private StreamFunctionProcessorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(StreamFunctionProcessor.class,executionPlanContext);
}

Fixed version (ground truth):
private StreamFunctionProcessorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(clazz,executionPlanContext);
}
Program: 29112
Project: 29112
Buggy source:
public static StreamFunctionProcessorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  if (instance == null) {
    instance=new StreamFunctionProcessorExtensionHolder(executionPlanContext);
  }
  return instance;
}

Fixed version (ground truth):
public static StreamFunctionProcessorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  ConcurrentHashMap<Class,AbstractExtensionHolder> extensionHolderMap=executionPlanContext.getSiddhiContext().getExtensionHolderMap();
  AbstractExtensionHolder abstractExtensionHolder=extensionHolderMap.get(clazz);
  if (abstractExtensionHolder == null) {
    abstractExtensionHolder=new StreamFunctionProcessorExtensionHolder(executionPlanContext);
    extensionHolderMap.putIfAbsent(clazz,abstractExtensionHolder);
  }
  return (StreamFunctionProcessorExtensionHolder)extensionHolderMap.get(clazz);
}
Program: 29113
Project: 29113
Buggy source:
public static StreamProcessorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  if (instance == null) {
    instance=new StreamProcessorExtensionHolder(executionPlanContext);
  }
  return instance;
}

Fixed version (ground truth):
public static StreamProcessorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  ConcurrentHashMap<Class,AbstractExtensionHolder> extensionHolderMap=executionPlanContext.getSiddhiContext().getExtensionHolderMap();
  AbstractExtensionHolder abstractExtensionHolder=extensionHolderMap.get(clazz);
  if (abstractExtensionHolder == null) {
    abstractExtensionHolder=new StreamProcessorExtensionHolder(executionPlanContext);
    extensionHolderMap.putIfAbsent(clazz,abstractExtensionHolder);
  }
  return (StreamProcessorExtensionHolder)extensionHolderMap.get(clazz);
}
Program: 29114
Project: 29114
Buggy source:
private StreamProcessorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(StreamProcessor.class,executionPlanContext);
}

Fixed version (ground truth):
private StreamProcessorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(clazz,executionPlanContext);
}
Program: 29115
Project: 29115
Buggy source:
private WindowProcessorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(WindowProcessor.class,executionPlanContext);
}

Fixed version (ground truth):
private WindowProcessorExtensionHolder(ExecutionPlanContext executionPlanContext){
  super(clazz,executionPlanContext);
}
Program: 29116
Project: 29116
Buggy source:
public static WindowProcessorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  if (instance == null) {
    instance=new WindowProcessorExtensionHolder(executionPlanContext);
  }
  return instance;
}

Fixed version (ground truth):
public static WindowProcessorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext){
  ConcurrentHashMap<Class,AbstractExtensionHolder> extensionHolderMap=executionPlanContext.getSiddhiContext().getExtensionHolderMap();
  AbstractExtensionHolder abstractExtensionHolder=extensionHolderMap.get(clazz);
  if (abstractExtensionHolder == null) {
    abstractExtensionHolder=new WindowProcessorExtensionHolder(executionPlanContext);
    extensionHolderMap.putIfAbsent(clazz,abstractExtensionHolder);
  }
  return (WindowProcessorExtensionHolder)extensionHolderMap.get(clazz);
}
Program: 29117
Project: 29117
Buggy source:
@Test(expected=ExecutionPlanValidationException.class) public void extensionTest3() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  siddhiManager.setExtension("String_Node_Str",CustomFunctionExtension.class);
  siddhiManager.setExtension("String_Node_Str",StringConcatAggregatorString.class);
  String cseEventStream="String_Node_Str";
  String query=("String_Node_Str" + "String_Node_Str");
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
      count=count + inEvents.length;
      if (count == 3) {
        Assert.assertEquals("String_Node_Str",inEvents[inEvents.length - 1].getData(1));
      }
      eventArrived=true;
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",700f,100l});
  Thread.sleep(100);
  inputHandler.send(new Object[]{"String_Node_Str",60.5f,200l});
  Thread.sleep(100);
  inputHandler.send(new Object[]{"String_Node_Str",60.5f,200l});
  Thread.sleep(100);
  Assert.assertEquals(3,count);
  Assert.assertTrue(eventArrived);
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void extensionTest3() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  siddhiManager.setExtension("String_Node_Str",CustomFunctionExtension.class);
  siddhiManager.setExtension("String_Node_Str",StringConcatAggregatorString.class);
  String cseEventStream="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  String query=("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(cseEventStream + query);
  executionPlanRuntime.addCallback("String_Node_Str",new QueryCallback(){
    @Override public void receive(    long timeStamp,    Event[] inEvents,    Event[] removeEvents){
      EventPrinter.print(timeStamp,inEvents,removeEvents);
      count=count + inEvents.length;
      if (count == 3) {
        Assert.assertEquals("String_Node_Str",inEvents[inEvents.length - 1].getData(1));
      }
      eventArrived=true;
    }
  }
);
  InputHandler inputHandler=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  inputHandler.send(new Object[]{"String_Node_Str",700f,100l});
  Thread.sleep(100);
  inputHandler.send(new Object[]{"String_Node_Str",60.5f,200l});
  Thread.sleep(100);
  inputHandler.send(new Object[]{"String_Node_Str",60.5f,200l});
  Thread.sleep(100);
  Assert.assertEquals(3,count);
  Assert.assertTrue(eventArrived);
  executionPlanRuntime.shutdown();
}
Program: 29118
Project: 29118
Buggy source:
@Override public void restoreState(Object[] state){
  currentEventChunk=(ComplexEventChunk<StreamEvent>)state[0];
  expiredEventChunk=(ComplexEventChunk<StreamEvent>)state[1];
}

Fixed version (ground truth):
@Override public void restoreState(Object[] state){
  currentEventChunk.clear();
  currentEventChunk.add((StreamEvent)state[0]);
  expiredEventChunk.clear();
  expiredEventChunk.add((StreamEvent)state[1]);
}
Program: 29119
Project: 29119
Buggy source:
@Override public Object[] currentState(){
  return new Object[]{currentEventChunk,expiredEventChunk};
}

Fixed version (ground truth):
@Override public Object[] currentState(){
  return new Object[]{currentEventChunk.getFirst(),expiredEventChunk.getFirst()};
}
Program: 29120
Project: 29120
Buggy source:
@Override public void restoreState(Object[] state){
  currentEventChunk=(ComplexEventChunk<StreamEvent>)state[0];
  expiredEventChunk=(ComplexEventChunk<StreamEvent>)state[1];
  count=(Integer)state[2];
}

Fixed version (ground truth):
@Override public void restoreState(Object[] state){
  currentEventChunk.clear();
  currentEventChunk.add((StreamEvent)state[0]);
  expiredEventChunk.clear();
  expiredEventChunk.add((StreamEvent)state[1]);
  count=(Integer)state[2];
}
Program: 29121
Project: 29121
Buggy source:
@Override public Object[] currentState(){
  return new Object[]{currentEventChunk,expiredEventChunk,count};
}

Fixed version (ground truth):
@Override public Object[] currentState(){
  return new Object[]{currentEventChunk.getFirst(),expiredEventChunk.getFirst(),count};
}
Program: 29122
Project: 29122
Buggy source:
@Override public void restoreState(Object[] state){
  expiredEventChunk=(ComplexEventChunk<StreamEvent>)state[0];
  count=(Integer)state[1];
}

Fixed version (ground truth):
@Override public void restoreState(Object[] state){
  expiredEventChunk.clear();
  expiredEventChunk.add((StreamEvent)state[0]);
  count=(Integer)state[1];
}
Program: 29123
Project: 29123
Buggy source:
@Override public Object[] currentState(){
  return new Object[]{expiredEventChunk,count};
}

Fixed version (ground truth):
@Override public Object[] currentState(){
  return new Object[]{expiredEventChunk.getFirst(),count};
}
Program: 29124
Project: 29124
Buggy source:
@Override public void restoreState(Object[] state){
  expiredEventChunk=(ComplexEventChunk<StreamEvent>)state[0];
}

Fixed version (ground truth):
@Override public void restoreState(Object[] state){
  expiredEventChunk.clear();
  expiredEventChunk.add((StreamEvent)state[0]);
}
Program: 29125
Project: 29125
Buggy source:
@Override public Object[] currentState(){
  return new Object[]{expiredEventChunk};
}

Fixed version (ground truth):
@Override public Object[] currentState(){
  return new Object[]{expiredEventChunk.getFirst()};
}
Program: 29126
Project: 29126
Buggy source:
@Override public void restoreState(Object[] state){
  expiredEventChunk=(ComplexEventChunk<StreamEvent>)state[0];
}

Fixed version (ground truth):
@Override public void restoreState(Object[] state){
  expiredEventChunk.clear();
  expiredEventChunk.add((StreamEvent)state[0]);
}
Program: 29127
Project: 29127
Buggy source:
@Override public Object[] currentState(){
  return new Object[]{expiredEventChunk};
}

Fixed version (ground truth):
@Override public Object[] currentState(){
  return new Object[]{expiredEventChunk.getFirst()};
}
Program: 29128
Project: 29128
Buggy source:
protected ComplexEvent createSendEvent(ComplexEvent originalEvent,Map<Integer,Object> aggregateAttributeValueMap){
  ComplexEvent copiedEvent=null;
  if (originalEvent instanceof StreamEvent) {
    copiedEvent=streamEventCloner.copyStreamEvent((StreamEvent)originalEvent);
  }
 else   if (originalEvent instanceof StateEvent) {
    copiedEvent=stateEventCloner.copyStateEvent((StateEvent)originalEvent);
  }
  for (  Integer position : aggregateAttributePositionList) {
    copiedEvent.getOutputData()[position]=aggregateAttributeValueMap.get(position);
  }
  return copiedEvent;
}

Fixed version (ground truth):
protected ComplexEvent createSendEvent(ComplexEvent originalEvent,Map<Integer,Object> aggregateAttributeValueMap){
  ComplexEvent copiedEvent=cloneComplexEvent(originalEvent);
  for (  Integer position : aggregateAttributePositionList) {
    copiedEvent.getOutputData()[position]=aggregateAttributeValueMap.get(position);
  }
  return copiedEvent;
}