classpathx-xml
[Top][All Lists]
Advanced

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

Re: [Classpathx-xml] Wrong exception catched


From: Arnaud Vandyck
Subject: Re: [Classpathx-xml] Wrong exception catched
Date: Thu, 23 Oct 2003 15:31:33 +0200 (CEST)

Patch applied.

Thanks Michael,

On Thu, 23 Oct 2003 14:23:26 +0200
Michael Koch <address@hidden> wrote:

> 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
> 
> 
> _______________________________________________
> Classpathx-xml mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/classpathx-xml
> 


-- Arnaud Vandyck, STE fi, ULg
   Formateur Cellule Programmation.




reply via email to

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