SSLContext.java (getInstance): Add exception message and/or cause before throwing.
authorMark Wielaard <mark@klomp.org>
Tue, 15 Feb 2005 22:05:04 +0000 (22:05 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Tue, 15 Feb 2005 22:05:04 +0000 (22:05 +0000)
       * javax/net/ssl/SSLContext.java (getInstance): Add exception message
       and/or cause before throwing.

From-SVN: r95075

libjava/ChangeLog
libjava/javax/net/ssl/SSLContext.java

index fa70cfc..0453d4e 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-15  Mark Wielaard  <mark@klomp.org>
+       * javax/net/ssl/SSLContext.java (getInstance): Add exception message
+       and/or cause before throwing.
+
 2005-02-15  Richard Henderson  <rth@redhat.com>
 
        * Makefile.am (libgcj_la_SOURCES): Move all sources ...
index f69e267..6cab453 100644 (file)
@@ -140,7 +140,7 @@ public class SSLContext
   {
     if (provider == null)
       {
-        throw new IllegalArgumentException();
+        throw new IllegalArgumentException("null provider");
       }
     Provider p = Security.getProvider(provider);
     if (p == null)
@@ -174,13 +174,13 @@ public class SSLContext
       }
     catch (InvocationTargetException ite)
       {
-        ite.printStackTrace();
-        throw new NoSuchAlgorithmException();
+        NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(protocol);
+        throw (NoSuchAlgorithmException) nsae.initCause(ite);
       }
     catch (ClassCastException cce)
       {
-        cce.printStackTrace();
-        throw new NoSuchAlgorithmException();
+        NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(protocol);
+        throw (NoSuchAlgorithmException) nsae.initCause(cce);
       }
   }