Program: 54825
Project: 54825
Buggy source:
/** 
 * Returns a new instance of   {@link GoogleJsonResponseException}. <p> If there is a JSON error response, it is parsed using   {@link GoogleJsonError}, which can be inspected using   {@link #getDetails()}. Otherwise, the full response content is read and included in the exception message. </p>
 * @param jsonFactory JSON factory
 * @param response HTTP response
 * @return new instance of {@link GoogleJsonResponseException}
 */
public static GoogleJsonResponseException from(JsonFactory jsonFactory,HttpResponse response){
  HttpResponseException.Builder builder=new HttpResponseException.Builder(response.getStatusCode(),response.getStatusMessage(),response.getHeaders());
  Preconditions.checkNotNull(jsonFactory);
  GoogleJsonError details=null;
  String detailString=null;
  try {
    if (!response.isSuccessStatusCode() && HttpMediaType.equalsIgnoreParameters(Json.MEDIA_TYPE,response.getContentType()) && response.getContent() != null) {
      JsonParser parser=null;
      try {
        parser=jsonFactory.createJsonParser(response.getContent());
        JsonToken currentToken=parser.getCurrentToken();
        if (currentToken == null) {
          currentToken=parser.nextToken();
        }
        if (currentToken != null) {
          parser.skipToKey("String_Node_Str");
          if (parser.getCurrentToken() != JsonToken.END_OBJECT) {
            details=parser.parseAndClose(GoogleJsonError.class);
            detailString=details.toPrettyString();
          }
        }
      }
 catch (      IOException exception) {
        exception.printStackTrace();
      }
 finally {
        if (parser == null) {
          response.ignore();
        }
 else         if (details == null) {
          parser.close();
        }
      }
    }
 else {
      detailString=response.parseAsString();
    }
  }
 catch (  IOException exception) {
    exception.printStackTrace();
  }
  StringBuilder message=HttpResponseException.computeMessageBuffer(response);
  if (!com.google.api.client.util.Strings.isNullOrEmpty(detailString)) {
    message.append(StringUtils.LINE_SEPARATOR).append(detailString);
    builder.setContent(detailString);
  }
  builder.setMessage(message.toString());
  return new GoogleJsonResponseException(builder,details);
}

Fixed version (ground truth):
/** 
 * Returns a new instance of   {@link GoogleJsonResponseException}. <p> If there is a JSON error response, it is parsed using   {@link GoogleJsonError}, which can be inspected using   {@link #getDetails()}. Otherwise, the full response content is read and included in the exception message. </p>
 * @param jsonFactory JSON factory
 * @param response HTTP response
 * @return new instance of {@link GoogleJsonResponseException}
 */
public static GoogleJsonResponseException from(JsonFactory jsonFactory,HttpResponse response){
  HttpResponseException.Builder builder=new HttpResponseException.Builder(response.getStatusCode(),response.getStatusMessage(),response.getHeaders());
  Preconditions.checkNotNull(jsonFactory);
  GoogleJsonError details=null;
  String detailString=null;
  try {
    if (!response.isSuccessStatusCode() && HttpMediaType.equalsIgnoreParameters(Json.MEDIA_TYPE,response.getContentType()) && response.getContent() != null) {
      JsonParser parser=null;
      try {
        parser=jsonFactory.createJsonParser(response.getContent());
        JsonToken currentToken=parser.getCurrentToken();
        if (currentToken == null) {
          currentToken=parser.nextToken();
        }
        if (currentToken != null) {
          parser.skipToKey("String_Node_Str");
          if (parser.getCurrentToken() == JsonToken.VALUE_STRING) {
            detailString=parser.getText();
          }
 else           if (parser.getCurrentToken() == JsonToken.START_OBJECT) {
            details=parser.parseAndClose(GoogleJsonError.class);
            detailString=details.toPrettyString();
          }
        }
      }
 catch (      IOException exception) {
        exception.printStackTrace();
      }
 finally {
        if (parser == null) {
          response.ignore();
        }
 else         if (details == null) {
          parser.close();
        }
      }
    }
 else {
      detailString=response.parseAsString();
    }
  }
 catch (  IOException exception) {
    exception.printStackTrace();
  }
  StringBuilder message=HttpResponseException.computeMessageBuffer(response);
  if (!com.google.api.client.util.Strings.isNullOrEmpty(detailString)) {
    message.append(StringUtils.LINE_SEPARATOR).append(detailString);
    builder.setContent(detailString);
  }
  builder.setMessage(message.toString());
  return new GoogleJsonResponseException(builder,details);
}