jdk/test/sun/security/krb5/auto/Context.java
changeset 28670 bb9afe681988
parent 26629 3b9ed8175488
--- a/jdk/test/sun/security/krb5/auto/Context.java	Tue Jan 27 12:59:45 2015 +0900
+++ b/jdk/test/sun/security/krb5/auto/Context.java	Tue Jan 27 18:16:27 2015 +0800
@@ -23,6 +23,7 @@
 
 import com.sun.security.auth.module.Krb5LoginModule;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
@@ -584,7 +585,12 @@
             out.name = name + " as " + out.cred.getName().toString();
             return out;
         } catch (PrivilegedActionException pae) {
-            throw pae.getException();
+            Exception e = pae.getException();
+            if (e instanceof InvocationTargetException) {
+                throw (Exception)((InvocationTargetException) e).getTargetException();
+            } else {
+                throw e;
+            }
         }
     }