classpathx-xml
[Top][All Lists]
Advanced

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

[Classpathx-xml] Wrong exception catched


From: Michael Koch
Subject: [Classpathx-xml] Wrong exception catched
Date: Thu, 23 Oct 2003 14:23:26 +0200

Hi list,


I think I found a bug in GNU jaxp. I use the GNU jaxp copy included in 
classpath CVS but I looked into GNU jaxp CVS to make sure the bug is still 
there.

I get this warning from jikes:

Issued 1 semantic warning compiling 
"/home/mkoch/src/classpath/external/jaxp/source/org/xml/sax/helpers/XMLReaderFactory.java":

   112.         catch (Exception e) { /* normally fails for applets */ }
                       <--------->
*** Caution: This try block cannot throw a "checked exception" (JLS section 
14.7) that can be caught here. You may have intended to catch a 
RuntimeException instead of an Exception.

I applied this patch to fix it:

Index: org/xml/sax/helpers/XMLReaderFactory.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/external/jaxp/source/org/xml/sax/helpers/XMLReaderFactory.java,v
retrieving revision 1.1.1.1
diff -u -b -B -r1.1.1.1 XMLReaderFactory.java
--- org/xml/sax/helpers/XMLReaderFactory.java   1 Feb 2003 02:10:48 -0000       
1.1.1.1
+++ org/xml/sax/helpers/XMLReaderFactory.java   23 Oct 2003 12:03:41 -0000
@@ -109,7 +109,7 @@
        
        // 1. try the JVM-instance-wide system property
        try { className = System.getProperty (property); }
-       catch (Exception e) { /* normally fails for applets */ }
+       catch (RuntimeException e) { /* normally fails for applets */ }
 
        // 2. if that fails, try META-INF/services/
        if (className == null) {



Greetings,
Michael




reply via email to

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