bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/28095] Suns JDK handles exceptions in URLStreamHandler.pa


From: cvs-commit at developer dot classpath dot org
Subject: [Bug classpath/28095] Suns JDK handles exceptions in URLStreamHandler.parseURL differently
Date: 20 Jun 2006 21:32:16 -0000


------- Comment #2 from cvs-commit at developer dot classpath dot org  
2006-06-20 21:32 -------
Subject: Bug 28095

CVSROOT:        /cvsroot/classpath
Module name:    classpath
Changes by:     Tom Tromey <tromey>     06/06/20 21:31:37

Modified files:
        .              : ChangeLog 
        java/net       : URL.java 

Log message:
                PR classpath/28095:
                * java/net/URL.java (URL): Throw MalformedURLException if a
                RuntimeException is caught.  Chain exceptions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.7886&r2=1.7887
http://cvs.savannah.gnu.org/viewcvs/classpath/java/net/URL.java?cvsroot=classpath&r1=1.53&r2=1.54

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.7886
retrieving revision 1.7887
diff -u -b -r1.7886 -r1.7887
--- ChangeLog   20 Jun 2006 20:36:13 -0000      1.7886
+++ ChangeLog   20 Jun 2006 21:31:36 -0000      1.7887
@@ -1,3 +1,9 @@
+2006-06-20  Tom Tromey  <address@hidden>
+
+       PR classpath/28095:
+       * java/net/URL.java (URL): Throw MalformedURLException if a
+       RuntimeException is caught.  Chain exceptions.
+
 2006-06-20  Lillian Angel  <address@hidden>

        * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java

Index: java/net/URL.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URL.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- java/net/URL.java   2 Mar 2006 00:25:21 -0000       1.53
+++ java/net/URL.java   20 Jun 2006 21:31:37 -0000      1.54
@@ -482,7 +482,17 @@
       }
     catch (URLParseError e)
       {
-       throw new MalformedURLException(e.getMessage());
+        MalformedURLException mue = new MalformedURLException(e.getMessage());
+        mue.initCause(e);
+       throw mue;
+      }
+    catch (RuntimeException e)
+      {
+        // This isn't documented, but the JDK also catches
+        // RuntimeExceptions here.
+        MalformedURLException mue = new MalformedURLException(e.getMessage());
+        mue.initCause(e);
+        throw mue;
       }

     if (hashAt >= 0)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28095





reply via email to

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