Program: 172519
Project: 172519
Buggy source:
/** 
 * Async uploading photos
 */
private void uploadDoc(JSONObject doc,ExecuteCallback callback){
  String type=null;
  File docFile=new File(doc.getString("String_Node_Str"));
  if (docFile.exists()) {
    type="String_Node_Str";
  }
  URL docUrl=null;
  if (type == null) {
    try {
      docUrl=new URL(doc.getString("String_Node_Str"));
      type="String_Node_Str";
    }
 catch (    MalformedURLException ignored) {
      LOG.error("String_Node_Str",doc);
      callback.onResponse("String_Node_Str");
      return;
    }
  }
  byte[] docBytes;
switch (type) {
case "String_Node_Str":
{
      try {
        docBytes=Files.readAllBytes(Paths.get(docFile.toURI()));
      }
 catch (      IOException ignored) {
        LOG.error("String_Node_Str",docFile.getAbsolutePath());
        callback.onResponse("String_Node_Str");
        return;
      }
      break;
    }
case "String_Node_Str":
{
    try {
      docBytes=Utils.toByteArray(docUrl);
    }
 catch (    IOException ignored) {
      LOG.error("String_Node_Str",doc);
      callback.onResponse("String_Node_Str");
      return;
    }
    break;
  }
default :
{
  LOG.error("String_Node_Str",doc);
  return;
}
}
if (docBytes != null) {
JSONObject params_getMessagesUploadServer=new JSONObject().put("String_Node_Str",peerId).put("String_Node_Str",doc.getString("String_Node_Str"));
api.call("String_Node_Str",params_getMessagesUploadServer,response -> {
if (response.toString().equalsIgnoreCase("String_Node_Str")) {
  LOG.error("String_Node_Str");
  callback.onResponse("String_Node_Str");
  return;
}
String uploadUrl=new JSONObject(response.toString()).getString("String_Node_Str");
String response_uploadFileString;
MultipartUtility multipartUtility=new MultipartUtility(uploadUrl);
multipartUtility.addBytesPart("String_Node_Str","String_Node_Str",docBytes);
response_uploadFileString=multipartUtility.finish();
if (response_uploadFileString.length() < 2 || response_uploadFileString.contains("String_Node_Str") || !response_uploadFileString.contains("String_Node_Str")) {
  LOG.error("String_Node_Str",response_uploadFileString);
  callback.onResponse("String_Node_Str");
  return;
}
JSONObject getFileStringResponse;
try {
  getFileStringResponse=new JSONObject(response_uploadFileString);
}
 catch (JSONException ignored) {
  LOG.error("String_Node_Str",response_uploadFileString);
  callback.onResponse("String_Node_Str");
  return;
}
if (!getFileStringResponse.has("String_Node_Str")) {
  LOG.error("String_Node_Str",getFileStringResponse.toString());
  callback.onResponse("String_Node_Str");
  return;
}
String fileParam=getFileStringResponse.getString("String_Node_Str");
JSONObject params_photosSaveMessagesPhoto=new JSONObject().put("String_Node_Str",fileParam);
api.call("String_Node_Str",params_photosSaveMessagesPhoto,response1 -> {
  if (response1.toString().equalsIgnoreCase("String_Node_Str")) {
    LOG.error("String_Node_Str");
    callback.onResponse("String_Node_Str");
    return;
  }
  JSONObject response_saveMessagesPhotoe=new JSONArray(response1.toString()).getJSONObject(0);
  int ownerId=response_saveMessagesPhotoe.getInt("String_Node_Str"), id=response_saveMessagesPhotoe.getInt("String_Node_Str");
  String attach="String_Node_Str" + ownerId + '_'+ id;
  callback.onResponse(attach);
}
);
}
);
}
}

Fixed version (ground truth):
/** 
 * Async uploading photos
 */
private void uploadDoc(JSONObject doc,ExecuteCallback callback){
  String type=null, fileNameField;
  File docFile=new File(doc.getString("String_Node_Str"));
  if (docFile.exists()) {
    type="String_Node_Str";
  }
  URL docUrl=null;
  if (type == null) {
    try {
      docUrl=new URL(doc.getString("String_Node_Str"));
      type="String_Node_Str";
    }
 catch (    MalformedURLException ignored) {
      LOG.error("String_Node_Str",doc);
      callback.onResponse("String_Node_Str");
      return;
    }
  }
  byte[] docBytes;
switch (type) {
case "String_Node_Str":
{
      try {
        docBytes=Files.readAllBytes(Paths.get(docFile.toURI()));
        fileNameField=docFile.getName();
      }
 catch (      IOException ignored) {
        LOG.error("String_Node_Str",docFile.getAbsolutePath());
        callback.onResponse("String_Node_Str");
        return;
      }
      break;
    }
case "String_Node_Str":
{
    try {
      URLConnection conn=docUrl.openConnection();
      try {
        docBytes=Utils.toByteArray(conn);
        fileNameField=Utils.guessFileNameByContentType(conn.getContentType());
      }
  finally {
        Utils.close(conn);
      }
    }
 catch (    IOException ignored) {
      LOG.error("String_Node_Str",doc);
      callback.onResponse("String_Node_Str");
      return;
    }
    break;
  }
default :
{
  LOG.error("String_Node_Str",doc);
  return;
}
}
if (docBytes != null) {
JSONObject params_getMessagesUploadServer=new JSONObject().put("String_Node_Str",peerId).put("String_Node_Str",doc.getString("String_Node_Str"));
api.call("String_Node_Str",params_getMessagesUploadServer,response -> {
if (response.toString().equalsIgnoreCase("String_Node_Str")) {
  LOG.error("String_Node_Str");
  callback.onResponse("String_Node_Str");
  return;
}
String uploadUrl=new JSONObject(response.toString()).getString("String_Node_Str");
String response_uploadFileString;
MultipartUtility multipartUtility=new MultipartUtility(uploadUrl);
multipartUtility.addBytesPart("String_Node_Str",fileNameField,docBytes);
response_uploadFileString=multipartUtility.finish();
if (response_uploadFileString.length() < 2 || response_uploadFileString.contains("String_Node_Str") || !response_uploadFileString.contains("String_Node_Str")) {
  LOG.error("String_Node_Str",response_uploadFileString);
  callback.onResponse("String_Node_Str");
  return;
}
JSONObject getFileStringResponse;
try {
  getFileStringResponse=new JSONObject(response_uploadFileString);
}
 catch (JSONException ignored) {
  LOG.error("String_Node_Str",response_uploadFileString);
  callback.onResponse("String_Node_Str");
  return;
}
if (!getFileStringResponse.has("String_Node_Str")) {
  LOG.error("String_Node_Str",getFileStringResponse.toString());
  callback.onResponse("String_Node_Str");
  return;
}
String fileParam=getFileStringResponse.getString("String_Node_Str");
JSONObject params_photosSaveMessagesPhoto=new JSONObject().put("String_Node_Str",fileParam);
api.call("String_Node_Str",params_photosSaveMessagesPhoto,response1 -> {
  if (response1.toString().equalsIgnoreCase("String_Node_Str")) {
    LOG.error("String_Node_Str");
    callback.onResponse("String_Node_Str");
    return;
  }
  JSONObject response_saveMessagesPhotoe=new JSONArray(response1.toString()).getJSONObject(0);
  int ownerId=response_saveMessagesPhotoe.getInt("String_Node_Str"), id=response_saveMessagesPhotoe.getInt("String_Node_Str");
  String attach="String_Node_Str" + ownerId + '_'+ id;
  callback.onResponse(attach);
}
);
}
);
}
}