classpath
[Top][All Lists]
Advanced

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

RE: java.lang.Class patches


From: Jeroen Frijters
Subject: RE: java.lang.Class patches
Date: Fri, 11 Apr 2003 08:58:26 +0200

Archie Cobbs wrote:
> Jeroen Frijters wrote:
> > Exceptions thrown by constructor are rethrown without the wrapping 
> > InvocationTargetException. This is a little odd (because it 
> can cause
> > newInstance() to throw checked exception that aren't 
> declared), but it 
> > is compatible with Sun's implementation.
> 
> This is a known bug in Sun's implementation:
> 
>   http://developer.java.sun.com/developer/bugParade/bugs/4233093.html
> 
> Not sure if we really want to be bug compatible in this case.. ?

I think we should, given the fact that Sun says (in the above bug
report):
"The documentation of Class.newInstance needs to be modified to document
the current behaviour.  The method will propagate any exceptions which
may be thrown when invoking the default constructor. This is not 
consistent with other partsof the reflection
(e.g. Constructor.newInstance) which will wrap these sorts of
exceptions, but we can not change the behaviour due to compatibility
constraints"

Regards,
Jeroen




reply via email to

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