classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYi: Add exception message and/or chain exceptions in SSLEn


From: Mark Wielaard
Subject: [cp-patches] FYi: Add exception message and/or chain exceptions in SSLEngine
Date: Tue, 15 Feb 2005 23:03:59 +0100

Hi,

This makes the exceptions throw much more clear:

2005-02-15  Mark Wielaard  <address@hidden>

       * javax/net/ssl/SSLContext.java (getInstance): Add exception message
       and/or cause before throwing.

Committed to both classpath and libgcj.

Cheers,

Mark


diff -u -r1.2 SSLContext.java
--- javax/net/ssl/SSLContext.java       21 Oct 2004 20:57:39 -0000      1.2
+++ javax/net/ssl/SSLContext.java       15 Feb 2005 21:57:13 -0000
@@ -140,7 +140,7 @@
   {
     if (provider == null)
       {
-        throw new IllegalArgumentException();
+        throw new IllegalArgumentException("null provider");
       }
     Provider p = Security.getProvider(provider);
     if (p == null)
@@ -174,13 +174,13 @@
       }
     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);
       }
   }

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]