Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
-
None
-
Patch
Description
If doAs() catches a PrivilegedActionException it extracts the underlying cause through getCause and then re-throws an exception based on the class of the Cause. If getCause returns null, this is how it gets re-thrown:
else
{ throw new UndeclaredThrowableException(cause); }If cause == null that seems misleading. I have seen actual instances where cause is null, so this isn't just a theoretical concern.