Community
Participate
Working Groups
In AbstractDeclarativeValidator#invoke() the target of a InvocationTargetException is thrown as a RuntimeException. It is not necessary to wrap it when the target is already a RuntimeException, in this case just throw that instance. catch (InvocationTargetException e) { // ignore GuardException, check is just not evaluated if // guard is false // ignore NullPointerException, as not having to check for // NPEs all the time is a convenience feature Throwable targetException = e.getTargetException(); if (!(targetException instanceof GuardException) && !(targetException instanceof NullPointerException)) if (targetException instanceof RuntimeException) throw targetException; else throw new RuntimeException(targetException); }
Pushed to master. Out of curiosity: Have you had any actual problems with the wrapped runtime exception?
No, this caused no problems. Just noticed that I have an unnecessary wrapped exception.
Closing all bugs that were set to RESOLVED before Neon.0