Program: 32845
Project: 32845
Buggy source:
/** 
 * Checks the Http response for database or server errors
 * @param res the response of the database
 * @return The Http status code
 * @throws ArangoException if any error happened
 */
private int checkServerErrors(HttpResponseEntity res) throws ArangoException {
  int statusCode=res.getStatusCode();
  if (statusCode >= 400) {
    DefaultEntity defaultEntity=new DefaultEntity();
    if (res.getText() != null && !res.getText().equalsIgnoreCase("String_Node_Str") && statusCode != 500) {
      JsonParser jsonParser=new JsonParser();
      JsonElement jsonElement=jsonParser.parse(res.getText());
      JsonObject jsonObject=jsonElement.getAsJsonObject();
      JsonElement errorMessage=jsonObject.get("String_Node_Str");
      defaultEntity.setErrorMessage(errorMessage.getAsString());
      JsonElement errorNumber=jsonObject.get("String_Node_Str");
      defaultEntity.setErrorNumber(errorNumber.getAsInt());
    }
 else {
      String statusPhrase="String_Node_Str";
switch (statusCode) {
case 400:
        statusPhrase="String_Node_Str";
      break;
case 401:
    statusPhrase="String_Node_Str";
  break;
case 403:
statusPhrase="String_Node_Str";
break;
case 404:
statusPhrase="String_Node_Str";
break;
case 405:
statusPhrase="String_Node_Str";
break;
case 406:
statusPhrase="String_Node_Str";
break;
case 407:
statusPhrase="String_Node_Str";
break;
case 408:
statusPhrase="String_Node_Str";
break;
case 409:
statusPhrase="String_Node_Str";
break;
case 500:
statusPhrase="String_Node_Str";
break;
default :
statusPhrase="String_Node_Str";
break;
}
defaultEntity.setErrorMessage(statusPhrase);
if (statusCode == 500) {
defaultEntity.setErrorMessage(statusPhrase + "String_Node_Str" + res.getText());
}
}
defaultEntity.setCode(statusCode);
defaultEntity.setStatusCode(statusCode);
defaultEntity.setError(true);
ArangoException arangoException=new ArangoException(defaultEntity);
arangoException.setCode(statusCode);
throw arangoException;
}
return statusCode;
}

Fixed version (ground truth):
/** 
 * Checks the Http response for database or server errors
 * @param res the response of the database
 * @return The Http status code
 * @throws ArangoException if any error happened
 */
private int checkServerErrors(HttpResponseEntity res) throws ArangoException {
  int statusCode=res.getStatusCode();
  if (statusCode >= 400) {
    DefaultEntity defaultEntity=new DefaultEntity();
    if (res.getText() != null && !"String_Node_Str".equals(res.getText()) && statusCode != 500) {
      JsonParser jsonParser=new JsonParser();
      JsonElement jsonElement=jsonParser.parse(res.getText());
      JsonObject jsonObject=jsonElement.getAsJsonObject();
      JsonElement errorMessage=jsonObject.get("String_Node_Str");
      defaultEntity.setErrorMessage(errorMessage.getAsString());
      JsonElement errorNumber=jsonObject.get("String_Node_Str");
      defaultEntity.setErrorNumber(errorNumber.getAsInt());
    }
 else {
      defaultEntity.setErrorMessage(res.createStatusPhrase());
    }
    defaultEntity.setCode(statusCode);
    defaultEntity.setStatusCode(statusCode);
    defaultEntity.setError(true);
    ArangoException arangoException=new ArangoException(defaultEntity);
    arangoException.setCode(statusCode);
    throw arangoException;
  }
  return statusCode;
}