[Top][All Lists]
[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 14:28:13 +0200 |
Brian Jones wrote:
> "Jeroen Frijters" <address@hidden> writes:
>
> > Hi,
> >
> > Yet another java.lang.Class patch.
> >
> > Change Log
> >
> > * java/lang/Class.java
> > (constructor): Added transient field to cache constructor.
> > (newInstance): Fixed to consider non-public constructors as well,
> > added constructor object caching and implemented
> accessibility check.
> > 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.
> >
> > * vm/reference/java/lang/VMClass.java
> > (throwException): Added native method to throw checked exceptions
> > without declaring them.
>
> Could you fix this so that the exception is declared and then
> maybe we don't need that native method in VMClass to throw
> the exception?
No, the problem is that *any* exception can be thrown from a constructor
(and hence from Class.newInstance()). Yet, Class.newInstance() doesn't
declare "throws Exception" and it can't because that would break
existing code (wouldn't compile anymore).
Regards,
Jeroen
- Re: java.lang.Class patches, (continued)
- RE: java.lang.Class patches, Jeroen Frijters, 2003/04/04
- RE: java.lang.Class patches, Jeroen Frijters, 2003/04/05
- RE: java.lang.Class patches, Jeroen Frijters, 2003/04/07
- RE: java.lang.Class patches, Jeroen Frijters, 2003/04/09
- RE: java.lang.Class patches, Jeroen Frijters, 2003/04/11
- RE: java.lang.Class patches,
Jeroen Frijters <=
- RE: java.lang.Class patches, Jeroen Frijters, 2003/04/11
- RE: java.lang.Class patches, Jeroen Frijters, 2003/04/12
- RE: java.lang.Class patches, Jeroen Frijters, 2003/04/17