Program: 88504
Project: 88504
Buggy source:
/** 
 * General purpose method for running a cancellable request. Builds a new thread to run the request, and passes any relevant exception information back out via atomic references and generates new exceptions in calling thread
 * @param request
 * @param progressStatus
 * @return
 * @throws IOException
 * @throws URISyntaxException
 * @throws ServerException    contains both response code and response body
 */
public static JsonParser sendCancellableMMSRequest(final Project project,HttpRequestBase request,ProgressStatus progressStatus) throws IOException, ServerException, URISyntaxException {
  final AtomicReference<JsonParser> responseJsonParser=new AtomicReference<>();
  final AtomicReference<Integer> ecode=new AtomicReference<>();
  final AtomicReference<ThreadRequestExceptionType> etype=new AtomicReference<>();
  final AtomicReference<String> emsg=new AtomicReference<>();
  Thread t=new Thread(() -> {
    JsonParser response=null;
    try {
      response=sendMMSRequest(project,request);
      etype.set(null);
      ecode.set(200);
      emsg.set("String_Node_Str");
    }
 catch (    ServerException ex) {
      etype.set(ThreadRequestExceptionType.SERVER_EXCEPTION);
      ecode.set(ex.getCode());
      emsg.set(ex.getMessage());
      ex.printStackTrace();
    }
catch (    IOException e) {
      etype.set(ThreadRequestExceptionType.IO_EXCEPTION);
      emsg.set(e.getMessage());
      e.printStackTrace();
    }
catch (    URISyntaxException e) {
      etype.set(ThreadRequestExceptionType.URI_SYNTAX_EXCEPTION);
      emsg.set(e.getMessage());
      e.printStackTrace();
    }
    responseJsonParser.set(response);
  }
);
  t.start();
  try {
    t.join(CHECK_CANCEL_DELAY);
    while (t.isAlive()) {
      if (progressStatus != null && progressStatus.isCancel()) {
        Application.getInstance().getGUILog().log("String_Node_Str");
        return null;
      }
      t.join(CHECK_CANCEL_DELAY);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (etype.get() == ThreadRequestExceptionType.SERVER_EXCEPTION) {
    throw new ServerException(emsg.get(),ecode.get());
  }
 else   if (etype.get() == ThreadRequestExceptionType.IO_EXCEPTION) {
    throw new IOException(emsg.get());
  }
 else   if (etype.get() == ThreadRequestExceptionType.URI_SYNTAX_EXCEPTION) {
    throw new URISyntaxException(request.getURI().toString(),emsg.get());
  }
  return responseJsonParser.get();
}

Fixed version (ground truth):
/** 
 * General purpose method for running a cancellable request. Builds a new thread to run the request, and passes any relevant exception information back out via atomic references and generates new exceptions in calling thread
 * @param request
 * @param progressStatus
 * @return
 * @throws IOException
 * @throws URISyntaxException
 * @throws ServerException    contains both response code and response body
 */
public static File sendCancellableMMSRequest(final Project project,HttpRequestBase request,ProgressStatus progressStatus) throws IOException, ServerException, URISyntaxException {
  final AtomicReference<File> responseFile=new AtomicReference<>();
  final AtomicReference<Integer> ecode=new AtomicReference<>();
  final AtomicReference<ThreadRequestExceptionType> etype=new AtomicReference<>();
  final AtomicReference<String> emsg=new AtomicReference<>();
  Thread t=new Thread(() -> {
    File response=null;
    try {
      response=sendMMSRequest(project,request);
      etype.set(null);
      ecode.set(200);
      emsg.set("String_Node_Str");
    }
 catch (    ServerException ex) {
      etype.set(ThreadRequestExceptionType.SERVER_EXCEPTION);
      ecode.set(ex.getCode());
      emsg.set(ex.getMessage());
      ex.printStackTrace();
    }
catch (    IOException e) {
      etype.set(ThreadRequestExceptionType.IO_EXCEPTION);
      emsg.set(e.getMessage());
      e.printStackTrace();
    }
catch (    URISyntaxException e) {
      etype.set(ThreadRequestExceptionType.URI_SYNTAX_EXCEPTION);
      emsg.set(e.getMessage());
      e.printStackTrace();
    }
    responseFile.set(response);
  }
);
  t.start();
  try {
    t.join(CHECK_CANCEL_DELAY);
    while (t.isAlive()) {
      if (progressStatus != null && progressStatus.isCancel()) {
        Application.getInstance().getGUILog().log("String_Node_Str");
        return null;
      }
      t.join(CHECK_CANCEL_DELAY);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (etype.get() == ThreadRequestExceptionType.SERVER_EXCEPTION) {
    throw new ServerException(emsg.get(),ecode.get());
  }
 else   if (etype.get() == ThreadRequestExceptionType.IO_EXCEPTION) {
    throw new IOException(emsg.get());
  }
 else   if (etype.get() == ThreadRequestExceptionType.URI_SYNTAX_EXCEPTION) {
    throw new URISyntaxException(request.getURI().toString(),emsg.get());
  }
  return responseFile.get();
}