Program: 5595
Project: 5595
Buggy source:
/** 
 * Upload the content for a new file at the location specified by thee request.
 * @param set the name of the file set
 * @param filePath the relative path within the file set
 */
@PUT @Path("String_Node_Str") public HttpContentConsumer write(HttpServiceRequest request,HttpServiceResponder responder,@PathParam("String_Node_Str") final String set,@QueryParam("String_Node_Str") final String filePath){
  FileSet fileSet;
  try {
    fileSet=getContext().getDataset(set);
  }
 catch (  DatasetInstantiationException e) {
    LOG.warn("String_Node_Str",set,e);
    responder.sendError(400,String.format("String_Node_Str",set));
    return null;
  }
  final Location location=fileSet.getLocation(filePath);
  getContext().discardDataset(fileSet);
  try {
    final WritableByteChannel channel=Channels.newChannel(location.getOutputStream());
    return new HttpContentConsumer(){
      @Override public void onReceived(      ByteBuffer chunk,      Transactional transactional) throws Exception {
        channel.write(chunk);
      }
      @Override public void onFinish(      HttpServiceResponder responder) throws Exception {
        channel.close();
        responder.sendStatus(200);
      }
      @Override public void onError(      HttpServiceResponder responder,      Throwable failureCause){
        Closeables.closeQuietly(channel);
        try {
          location.delete();
        }
 catch (        IOException e) {
          LOG.warn("String_Node_Str",location,e);
        }
        LOG.debug("String_Node_Str",filePath,set,failureCause);
        responder.sendError(400,String.format("String_Node_Str",filePath,set,failureCause.getMessage()));
      }
    }
;
  }
 catch (  IOException e) {
    responder.sendError(400,String.format("String_Node_Str",filePath,set,e.getMessage()));
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Upload the content for a new file at the location specified by thee request.
 * @param set the name of the file set
 * @param filePath the relative path within the file set
 */
@PUT @Path("String_Node_Str") @TransactionPolicy(TransactionControl.EXPLICIT) public HttpContentConsumer write(HttpServiceRequest request,HttpServiceResponder responder,@PathParam("String_Node_Str") final String set,@QueryParam("String_Node_Str") final String filePath){
  FileSet fileSet;
  try {
    fileSet=getContext().getDataset(set);
  }
 catch (  DatasetInstantiationException e) {
    LOG.warn("String_Node_Str",set,e);
    responder.sendError(400,String.format("String_Node_Str",set));
    return null;
  }
  final Location location=fileSet.getLocation(filePath);
  getContext().discardDataset(fileSet);
  try {
    final WritableByteChannel channel=Channels.newChannel(location.getOutputStream());
    return new HttpContentConsumer(){
      @Override public void onReceived(      ByteBuffer chunk,      Transactional transactional) throws Exception {
        channel.write(chunk);
      }
      @Override public void onFinish(      HttpServiceResponder responder) throws Exception {
        channel.close();
        responder.sendStatus(200);
      }
      @Override public void onError(      HttpServiceResponder responder,      Throwable failureCause){
        Closeables.closeQuietly(channel);
        try {
          location.delete();
        }
 catch (        IOException e) {
          LOG.warn("String_Node_Str",location,e);
        }
        LOG.debug("String_Node_Str",filePath,set,failureCause);
        responder.sendError(400,String.format("String_Node_Str",filePath,set,failureCause.getMessage()));
      }
    }
;
  }
 catch (  IOException e) {
    responder.sendError(400,String.format("String_Node_Str",filePath,set,e.getMessage()));
    return null;
  }
}