Program: 5313
Project: 5313
Buggy source:
@POST @Path("String_Node_Str") public void getCredentials(HttpRequest request,HttpResponder responder) throws Exception {
  String requestContent=request.getContent().toString(Charsets.UTF_8);
  if (requestContent == null) {
    throw new BadRequestException("String_Node_Str");
  }
  ImpersonationRequest impersonationRequest=GSON.fromJson(requestContent,ImpersonationRequest.class);
  LOG.info("String_Node_Str",impersonationRequest);
  UGIWithPrincipal ugiWithPrincipal=ugiProvider.getConfiguredUGI(impersonationRequest);
  Credentials credentials=ImpersonationUtils.doAs(ugiWithPrincipal.getUGI(),new Callable<Credentials>(){
    @Override public Credentials call() throws Exception {
      SecureStore update=tokenSecureStoreUpdater.update();
      return update.getStore();
    }
  }
);
  Location credentialsDir=locationFactory.create("String_Node_Str");
  if (credentialsDir.isDirectory() || credentialsDir.mkdirs() || credentialsDir.isDirectory()) {
    Location credentialsFile=credentialsDir.append("String_Node_Str").getTempFile("String_Node_Str");
    try (DataOutputStream os=new DataOutputStream(new BufferedOutputStream(credentialsFile.getOutputStream("String_Node_Str")))){
      credentials.writeTokenStorageToStream(os);
    }
     LOG.debug("String_Node_Str",ugiWithPrincipal.getPrincipal(),credentialsFile);
    PrincipalCredentials principalCredentials=new PrincipalCredentials(ugiWithPrincipal.getPrincipal(),credentialsFile.toURI().toString());
    responder.sendJson(HttpResponseStatus.OK,principalCredentials);
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void getCredentials(HttpRequest request,HttpResponder responder) throws Exception {
  String requestContent=request.getContent().toString(Charsets.UTF_8);
  if (requestContent == null) {
    throw new BadRequestException("String_Node_Str");
  }
  ImpersonationRequest impersonationRequest=GSON.fromJson(requestContent,ImpersonationRequest.class);
  LOG.debug("String_Node_Str",impersonationRequest);
  UGIWithPrincipal ugiWithPrincipal=ugiProvider.getConfiguredUGI(impersonationRequest);
  Credentials credentials=ImpersonationUtils.doAs(ugiWithPrincipal.getUGI(),new Callable<Credentials>(){
    @Override public Credentials call() throws Exception {
      SecureStore update=tokenSecureStoreUpdater.update();
      return update.getStore();
    }
  }
);
  Location credentialsDir=locationFactory.create("String_Node_Str");
  if (credentialsDir.isDirectory() || credentialsDir.mkdirs() || credentialsDir.isDirectory()) {
    Location credentialsFile=credentialsDir.append("String_Node_Str").getTempFile("String_Node_Str");
    try (DataOutputStream os=new DataOutputStream(new BufferedOutputStream(credentialsFile.getOutputStream("String_Node_Str")))){
      credentials.writeTokenStorageToStream(os);
    }
     LOG.debug("String_Node_Str",ugiWithPrincipal.getPrincipal(),credentialsFile);
    PrincipalCredentials principalCredentials=new PrincipalCredentials(ugiWithPrincipal.getPrincipal(),credentialsFile.toURI().toString());
    responder.sendJson(HttpResponseStatus.OK,principalCredentials);
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}