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

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

Reply via email to