nus-yam/ex-repair huggingface dataset:
Program: 150279
Project: 150279
Buggy source:
/** 
 * Emit code to allocate a scalar object
 * @param method  the method this bytecode is compiled in
 * @param typeRef the VM_Class to instantiate
 */
protected final void emit_resolved_new(VM_Class typeRef){
  int instanceSize=typeRef.getInstanceSize();
  int tibOffset=typeRef.getTibOffset();
  int whichAllocator=MM_Interface.pickAllocator(typeRef);
  int align=VM_ObjectModel.getAlignment(typeRef);
  int offset=VM_ObjectModel.getOffsetForAlignment(typeRef);
  asm.emitPUSH_Imm(instanceSize);
  asm.emitPUSH_RegDisp(JTOC,tibOffset);
  asm.emitPUSH_Imm(typeRef.hasFinalizer() ? 1 : 0);
  asm.emitPUSH_Imm(whichAllocator);
  asm.emitPUSH_Imm(align);
  asm.emitPUSH_Imm(offset);
  genParameterRegisterLoad(6);
  asm.emitCALL_RegDisp(JTOC,VM_Entrypoints.resolvedNewScalarMethod.getOffset());
  asm.emitPUSH_Reg(T0);
}

Fixed version (ground truth):
/** 
 * Emit code to allocate a scalar object
 * @param method  the method this bytecode is compiled in
 * @param typeRef the VM_Class to instantiate
 */
protected final void emit_resolved_new(VM_Class typeRef){
  int instanceSize=typeRef.getInstanceSize();
  int tibOffset=typeRef.getTibOffset();
  int whichAllocator=MM_Interface.pickAllocator(typeRef,method);
  int align=VM_ObjectModel.getAlignment(typeRef);
  int offset=VM_ObjectModel.getOffsetForAlignment(typeRef);
  asm.emitPUSH_Imm(instanceSize);
  asm.emitPUSH_RegDisp(JTOC,tibOffset);
  asm.emitPUSH_Imm(typeRef.hasFinalizer() ? 1 : 0);
  asm.emitPUSH_Imm(whichAllocator);
  asm.emitPUSH_Imm(align);
  asm.emitPUSH_Imm(offset);
  genParameterRegisterLoad(6);
  asm.emitCALL_RegDisp(JTOC,VM_Entrypoints.resolvedNewScalarMethod.getOffset());
  asm.emitPUSH_Reg(T0);
}
Program: 150280
Project: 150280
Buggy source:
/** 
 * Prepare for a collection.
 */
protected final void prepare(){
  long start=VM_Interface.cycles();
  int order=VM_Interface.rendezvous(4230);
  if (order == 1) {
    setGcStatus(GC_PREPARE);
    baseGlobalPrepare(start);
  }
  VM_Interface.rendezvous(4240);
  if (order == 1)   for (int i=0; i < planCount; i++) {
    Plan p=plans[i];
    if (VM_Interface.isNonParticipating(p))     p.baseThreadLocalPrepare(NON_PARTICIPANT);
  }
  baseThreadLocalPrepare(order);
  if (order == 1) {
    VM_Interface.resetThreadCounter();
    setGcStatus(GC_PROPER);
  }
  VM_Interface.rendezvous(4250);
  if (Plan.MOVES_OBJECTS) {
    VM_Interface.preCopyGCInstances();
    VM_Interface.rendezvous(4260);
    if (order == 1)     VM_Interface.resetThreadCounter();
    VM_Interface.rendezvous(4270);
  }
}

Fixed version (ground truth):
/** 
 * Prepare for a collection.
 */
protected final void prepare(){
  long start=VM_Interface.cycles();
  int order=VM_Interface.rendezvous(4230);
  if (order == 1) {
    setGcStatus(GC_PREPARE);
    baseGlobalPrepare(start);
  }
  VM_Interface.rendezvous(4240);
  if (order == 1)   for (int i=0; i < planCount; i++) {
    Plan p=plans[i];
    if (VM_Interface.isNonParticipating(p))     p.baseThreadLocalPrepare(NON_PARTICIPANT);
  }
  baseThreadLocalPrepare(order);
  VM_Interface.rendezvous(4250);
  if (Plan.MOVES_OBJECTS) {
    VM_Interface.preCopyGCInstances();
    VM_Interface.rendezvous(4260);
    if (order == 1)     VM_Interface.resetThreadCounter();
    VM_Interface.rendezvous(4270);
  }
}
Program: 150282
Project: 150282
Buggy source:
/** 
 * Returns the appropriate allocation scheme/area for the given type and given method requesting the allocation.
 * @param type the type of the object to be allocated
 * @param method the method requesting the allocation
 * @return the identifier of the appropriate allocator
 */
public static int pickAllocator(VM_Type type,VM_Method method) throws VM_PragmaInterruptible {
  if (method != null) {
    VM_Class cls=method.getDeclaringClass();
    byte[] clsBA=cls.getDescriptor().toByteArray();
    if (isPrefix("String_Node_Str",clsBA)) {
      return Plan.IMMORTAL_SPACE;
    }
  }
  Type t=type.JMTKtype;
  if (t.initialized)   return t.allocator;
  int allocator=Plan.DEFAULT_SPACE;
  byte[] typeBA=type.getDescriptor().toByteArray();
  if (isPrefix("String_Node_Str",typeBA) || isPrefix("String_Node_Str",typeBA) || isPrefix("String_Node_Str",typeBA))   allocator=Plan.IMMORTAL_SPACE;
  t.initialized=true;
  t.allocator=allocator;
  return allocator;
}

Fixed version (ground truth):
/** 
 * Returns the appropriate allocation scheme/area for the given type and given method requesting the allocation.
 * @param type the type of the object to be allocated
 * @param method the method requesting the allocation
 * @return the identifier of the appropriate allocator
 */
public static int pickAllocator(VM_Type type,VM_Method method) throws VM_PragmaInterruptible {
  if (method != null) {
    VM_Class cls=method.getDeclaringClass();
    byte[] clsBA=cls.getDescriptor().toByteArray();
    if (isPrefix("String_Node_Str",clsBA) || isPrefix("String_Node_Str",clsBA)) {
      return Plan.IMMORTAL_SPACE;
    }
  }
  Type t=type.JMTKtype;
  if (t.initialized)   return t.allocator;
  int allocator=Plan.DEFAULT_SPACE;
  byte[] typeBA=type.getDescriptor().toByteArray();
  if (isPrefix("String_Node_Str",typeBA) || isPrefix("String_Node_Str",typeBA) || isPrefix("String_Node_Str",typeBA))   allocator=Plan.IMMORTAL_SPACE;
  t.initialized=true;
  t.allocator=allocator;
  return allocator;
}
Program: 150284
Project: 150284
Buggy source:
/** 
 * Reach up two stack frames into a frame that is compiled with the DynamicBridge register protocol and grap  the receiver object of the invoke (ie the first param). NOTE: assumes that caller has disabled GC.
 */
static Object getReceiverObject() throws VM_PragmaNoInline {
  VM_Address callingFrame=VM_Magic.getCallerFramePointer(VM_Magic.getFramePointer());
  callingFrame=VM_Magic.getCallerFramePointer(callingFrame);
  callingFrame=VM_Magic.getCallerFramePointer(callingFrame);
  VM_Address location=callingFrame.sub((LAST_NONVOLATILE_FPR - FIRST_VOLATILE_FPR + 1) * 8 + (LAST_NONVOLATILE_GPR - FIRST_VOLATILE_GPR + 1) * 4);
  return VM_Magic.addressAsObject(VM_Magic.getMemoryAddress(location));
}

Fixed version (ground truth):
/** 
 * Reach up two stack frames into a frame that is compiled with the DynamicBridge register protocol and grap  the receiver object of the invoke (ie the first param). NOTE: assumes that caller has disabled GC.
 */
static Object getReceiverObject() throws VM_PragmaNoInline {
  VM_Address callingFrame=VM_Magic.getCallerFramePointer(VM_Magic.getFramePointer());
  callingFrame=VM_Magic.getCallerFramePointer(callingFrame);
  callingFrame=VM_Magic.getCallerFramePointer(callingFrame);
  VM_Address location=callingFrame.sub((LAST_NONVOLATILE_FPR - FIRST_VOLATILE_FPR + 1) * BYTES_IN_DOUBLE + (LAST_NONVOLATILE_GPR - FIRST_VOLATILE_GPR + 1) * BYTES_IN_ADDRESS);
  return VM_Magic.addressAsObject(VM_Magic.getMemoryAddress(location));
}
Program: 150285
Project: 150285
Buggy source:
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>all threads</i> execute this.<p> In this case, it means flushing the remsets, rebinding the nursery, and if a full heap collection, preparing the mature space and LOS.
 */
protected final void threadLocalPrepare(int count){
  nursery.rebind(nurseryVM);
  if (fullHeapGC) {
    threadLocalMaturePrepare(count);
    if (Plan.usesLOS)     los.prepare();
    remset.resetLocal();
  }
}

Fixed version (ground truth):
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>all threads</i> execute this.<p> In this case, it means flushing the remsets, rebinding the nursery, and if a full heap collection, preparing the mature space and LOS.
 */
protected final void threadLocalPrepare(int count){
  nursery.rebind(nurseryVM);
  if (fullHeapGC) {
    threadLocalMaturePrepare(count);
    if (Plan.usesLOS)     los.prepare();
    remset.resetLocal();
  }
 else {
    if (count == NON_PARTICIPANT)     flushRememberedSets();
  }
}
Program: 150286
Project: 150286
Buggy source:
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>prepare()</code> which will ensure that <i>all threads</i> execute this.<p> After performing generic operations, <code>threadLocalPrepare()</code> is called to perform subclass-specific operations.
 * @param order A unique ordering placed on the threads by thecaller's use of <code>rendezvous</code>.
 */
public final void baseThreadLocalPrepare(int order){
  if (order == NON_PARTICIPANT)   VM_Interface.prepareNonParticipating((Plan)this);
 else {
    VM_Interface.prepareParticipating((Plan)this);
    VM_Interface.rendezvous(4260);
  }
  if (Options.verbose >= 4)   Log.writeln("String_Node_Str");
  threadLocalPrepare(order);
}

Fixed version (ground truth):
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>prepare()</code> which will ensure that <i>all threads</i> execute this.<p> After performing generic operations, <code>threadLocalPrepare()</code> is called to perform subclass-specific operations.
 * @param order A unique ordering placed on the threads by thecaller's use of <code>rendezvous</code>.
 */
public final void baseThreadLocalPrepare(int order){
  if (order == NON_PARTICIPANT) {
    VM_Interface.prepareNonParticipating((Plan)this);
  }
 else {
    VM_Interface.prepareParticipating((Plan)this);
    VM_Interface.rendezvous(4260);
  }
  if (Options.verbose >= 4)   Log.writeln("String_Node_Str");
  threadLocalPrepare(order);
}
Program: 150287
Project: 150287
Buggy source:
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>all threads</i> execute this.<p> In this case, it means flushing the remsets, rebinding the nursery, and if a full heap collection, preparing the mature space and LOS.
 */
protected final void threadLocalPrepare(int count){
  nursery.rebind(nurseryVM);
  if (fullHeapGC) {
    threadLocalMaturePrepare(count);
    if (Plan.usesLOS)     los.prepare();
    remset.resetLocal();
  }
}

Fixed version (ground truth):
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>all threads</i> execute this.<p> In this case, it means flushing the remsets, rebinding the nursery, and if a full heap collection, preparing the mature space and LOS.
 */
protected final void threadLocalPrepare(int count){
  nursery.rebind(nurseryVM);
  if (fullHeapGC) {
    threadLocalMaturePrepare(count);
    if (Plan.usesLOS)     los.prepare();
    remset.resetLocal();
  }
 else {
    if (count == NON_PARTICIPANT)     flushRememberedSets();
  }
}
Program: 150288
Project: 150288
Buggy source:
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>prepare()</code> which will ensure that <i>all threads</i> execute this.<p> After performing generic operations, <code>threadLocalPrepare()</code> is called to perform subclass-specific operations.
 * @param order A unique ordering placed on the threads by thecaller's use of <code>rendezvous</code>.
 */
public final void baseThreadLocalPrepare(int order){
  if (order == NON_PARTICIPANT)   VM_Interface.prepareNonParticipating((Plan)this);
 else {
    VM_Interface.prepareParticipating((Plan)this);
    VM_Interface.rendezvous(4260);
  }
  if (Options.verbose >= 4)   Log.writeln("String_Node_Str");
  threadLocalPrepare(order);
}

Fixed version (ground truth):
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>prepare()</code> which will ensure that <i>all threads</i> execute this.<p> After performing generic operations, <code>threadLocalPrepare()</code> is called to perform subclass-specific operations.
 * @param order A unique ordering placed on the threads by thecaller's use of <code>rendezvous</code>.
 */
public final void baseThreadLocalPrepare(int order){
  if (order == NON_PARTICIPANT) {
    VM_Interface.prepareNonParticipating((Plan)this);
  }
 else {
    VM_Interface.prepareParticipating((Plan)this);
    VM_Interface.rendezvous(4260);
  }
  if (Options.verbose >= 4)   Log.writeln("String_Node_Str");
  threadLocalPrepare(order);
}
Program: 150289
Project: 150289
Buggy source:
@Override public Void call(){
  try {
    for (    MessageAndMetadata<Message> mam : stream) {
      BagheeraMessage bmsg=BagheeraMessage.parseFrom(ByteString.copyFrom(mam.message().payload()));
      KeyValueSink sink=sinkFactory.getSink(bmsg.getNamespace());
      if (sink == null) {
        LOG.error("String_Node_Str" + bmsg.getNamespace());
        break;
      }
      if (bmsg.getOperation() == Operation.CREATE_UPDATE && bmsg.hasId() && bmsg.hasPayload()) {
        if (validationPipeline == null || validationPipeline.isValid(bmsg.getPayload().toByteArray())) {
          if (bmsg.hasTimestamp()) {
            sink.store(bmsg.getId(),bmsg.getPayload().toByteArray(),bmsg.getTimestamp());
          }
 else {
            sink.store(bmsg.getId(),bmsg.getPayload().toByteArray());
          }
        }
 else {
          LOG.warn("String_Node_Str" + bmsg.getNamespace());
        }
      }
 else       if (bmsg.getOperation() == Operation.DELETE && bmsg.hasId()) {
        sink.delete(bmsg.getId());
      }
      consumed.mark();
    }
  }
 catch (  InvalidProtocolBufferException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  UnsupportedEncodingException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    latch.countDown();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void call(){
  try {
    for (    MessageAndMetadata<Message> mam : stream) {
      BagheeraMessage bmsg=BagheeraMessage.parseFrom(ByteString.copyFrom(mam.message().payload()));
      KeyValueSink sink=sinkFactory.getSink(bmsg.getNamespace());
      if (sink == null) {
        LOG.error("String_Node_Str" + bmsg.getNamespace());
        break;
      }
      if (bmsg.getOperation() == Operation.CREATE_UPDATE && bmsg.hasId() && bmsg.hasPayload()) {
        if (validationPipeline == null || validationPipeline.isValid(bmsg.getPayload().toByteArray())) {
          if (bmsg.hasTimestamp()) {
            sink.store(bmsg.getId(),bmsg.getPayload().toByteArray(),bmsg.getTimestamp());
          }
 else {
            sink.store(bmsg.getId(),bmsg.getPayload().toByteArray());
          }
        }
 else {
          invalidMessageMeter.mark();
          LOG.warn("String_Node_Str" + bmsg.getNamespace());
        }
      }
 else       if (bmsg.getOperation() == Operation.DELETE && bmsg.hasId()) {
        sink.delete(bmsg.getId());
      }
      consumed.mark();
    }
  }
 catch (  InvalidProtocolBufferException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  UnsupportedEncodingException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    latch.countDown();
  }
  return null;
}
Program: 150290
Project: 150290
Buggy source:
public KafkaConsumer(String topic,Properties props,int numThreads){
  LOG.info("String_Node_Str" + numThreads);
  executor=Executors.newFixedThreadPool(numThreads);
  workers=new ArrayList<Future<Void>>(numThreads);
  ConsumerConfig consumerConfig=new ConsumerConfig(props);
  consumerConnector=kafka.consumer.Consumer.createJavaConsumerConnector(consumerConfig);
  streams=consumerConnector.createMessageStreamsByFilter(new Whitelist(topic),numThreads);
  consumed=Metrics.newMeter(new MetricName("String_Node_Str","String_Node_Str",topic + "String_Node_Str"),"String_Node_Str",TimeUnit.SECONDS);
}

Fixed version (ground truth):
public KafkaConsumer(String topic,Properties props,int numThreads){
  LOG.info("String_Node_Str" + numThreads);
  executor=Executors.newFixedThreadPool(numThreads);
  workers=new ArrayList<Future<Void>>(numThreads);
  ConsumerConfig consumerConfig=new ConsumerConfig(props);
  consumerConnector=kafka.consumer.Consumer.createJavaConsumerConnector(consumerConfig);
  streams=consumerConnector.createMessageStreamsByFilter(new Whitelist(topic),numThreads);
  consumed=Metrics.newMeter(new MetricName("String_Node_Str","String_Node_Str",topic + "String_Node_Str"),"String_Node_Str",TimeUnit.SECONDS);
  invalidMessageMeter=Metrics.newMeter(new MetricName("String_Node_Str","String_Node_Str",topic + "String_Node_Str"),"String_Node_Str",TimeUnit.SECONDS);
}
Program: 150294
Project: 150294
Buggy source:
/** 
 * Takes a given id and gives you an hbase shell compatible string that you can use for get command.
 * @param id
 * @param d
 * @return
 * @throws IOException
 */
public static String hbaseShellId(String id,Date d) throws IOException {
  byte[] idBytes=IdUtil.nonRandByteBucketizeId(id,d);
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(String.format("String_Node_Str",idBytes[0]));
  sb.append((new String(idBytes)).substring(1));
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public static String hbaseShellId(byte[] idBytes) throws IOException {
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(String.format("String_Node_Str",idBytes[0]));
  sb.append((new String(idBytes)).substring(1));
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 150295
Project: 150295
Buggy source:
public void run() throws Exception {
  this.configureHealthChecks();
  this.configureWebServer();
  this.configureReporters();
}

Fixed version (ground truth):
public void run() throws Exception {
  this.configureHealthChecks();
  this.configureWebServer();
  this.configureReporters();
  this.configureHttpMetrics();
}
Program: 150296
Project: 150296
Buggy source:
private void updateFailed(HttpMetrics metric,Integer size){
  HttpMetrics global_metric=getHttpMetrics("String_Node_Str");
  metric.failedReqsCount.inc();
  metric.failedReqsSize.inc(size);
  metric.totalReqsCount.inc();
  metric.totalReqsSize.inc(size);
  global_metric.failedReqsCount.inc();
  global_metric.failedReqsSize.inc(size);
  global_metric.totalReqsCount.inc();
  global_metric.totalReqsSize.inc(size);
}

Fixed version (ground truth):
private void updateFailed(String namespace,int size){
  MetricsManager.getInstance().getHttpMetricForNamespace(namespace).updateFailed(size);
  MetricsManager.getInstance().getGlobalHttpMetric().updateFailed(size);
}
Program: 150297
Project: 150297
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  Object msg=e.getMessage();
  HttpMetrics metric=this.getHttpMetrics("String_Node_Str");
  if (msg instanceof HttpRequest) {
    HttpRequest request=(HttpRequest)e.getMessage();
    PathDecoder pd=new PathDecoder(request.getUri());
    String endpoint=pd.getPathElement(ENDPOINT_PATH_IDX);
    if (endpoint != null && ENDPOINT_SUBMIT.equals(endpoint)) {
      String namespace=pd.getPathElement(NAMESPACE_PATH_IDX);
      String id=pd.getPathElement(ID_PATH_IDX);
      if (id == null) {
        id=UUID.randomUUID().toString();
      }
      IMap<String,String> m=Hazelcast.getMap(namespace);
      if (request.getMethod() == HttpMethod.POST || request.getMethod() == HttpMethod.PUT) {
        handlePost(e,request,namespace,id,m);
      }
 else       if (request.getMethod() == HttpMethod.GET) {
        handleGet(e,request,namespace,id,m);
      }
 else       if (request.getMethod() == HttpMethod.DELETE) {
        handleDelete(e,request,namespace,id,m);
      }
 else {
        writeResponse(NOT_FOUND,e,null);
      }
    }
 else {
      String userAgent=request.getHeader("String_Node_Str");
      String remoteIpAddress=e.getChannel().getRemoteAddress().toString();
      LOG.warn(String.format("String_Node_Str",remoteIpAddress,userAgent));
      writeResponse(NOT_ACCEPTABLE,e,null);
    }
  }
 else {
    writeResponse(INTERNAL_SERVER_ERROR,e,null);
  }
}

Fixed version (ground truth):
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  Object msg=e.getMessage();
  if (msg instanceof HttpRequest) {
    HttpRequest request=(HttpRequest)e.getMessage();
    PathDecoder pd=new PathDecoder(request.getUri());
    String endpoint=pd.getPathElement(ENDPOINT_PATH_IDX);
    if (endpoint != null && ENDPOINT_SUBMIT.equals(endpoint)) {
      String namespace=pd.getPathElement(NAMESPACE_PATH_IDX);
      String id=pd.getPathElement(ID_PATH_IDX);
      if (id == null) {
        id=UUID.randomUUID().toString();
      }
      IMap<String,String> m=Hazelcast.getMap(namespace);
      if (request.getMethod() == HttpMethod.POST || request.getMethod() == HttpMethod.PUT) {
        handlePost(e,request,namespace,id,m);
      }
 else       if (request.getMethod() == HttpMethod.GET) {
        handleGet(e,request,namespace,id,m);
      }
 else       if (request.getMethod() == HttpMethod.DELETE) {
        handleDelete(e,request,namespace,id,m);
      }
 else {
        writeResponse(NOT_FOUND,e,null);
      }
    }
 else {
      String userAgent=request.getHeader("String_Node_Str");
      String remoteIpAddress=e.getChannel().getRemoteAddress().toString();
      LOG.warn(String.format("String_Node_Str",remoteIpAddress,userAgent));
      writeResponse(NOT_ACCEPTABLE,e,null);
    }
  }
 else {
    writeResponse(INTERNAL_SERVER_ERROR,e,null);
  }
}
Program: 150298
Project: 150298
Buggy source:
private void handlePost(MessageEvent e,HttpRequest request,String namespace,String id,IMap<String,String> m){
  HttpResponseStatus status=NOT_ACCEPTABLE;
  ChannelBuffer content=request.getContent();
  HttpMetrics ns_metric=getHttpMetrics(namespace);
  if (content.readable() && content.readableBytes() > 0) {
    if (NS_METRICS.equals(namespace)) {
      status=metricsProcessor.process(m,id,content.toString(CharsetUtil.UTF_8),e.getChannel().getRemoteAddress().toString(),request.getHeader("String_Node_Str"));
    }
 else {
      m.put(id,content.toString(CharsetUtil.UTF_8));
      status=CREATED;
    }
  }
  if (status != CREATED) {
    updateFailed(ns_metric,content.readableBytes());
  }
 else {
    updateSuccessful(ns_metric,content.readableBytes());
  }
  writeResponse(status,e,URI.create(id).toString());
}

Fixed version (ground truth):
private void handlePost(MessageEvent e,HttpRequest request,String namespace,String id,IMap<String,String> m){
  HttpResponseStatus status=NOT_ACCEPTABLE;
  ChannelBuffer content=request.getContent();
  if (content.readable() && content.readableBytes() > 0) {
    if (NS_METRICS.equals(namespace)) {
      status=metricsProcessor.process(m,id,content.toString(CharsetUtil.UTF_8),e.getChannel().getRemoteAddress().toString(),request.getHeader("String_Node_Str"));
    }
 else {
      m.put(id,content.toString(CharsetUtil.UTF_8));
      status=CREATED;
    }
  }
  if (status != CREATED) {
    updateFailed(namespace,content.readableBytes());
  }
 else {
    updateSuccesssful(namespace,content.readableBytes());
  }
  writeResponse(status,e,URI.create(id).toString());
}
Program: 150299
Project: 150299
Buggy source:
public HttpResponseStatus process(IMap<String,String> hcMap,String id,String newDocument,String remoteAddr,String obsoleteDocId){
  HttpResponseStatus status=NOT_ACCEPTABLE;
  try {
    ObjectNode aggregate=objectMapper.readValue(newDocument,ObjectNode.class);
    if (isValidDocument(aggregate)) {
      setGeoLocation(aggregate,remoteAddr);
      hcMap.put(id,objectMapper.writeValueAsString(aggregate));
      if (obsoleteDocId != null) {
        hcMap.remove(id);
      }
      status=HttpResponseStatus.CREATED;
    }
 else {
      LOG.error("String_Node_Str");
    }
  }
 catch (  JsonParseException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  JsonMappingException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
  return status;
}

Fixed version (ground truth):
public HttpResponseStatus process(IMap<String,String> hcMap,String id,String newDocument,String remoteAddr,String obsoleteDocId){
  HttpResponseStatus status=NOT_ACCEPTABLE;
  try {
    ObjectNode aggregate=objectMapper.readValue(newDocument,ObjectNode.class);
    if (isValidDocument(aggregate)) {
      setGeoLocation(aggregate,remoteAddr);
      hcMap.put(id,objectMapper.writeValueAsString(aggregate));
      if (obsoleteDocId != null) {
        hcMap.remove(obsoleteDocId);
      }
      status=HttpResponseStatus.CREATED;
    }
 else {
      LOG.error("String_Node_Str");
    }
  }
 catch (  JsonParseException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  JsonMappingException e) {
    LOG.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
  return status;
}
Program: 150300
Project: 150300
Buggy source:
public void poll() throws InterruptedException {
  while (true) {
    if (!nsMap.isEmpty()) {
      try {
        List<Put> puts=new ArrayList<Put>();
        for (        String k : nsMap.keySet()) {
          String v=nsMap.remove(k);
          if (v != null) {
            byte[] rowId=prefixDate ? IdUtil.bucketizeId(k) : Bytes.toBytes(k);
            Put p=new Put(rowId);
            p.add(family,qualifier,Bytes.toBytes(v));
            puts.add(p);
            if (puts.size() >= batchSize)             break;
          }
        }
        if (puts.size() > 0) {
          workerPool.submit(new HBaseWorkerThread((HTable)hbasePool.getTable(tableName),puts));
        }
      }
 catch (      IOException e) {
        LOG.error("String_Node_Str",e);
        throw new RuntimeException(e);
      }
    }
 else {
      Thread.sleep(sleepTime);
    }
  }
}

Fixed version (ground truth):
public void poll() throws InterruptedException {
  while (true) {
    if (!nsMap.isEmpty()) {
      try {
        List<Put> puts=new ArrayList<Put>();
        for (        String k : nsMap.keySet()) {
          String v=nsMap.remove(k);
          if (v != null) {
            try {
              byte[] rowId=prefixDate ? IdUtil.bucketizeId(k) : Bytes.toBytes(k);
              Put p=new Put(rowId);
              p.add(family,qualifier,Bytes.toBytes(v));
              puts.add(p);
            }
 catch (            NumberFormatException e) {
              LOG.error("String_Node_Str" + k,e);
            }
            if (puts.size() >= batchSize)             break;
          }
        }
        if (puts.size() > 0) {
          workerPool.submit(new HBaseWorkerThread((HTable)hbasePool.getTable(tableName),puts));
        }
      }
 catch (      IOException e) {
        LOG.error("String_Node_Str",e);
        throw new RuntimeException(e);
      }
    }
 else {
      Thread.sleep(sleepTime);
    }
  }
}
Program: 150301
Project: 150301
Buggy source:
@Override public void storeAll(Map<String,String> pairs){
  HTable table=null;
  try {
    List<Put> puts=new ArrayList<Put>(pairs.size());
    for (    Map.Entry<String,String> pair : pairs.entrySet()) {
      byte[] rowId=prefixDate ? IdUtil.bucketizeId(pair.getKey()) : Bytes.toBytes(pair.getKey());
      Put p=new Put(rowId);
      if (outputFormatType == StoreFormatType.SMILE) {
        p.add(family,qualifier,jsonSmileConverter.convertToSmile(pair.getValue()));
      }
 else {
        p.add(family,qualifier,Bytes.toBytes(pair.getValue()));
      }
      puts.add(p);
    }
    table=(HTable)pool.getTable(tableName);
    table.setAutoFlush(false);
    table.put(puts);
    table.flushCommits();
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    if (table != null) {
      pool.putTable(table);
    }
  }
}

Fixed version (ground truth):
@Override public void storeAll(Map<String,String> pairs){
  HTable table=null;
  try {
    List<Put> puts=new ArrayList<Put>(pairs.size());
    for (    Map.Entry<String,String> pair : pairs.entrySet()) {
      try {
        byte[] rowId=prefixDate ? IdUtil.bucketizeId(pair.getKey()) : Bytes.toBytes(pair.getKey());
        Put p=new Put(rowId);
        if (outputFormatType == StoreFormatType.SMILE) {
          p.add(family,qualifier,jsonSmileConverter.convertToSmile(pair.getValue()));
        }
 else {
          p.add(family,qualifier,Bytes.toBytes(pair.getValue()));
        }
        puts.add(p);
      }
 catch (      NumberFormatException nfe) {
        LOG.error("String_Node_Str" + pair.getKey(),nfe);
      }
    }
    table=(HTable)pool.getTable(tableName);
    table.setAutoFlush(false);
    table.put(puts);
    table.flushCommits();
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    if (table != null) {
      pool.putTable(table);
    }
  }
}
Program: 150302
Project: 150302
Buggy source:
@Override public void store(String key,String value){
  HTableInterface table=null;
  try {
    table=pool.getTable(tableName);
    byte[] rowId=prefixDate ? IdUtil.bucketizeId(key) : Bytes.toBytes(key);
    Put p=new Put(rowId);
    if (outputFormatType == StoreFormatType.SMILE) {
      p.add(family,qualifier,jsonSmileConverter.convertToSmile(value));
    }
 else {
      p.add(family,qualifier,Bytes.toBytes(value));
    }
    table.put(p);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    if (table != null) {
      pool.putTable(table);
    }
  }
}

Fixed version (ground truth):
@Override public void store(String key,String value){
  HTableInterface table=null;
  try {
    table=pool.getTable(tableName);
    try {
      byte[] rowId=prefixDate ? IdUtil.bucketizeId(key) : Bytes.toBytes(key);
      Put p=new Put(rowId);
      if (outputFormatType == StoreFormatType.SMILE) {
        p.add(family,qualifier,jsonSmileConverter.convertToSmile(value));
      }
 else {
        p.add(family,qualifier,Bytes.toBytes(value));
      }
      table.put(p);
    }
 catch (    NumberFormatException nfe) {
      LOG.error("String_Node_Str" + key,nfe);
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    if (table != null) {
      pool.putTable(table);
    }
  }
}
Program: 150303
Project: 150303
Buggy source:
public static void main(String[] args){
  int port=Integer.parseInt(System.getProperty("String_Node_Str","String_Node_Str"));
  Hazelcast.getDefaultInstance();
  Config config=Hazelcast.getConfig();
  for (  Map.Entry<String,MapConfig> entry : config.getMapConfigs().entrySet()) {
    String mapName=entry.getKey();
    if (!mapName.contains("String_Node_Str")) {
      Hazelcast.getMap(entry.getKey());
    }
  }
  NioServerSocketChannelFactory channelFactory=new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),Executors.newCachedThreadPool());
  ServerBootstrap sb=new ServerBootstrap(channelFactory);
  HttpServerPipelineFactory pipeFactory;
  try {
    pipeFactory=new HttpServerPipelineFactory(config.getMapConfigs().keySet());
    sb.setPipelineFactory(pipeFactory);
    sb.bind(new InetSocketAddress(port));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  int port=Integer.parseInt(System.getProperty("String_Node_Str","String_Node_Str"));
  Hazelcast.getDefaultInstance();
  Config config=Hazelcast.getConfig();
  for (  Map.Entry<String,MapConfig> entry : config.getMapConfigs().entrySet()) {
    String mapName=entry.getKey();
    if (!mapName.contains("String_Node_Str")) {
      Hazelcast.getMap(entry.getKey());
    }
  }
  NioServerSocketChannelFactory channelFactory=new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),Executors.newFixedThreadPool(DEFAULT_IO_THREADS));
  ServerBootstrap sb=new ServerBootstrap(channelFactory);
  HttpServerPipelineFactory pipeFactory;
  try {
    pipeFactory=new HttpServerPipelineFactory(config.getMapConfigs().keySet());
    sb.setPipelineFactory(pipeFactory);
    sb.setOption("String_Node_Str",true);
    sb.setOption("String_Node_Str",false);
    sb.bind(new InetSocketAddress(port));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
}
Program: 150304
Project: 150304
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  Object msg=e.getMessage();
  if (msg instanceof HttpRequest) {
    HttpRequest request=(HttpRequest)e.getMessage();
    PathDecoder pd=new PathDecoder(request.getUri());
    String endpoint=pd.getPathElement(ENDPOINT_PATH_IDX);
    if (endpoint != null && ENDPOINT_SUBMIT.equals(endpoint)) {
      String namespace=pd.getPathElement(NAMESPACE_PATH_IDX);
      String id=pd.getPathElement(ID_PATH_IDX);
      if (id == null) {
        id=UUID.randomUUID().toString();
      }
      IMap<String,String> m=Hazelcast.getMap(namespace);
      if (request.getMethod() == HttpMethod.POST || request.getMethod() == HttpMethod.PUT) {
        handlePost(e,request,namespace,id,m);
      }
 else       if (request.getMethod() == HttpMethod.GET) {
        handleGet(e,request,namespace,id,m);
      }
 else       if (request.getMethod() == HttpMethod.DELETE) {
        handleDelete(e,request,namespace,id,m);
      }
 else {
        writeResponse(NOT_FOUND,e,null);
      }
    }
 else     if (endpoint != null && ENDPOINT_STATS.equals("String_Node_Str")) {
      writeResponse(OK,e,null);
    }
 else {
      String userAgent=request.getHeader("String_Node_Str");
      String remoteIpAddress=e.getChannel().getRemoteAddress().toString();
      LOG.warn(String.format("String_Node_Str",remoteIpAddress,userAgent));
      writeResponse(NOT_ACCEPTABLE,e,null);
    }
  }
 else {
    writeResponse(INTERNAL_SERVER_ERROR,e,null);
  }
}

Fixed version (ground truth):
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  Object msg=e.getMessage();
  if (msg instanceof HttpRequest) {
    HttpRequest request=(HttpRequest)e.getMessage();
    PathDecoder pd=new PathDecoder(request.getUri());
    String endpoint=pd.getPathElement(ENDPOINT_PATH_IDX);
    if (endpoint != null && ENDPOINT_SUBMIT.equals(endpoint)) {
      String namespace=pd.getPathElement(NAMESPACE_PATH_IDX);
      String id=pd.getPathElement(ID_PATH_IDX);
      if (id == null) {
        id=UUID.randomUUID().toString();
      }
      IMap<String,String> m=Hazelcast.getMap(namespace);
      if (request.getMethod() == HttpMethod.POST || request.getMethod() == HttpMethod.PUT) {
        handlePost(e,request,namespace,id,m);
      }
 else       if (request.getMethod() == HttpMethod.GET) {
        handleGet(e,request,namespace,id,m);
      }
 else       if (request.getMethod() == HttpMethod.DELETE) {
        handleDelete(e,request,namespace,id,m);
      }
 else {
        writeResponse(NOT_FOUND,e,null);
      }
    }
 else {
      String userAgent=request.getHeader("String_Node_Str");
      String remoteIpAddress=e.getChannel().getRemoteAddress().toString();
      LOG.warn(String.format("String_Node_Str",remoteIpAddress,userAgent));
      writeResponse(NOT_ACCEPTABLE,e,null);
    }
  }
 else {
    writeResponse(INTERNAL_SERVER_ERROR,e,null);
  }
}
Program: 150305
Project: 150305
Buggy source:
@Override public void exceptionCaught(ChannelHandlerContext ctx,ExceptionEvent e) throws Exception {
  Throwable cause=e.getCause();
  HttpResponse response=null;
  if (cause instanceof InvalidJsonException) {
    LOG.error(cause.getMessage());
    response=new DefaultHttpResponse(HTTP_1_1,NOT_ACCEPTABLE);
  }
 else   if (cause instanceof TooLongFrameException) {
    response=new DefaultHttpResponse(HTTP_1_1,REQUEST_ENTITY_TOO_LARGE);
  }
 else   if (cause instanceof InvalidPathException) {
    response=new DefaultHttpResponse(HTTP_1_1,NOT_FOUND);
  }
 else   if (cause instanceof SecurityException) {
    LOG.error(cause.getMessage());
    response=new DefaultHttpResponse(HTTP_1_1,FORBIDDEN);
  }
 else {
    LOG.error(cause.getMessage());
    response=new DefaultHttpResponse(HTTP_1_1,INTERNAL_SERVER_ERROR);
  }
  response.addHeader(CONTENT_TYPE,"String_Node_Str");
  ChannelFuture future=e.getChannel().write(response);
  future.addListener(ChannelFutureListener.CLOSE);
}

Fixed version (ground truth):
@Override public void exceptionCaught(ChannelHandlerContext ctx,ExceptionEvent e) throws Exception {
  Throwable cause=e.getCause();
  HttpResponse response=null;
  if (cause instanceof InvalidJsonException) {
    LOG.error(cause.getMessage());
    response=new DefaultHttpResponse(HTTP_1_1,NOT_ACCEPTABLE);
  }
 else   if (cause instanceof TooLongFrameException) {
    response=new DefaultHttpResponse(HTTP_1_1,REQUEST_ENTITY_TOO_LARGE);
  }
 else   if (cause instanceof InvalidPathException) {
    response=new DefaultHttpResponse(HTTP_1_1,NOT_FOUND);
  }
 else   if (cause instanceof HttpSecurityException) {
    LOG.error(cause.getMessage());
    response=new DefaultHttpResponse(HTTP_1_1,FORBIDDEN);
  }
 else {
    LOG.error(cause.getMessage());
    response=new DefaultHttpResponse(HTTP_1_1,INTERNAL_SERVER_ERROR);
  }
  response.addHeader(CONTENT_TYPE,"String_Node_Str");
  ChannelFuture future=e.getChannel().write(response);
  future.addListener(ChannelFutureListener.CLOSE);
}
Program: 150306
Project: 150306
Buggy source:
private void handlePost(MessageEvent e,HttpRequest request,String namespace,String id,IMap<String,String> m){
  HttpResponseStatus status=NOT_FOUND;
  ChannelBuffer content=request.getContent();
  if (content.readable()) {
    if (NS_METRICS.equals(namespace)) {
      status=metricsProcessor.process(m,id,content.toString(CharsetUtil.UTF_8),e.getChannel().getRemoteAddress().toString(),request.getHeader("String_Node_Str"));
    }
 else {
      m.put(id,content.toString(CharsetUtil.UTF_8));
      status=CREATED;
    }
  }
  writeResponse(status,e,URI.create(id).toString());
}

Fixed version (ground truth):
private void handlePost(MessageEvent e,HttpRequest request,String namespace,String id,IMap<String,String> m){
  HttpResponseStatus status=NOT_ACCEPTABLE;
  ChannelBuffer content=request.getContent();
  if (content.readable() && content.readableBytes() > 0) {
    if (NS_METRICS.equals(namespace)) {
      status=metricsProcessor.process(m,id,content.toString(CharsetUtil.UTF_8),e.getChannel().getRemoteAddress().toString(),request.getHeader("String_Node_Str"));
    }
 else {
      m.put(id,content.toString(CharsetUtil.UTF_8));
      status=CREATED;
    }
  }
  writeResponse(status,e,URI.create(id).toString());
}
Program: 150307
Project: 150307
Buggy source:
public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=Channels.pipeline();
  pipeline.addLast("String_Node_Str",new HttpRequestDecoder());
  pipeline.addLast("String_Node_Str",new HttpChunkAggregator(maxContentLength));
  pipeline.addLast("String_Node_Str",new ContentLengthFilter(maxContentLength));
  pipeline.addLast("String_Node_Str",new HttpContentDecompressor());
  pipeline.addLast("String_Node_Str",new HttpResponseEncoder());
  pipeline.addLast("String_Node_Str",new UriPatternFilter(validator));
  pipeline.addLast("String_Node_Str",new AccessFilter(validator,HazelcastMapHandler.NAMESPACE_PATH_IDX,props));
  pipeline.addLast("String_Node_Str",new JsonFilter(validator));
  pipeline.addLast("String_Node_Str",new HazelcastMapHandler(metricsProcessor));
  return pipeline;
}

Fixed version (ground truth):
public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=Channels.pipeline();
  pipeline.addLast("String_Node_Str",new HttpRequestDecoder());
  pipeline.addLast("String_Node_Str",new RootResponse());
  pipeline.addLast("String_Node_Str",new StatsHandler());
  pipeline.addLast("String_Node_Str",new HttpChunkAggregator(maxContentLength));
  pipeline.addLast("String_Node_Str",new ContentLengthFilter(maxContentLength));
  pipeline.addLast("String_Node_Str",new AccessFilter(validator,HazelcastMapHandler.NAMESPACE_PATH_IDX,props));
  pipeline.addLast("String_Node_Str",new HttpContentDecompressor());
  pipeline.addLast("String_Node_Str",new JsonFilter(validator));
  pipeline.addLast("String_Node_Str",new HttpResponseEncoder());
  pipeline.addLast("String_Node_Str",new HazelcastMapHandler(metricsProcessor));
  return pipeline;
}
Program: 150308
Project: 150308
Buggy source:
public AccessFilter(NamespaceValidator nsValidator,int nsPathIdx,WildcardProperties props){
  this.nsValidator=nsValidator;
  this.nsPathIdx=nsPathIdx;
  this.props=props;
}

Fixed version (ground truth):
public AccessFilter(Validator validator,int nsPathIdx,WildcardProperties props){
  this.validator=validator;
  this.nsPathIdx=nsPathIdx;
  this.props=props;
}
Program: 150310
Project: 150310
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  Object msg=e.getMessage();
  if (msg instanceof HttpRequest) {
    HttpRequest request=(HttpRequest)e.getMessage();
    ChannelBuffer content=request.getContent();
    if (content.readable()) {
      if (!jsonValidator.isValidJson(content.toString(CharsetUtil.UTF_8))) {
        throw new InvalidJsonException("String_Node_Str");
      }
 else {
        Channels.fireMessageReceived(ctx,request,e.getRemoteAddress());
      }
    }
  }
 else {
    ctx.sendUpstream(e);
  }
}

Fixed version (ground truth):
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  Object msg=e.getMessage();
  if (msg instanceof HttpRequest) {
    HttpRequest request=(HttpRequest)e.getMessage();
    ChannelBuffer content=request.getContent();
    if (content.readable()) {
      if (!jsonValidator.isValidJson(content.toString(CharsetUtil.UTF_8))) {
        throw new InvalidJsonException("String_Node_Str");
      }
    }
    Channels.fireMessageReceived(ctx,request,e.getRemoteAddress());
  }
 else {
    ctx.sendUpstream(e);
  }
}
Program: 150311
Project: 150311
Buggy source:
@GET @Produces(MediaType.TEXT_PLAIN) public Response getStats(){
  StringBuilder sb=new StringBuilder();
  for (  Map.Entry<String,Stats> entry : rs.getStatsMap().entrySet()) {
    Stats stats=entry.getValue();
    sb.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numRequests.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numValidRequests.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numInvalidRequests.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numForbiddenRequests.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numPuts.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numGets.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numDels.get());
  }
  return Response.ok(sb.toString(),MediaType.APPLICATION_JSON).build();
}

Fixed version (ground truth):
@GET @Produces(MediaType.TEXT_PLAIN) public Response getStats(){
  StringBuilder sb=new StringBuilder();
  for (  Map.Entry<String,Stats> entry : rs.getStatsMap().entrySet()) {
    Stats stats=entry.getValue();
    sb.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numRequests.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numValidRequests.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numInvalidRequests.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numForbiddenRequests.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numPuts.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numGets.get()).append("String_Node_Str");
    sb.append("String_Node_Str").append(stats.numDels.get()).append("String_Node_Str");
  }
  return Response.ok(sb.toString(),MediaType.APPLICATION_JSON).build();
}
Program: 150312
Project: 150312
Buggy source:
/** 
 * Add a collection of rules to the Gnip stream
 * @param account The account name for the power track API. (For example: acme)
 * @param streamName the streamName
 * @param rule The Rules object to add to the tracker
 */
void addRules(String account,String streamName,Rules rules);

Fixed version (ground truth):
/** 
 * Add a collection of rules to the Gnip stream
 * @param account The account name for the power track API. (For example: acme)
 * @param streamName the streamName
 * @param rules The Rules object to add to the tracker
 */
void addRules(String account,String streamName,Rules rules);
Program: 150313
Project: 150313
Buggy source:
public void formatGrid(Grid grid){
  grid.setCellStyleGenerator(cellReference -> {
    if (cellReference.getValue() instanceof BigDecimal)     return "String_Node_Str";
    return null;
  }
);
  DecimalFormat nf=new DecimalFormat();
  nf.setGroupingUsed(false);
  if (grid.getColumn("String_Node_Str") != null && !String.class.equals(grid.getContainerDataSource().getType("String_Node_Str")))   grid.getColumn("String_Node_Str").setRenderer(new NumberRenderer(nf));
  for (  Grid.Column c : grid.getColumns()) {
    c.setHidable(true);
    ViewConfig.FieldConfig config=viewConfig.getFields().get(c.getPropertyId());
    if ("String_Node_Str".equals(c.getPropertyId())) {
      c.setExpandRatio(0);
    }
 else     if (isBooleanColumn(c)) {
      c.setExpandRatio(0);
      c.setConverter(new StringToBooleanConverter("String_Node_Str","String_Node_Str"));
    }
 else     if (isDateColumn(c)) {
      c.setRenderer(new DateRenderer(getDateFormat()));
    }
 else {
      c.setExpandRatio(1);
    }
    if (config != null) {
      if (config.getExpandRatio() != -1)       c.setExpandRatio(config.getExpandRatio());
    }
  }
  grid.setSizeFull();
}

Fixed version (ground truth):
public void formatGrid(Grid grid){
  grid.setCellStyleGenerator(cellReference -> {
    if (cellReference.getValue() instanceof BigDecimal)     return "String_Node_Str";
    return null;
  }
);
  DecimalFormat nf=new DecimalFormat();
  nf.setGroupingUsed(false);
  grid.addColumnResizeListener((Grid.ColumnResizeListener)event -> {
    int lastColumnIndex=grid.getColumns().size() - 1;
    grid.getColumns().get(lastColumnIndex).setWidth(1500);
  }
);
  if (grid.getColumn("String_Node_Str") != null && !String.class.equals(grid.getContainerDataSource().getType("String_Node_Str")))   grid.getColumn("String_Node_Str").setRenderer(new NumberRenderer(nf));
  for (  Grid.Column c : grid.getColumns()) {
    c.setHidable(true);
    if ("String_Node_Str".equals(c.getPropertyId())) {
      c.setExpandRatio(0);
    }
 else     if (isBooleanColumn(c)) {
      c.setExpandRatio(0);
      c.setConverter(new StringToBooleanConverter("String_Node_Str","String_Node_Str"));
    }
 else     if (isDateColumn(c)) {
      c.setRenderer(new DateRenderer(getDateFormat()));
    }
 else {
      c.setExpandRatio(1);
    }
    ViewConfig.FieldConfig config=viewConfig.getFields().get(c.getPropertyId());
    if (config != null) {
      if (config.getExpandRatio() != -1)       c.setExpandRatio(config.getExpandRatio());
    }
  }
  grid.setSizeFull();
}
Program: 150314
Project: 150314
Buggy source:
@Override public void enter(ViewChangeListener.ViewChangeEvent event){
  super.enter(event);
  setHelper(createHelper());
  showSpecificView(getGeneralRoute() + "String_Node_Str" + QI.getQI().getUser().getId());
}

Fixed version (ground truth):
@Override public void enter(ViewChangeListener.ViewChangeEvent event){
  setHelper(createHelper());
  getHelper().setConfiguration(getConfiguration());
  showSpecificView(getGeneralRoute() + "String_Node_Str" + QI.getQI().getUser().getId());
}