Program: 46898
Project: 46898
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=APPLICATION_JSON_VALUE) public String getTraces(@Nullable @RequestParam(value="String_Node_Str",required=false) String serviceName,@Nullable @RequestParam(value="String_Node_Str",required=false) String spanName,@Nullable @RequestParam(value="String_Node_Str",required=false) String annotationQuery,@Nullable @RequestParam(value="String_Node_Str",required=false) Long minDuration,@Nullable @RequestParam(value="String_Node_Str",required=false) Long maxDuration,@Nullable @RequestParam(value="String_Node_Str",required=false) Long endTs,@Nullable @RequestParam(value="String_Node_Str",required=false) Long lookback,@RequestParam(value="String_Node_Str",defaultValue="String_Node_Str") int limit) throws IOException {
  QueryRequest queryRequest=QueryRequest.newBuilder().serviceName(serviceName).spanName(spanName).parseAnnotationQuery(annotationQuery).minDuration(minDuration).maxDuration(maxDuration).endTs(endTs != null ? endTs : System.currentTimeMillis()).lookback(lookback != null ? lookback : defaultLookback).limit(limit).build();
  List<List<Span>> traces=storage.v2SpanStore().getTraces(queryRequest).execute();
  Buffer buffer=new Buffer();
  buffer.writeByte('[');
  for (int i=0, iLength=traces.size(); i < iLength; ) {
    buffer.writeByte('[');
    List<Span> trace=traces.get(i);
    for (int j=0, jLength=trace.size(); j < jLength; j++) {
      buffer.write(Encoder.JSON.encode(trace.get(j)));
      if (++j < jLength)       buffer.writeByte(',');
    }
    buffer.writeByte(']');
    if (++i < iLength)     buffer.writeByte(',');
  }
  buffer.writeByte(']');
  return buffer.readUtf8();
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=APPLICATION_JSON_VALUE) public String getTraces(@Nullable @RequestParam(value="String_Node_Str",required=false) String serviceName,@Nullable @RequestParam(value="String_Node_Str",required=false) String spanName,@Nullable @RequestParam(value="String_Node_Str",required=false) String annotationQuery,@Nullable @RequestParam(value="String_Node_Str",required=false) Long minDuration,@Nullable @RequestParam(value="String_Node_Str",required=false) Long maxDuration,@Nullable @RequestParam(value="String_Node_Str",required=false) Long endTs,@Nullable @RequestParam(value="String_Node_Str",required=false) Long lookback,@RequestParam(value="String_Node_Str",defaultValue="String_Node_Str") int limit) throws IOException {
  if (storage == null)   throw new Version2StorageNotConfigured();
  QueryRequest queryRequest=QueryRequest.newBuilder().serviceName(serviceName).spanName(spanName).parseAnnotationQuery(annotationQuery).minDuration(minDuration).maxDuration(maxDuration).endTs(endTs != null ? endTs : System.currentTimeMillis()).lookback(lookback != null ? lookback : defaultLookback).limit(limit).build();
  List<List<Span>> traces=storage.v2SpanStore().getTraces(queryRequest).execute();
  Buffer buffer=new Buffer();
  buffer.writeByte('[');
  for (int i=0, iLength=traces.size(); i < iLength; ) {
    buffer.writeByte('[');
    List<Span> trace=traces.get(i);
    for (int j=0, jLength=trace.size(); j < jLength; ) {
      buffer.write(Encoder.JSON.encode(trace.get(j)));
      if (++j < jLength)       buffer.writeByte(',');
    }
    buffer.writeByte(']');
    if (++i < iLength)     buffer.writeByte(',');
  }
  buffer.writeByte(']');
  return buffer.readUtf8();
}