Don't make assumptions about exception type
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@728032
13f79535-47bb-0310-9956-
ffa450edef68
}
Subject.doAsPrivileged(subject, pea, null);
- } catch( PrivilegedActionException pe) {
- Throwable e = ((InvocationTargetException)pe.getException())
+ } catch( PrivilegedActionException pe) {
+ Throwable e;
+ if (pe.getException() instanceof InvocationTargetException) {
+ e = ((InvocationTargetException)pe.getException())
.getTargetException();
+ } else {
+ e = pe;
+ }
if (log.isDebugEnabled()){
log.debug(sm.getString("SecurityUtil.doAsPrivilege"), e);