Program: 13259
Project: 13259
Buggy source:
@Override public void handleRequest(final RestRequest request,final RestChannel channel){
  final SQLRequestBuilder requestBuilder=new SQLRequestBuilder(client);
  try {
    if (request.hasContent()) {
      SQLXContentSourceContext context=new SQLXContentSourceContext();
      parser=new SQLXContentSourceParser(context);
      parser.parseSource(request.content());
      requestBuilder.stmt(context.stmt());
      requestBuilder.args(context.args());
    }
 else {
      throw new ElasticsearchException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str",e);
    try {
      XContentBuilder builder=restContentBuilder(request);
      channel.sendResponse(new XContentRestResponse(request,BAD_REQUEST,builder.startObject().field("String_Node_Str",e.getMessage()).endObject()));
    }
 catch (    IOException e1) {
      logger.error("String_Node_Str",e1);
    }
    return;
  }
  requestBuilder.execute(new ActionListener<SQLResponse>(){
    @Override public void onResponse(    SQLResponse response){
      try {
        XContentBuilder builder=restContentBuilder(request);
        response.toXContent(builder,request);
        channel.sendResponse(new XContentRestResponse(request,RestStatus.OK,builder));
      }
 catch (      Exception e) {
        logger.debug("String_Node_Str",e);
        onFailure(e);
      }
    }
    @Override public void onFailure(    Throwable e){
      try {
        channel.sendResponse(new CrateThrowableRestResponse(request,e));
      }
 catch (      IOException e1) {
        logger.error("String_Node_Str",e1);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void handleRequest(final RestRequest request,final RestChannel channel){
  final SQLRequestBuilder requestBuilder=new SQLRequestBuilder(client);
  try {
    if (request.hasContent()) {
      SQLXContentSourceContext context=new SQLXContentSourceContext();
      SQLXContentSourceParser parser=new SQLXContentSourceParser(context);
      parser.parseSource(request.content());
      requestBuilder.stmt(context.stmt());
      requestBuilder.args(context.args());
    }
 else {
      throw new ElasticsearchException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str",e);
    try {
      XContentBuilder builder=restContentBuilder(request);
      channel.sendResponse(new XContentRestResponse(request,BAD_REQUEST,builder.startObject().field("String_Node_Str",e.getMessage()).endObject()));
    }
 catch (    IOException e1) {
      logger.error("String_Node_Str",e1);
    }
    return;
  }
  requestBuilder.execute(new ActionListener<SQLResponse>(){
    @Override public void onResponse(    SQLResponse response){
      try {
        XContentBuilder builder=restContentBuilder(request);
        response.toXContent(builder,request);
        channel.sendResponse(new XContentRestResponse(request,RestStatus.OK,builder));
      }
 catch (      Exception e) {
        logger.debug("String_Node_Str",e);
        onFailure(e);
      }
    }
    @Override public void onFailure(    Throwable e){
      try {
        channel.sendResponse(new CrateThrowableRestResponse(request,e));
      }
 catch (      IOException e1) {
        logger.error("String_Node_Str",e1);
      }
    }
  }
);
}