dacapo xalan

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

 



On Wed, 2006-03-01 at 10:15 -0800, David Daney wrote:
> Andrew Haley wrote:
> > Mark Wielaard writes:
> >  > Does the dacapo xalan work for you with the following patch?
> >  > 
> >  > diff -u -r1.36 ResourceBundle.java
> >  > --- java/util/ResourceBundle.java       23 Oct 2005 17:04:46 -0000      1.36
> >  > +++ java/util/ResourceBundle.java       1 Mar 2006 10:59:59 -0000
> >  > @@ -476,9 +476,7 @@
> >  >         if (ResourceBundle.class.isAssignableFrom(rbClass))
> >  >           bundle = (ResourceBundle) rbClass.newInstance();
> >  >        }
> >  > -    catch (IllegalAccessException ex) {}
> >  > -    catch (InstantiationException ex) {}
> >  > -    catch (ClassNotFoundException ex) {}
> >  > +    catch (Throwable t) { /* Class initialization failed, no valid bundle. */ }
> > 
> > Are you sure about this?  Do you really want to catch
> > VirtualMachineError here?
> 
> Or ThreadDeath, or OutOfMemoryError, or StackOverflowError, or ...
> 
> Well maybe some of those, but why not just catch those documented in 
> Class.newInstance() and Class.forName()?  Namely add LinkageError and 
> ExceptionInInitializerError.  Or maybe Exceptions in general but no 
> Errors others than those explicitly documented.

No I wasn't sure :) I just wanted to provide Christian with a quick and
dirty patch to make sure treating exceptions thrown from a constructor
as failed initialization of a ResourceBundle class was the thing that
was going wrong. Jeroen did more testing and fixed it by just catching
Exception. Unfortunately Class.newInstance() isn't guaranteed to wrap
exceptions (even declared exceptions) thrown from the default
constructor in an ExceptionInInitializer. Although that is what JikesRVM
does, but that is a bug in JikesRVM - a bug that helped counter this bug
it seems :)

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://developer.classpath.org/pipermail/classpath/attachments/20060303/e0b515e0/attachment.pgp

[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux