Allow BadJWTException to be reusable

Issue #269 duplicate
Former user created an issue

Some classes like com.nimbusds.oauth2.sdk.assertions.jwt.JWTAssertionDetailsVerifier are caching BadJWTException in order to reuse them.

To do that, reusable instances should have a null cause, should disable suppression and should not allow stack trace to be filled in.

This is currently not possible for a BadJWTException (which means that JWTAssertionDetailsVerifier has a memory leak if validation is done in a try with resource that has an exception in the closing of th resource).

Comments (2)

  1. Vladimir Dzhuvinov

    Thanks for the feedback. I have the feeling the exception caching will need a more substantial review, of whether it's actually worth it.

  2. Log in to comment