Program: 61767
Project: 61767
Buggy source:
@POST @Produces(MediaType.APPLICATION_JSON) public Response insertValue(@PathParam("String_Node_Str") final String channelName,@HeaderParam("String_Node_Str") final String contentType,@HeaderParam("String_Node_Str") final String contentLanguage,@HeaderParam("String_Node_Str") final String user,final InputStream data) throws Exception {
  if (noSuchChannel(channelName)) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
  long start=System.currentTimeMillis();
  Content content=Content.builder().withContentLanguage(contentLanguage).withContentType(contentType).withStream(data).withUser(user).build();
  try {
    ContentKey contentKey=channelService.insert(channelName,content);
    InsertedContentKey insertionResult=new InsertedContentKey(contentKey);
    URI payloadUri=LinkBuilder.buildItemUri(contentKey,uriInfo.getRequestUri());
    Linked<InsertedContentKey> linkedResult=linked(insertionResult).withLink("String_Node_Str",LinkBuilder.buildChannelUri(channelName,uriInfo)).withLink("String_Node_Str",payloadUri).build();
    Response.ResponseBuilder builder=Response.status(Response.Status.CREATED);
    builder.entity(linkedResult);
    builder.location(payloadUri);
    LinkBuilder.addOptionalHeader(Headers.USER,content.getUser(),builder);
    content.getTraces().logSlow(100,logger);
    long time=System.currentTimeMillis() - start;
    if (time < minPostTimeMillis) {
      Sleeper.sleep(minPostTimeMillis - time);
    }
    return builder.build();
  }
 catch (  ContentTooLargeException e) {
    return Response.status(413).entity(e.getMessage()).build();
  }
catch (  Exception e) {
    String key="String_Node_Str";
    if (content.getContentKey().isPresent()) {
      key=content.getContentKey().get().toString();
    }
    logger.warn("String_Node_Str" + channelName + "String_Node_Str"+ key,e);
    throw e;
  }
}

Fixed version (ground truth):
@POST @Produces(MediaType.APPLICATION_JSON) public Response insertValue(@PathParam("String_Node_Str") final String channelName,@HeaderParam("String_Node_Str") final String contentType,@HeaderParam("String_Node_Str") final String contentLanguage,@HeaderParam("String_Node_Str") final String user,final InputStream data) throws Exception {
  if (!channelService.channelExists(channelName)) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
  long start=System.currentTimeMillis();
  Content content=Content.builder().withContentLanguage(contentLanguage).withContentType(contentType).withStream(data).withUser(user).build();
  try {
    ContentKey contentKey=channelService.insert(channelName,content);
    InsertedContentKey insertionResult=new InsertedContentKey(contentKey);
    URI payloadUri=LinkBuilder.buildItemUri(contentKey,uriInfo.getRequestUri());
    Linked<InsertedContentKey> linkedResult=linked(insertionResult).withLink("String_Node_Str",LinkBuilder.buildChannelUri(channelName,uriInfo)).withLink("String_Node_Str",payloadUri).build();
    Response.ResponseBuilder builder=Response.status(Response.Status.CREATED);
    builder.entity(linkedResult);
    builder.location(payloadUri);
    LinkBuilder.addOptionalHeader(Headers.USER,content.getUser(),builder);
    content.getTraces().logSlow(100,logger);
    long time=System.currentTimeMillis() - start;
    if (time < minPostTimeMillis) {
      Sleeper.sleep(minPostTimeMillis - time);
    }
    return builder.build();
  }
 catch (  ContentTooLargeException e) {
    return Response.status(413).entity(e.getMessage()).build();
  }
catch (  Exception e) {
    String key="String_Node_Str";
    if (content.getContentKey().isPresent()) {
      key=content.getContentKey().get().toString();
    }
    logger.warn("String_Node_Str" + channelName + "String_Node_Str"+ key,e);
    throw e;
  }
}