[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 202_jess bug?
From: |
shudo |
Subject: |
Re: 202_jess bug? |
Date: |
Fri, 18 Jan 2002 10:11:24 +0900 |
Tom Tromey <address@hidden> wrote:
> >>>>> "Patrick" == Patrick Doyle <address@hidden> writes:
>
> Patrick> What is Class.getConstructor supposed to do when the matching
> Patrick> constructor is not public?
>
> I think it should fail with NoSuchMethodException.
I believe this is not a bug of the SPEC JVM98.
The _202_jess calls Class#newInstance() for the `_return' class,
which is an inner class of the caller.
The call to newInstance() should succeed according to the specification
of newInstance():
Creates a new instance of the class represented by this
Class object. The class is instantiatied as if by a new
expression with an empty argument list. The class is
initialized if it has not already been initialized.
But, as you wrote, getConstructor(<class object for
`_return'>) should throw NoSuchMethodException. Thus
newInstance() working correctly for inner classes cannot
be implemented making use of getConstructor(), as long
as access modifier of inner class is not public.
> I think you've found a bug in SPECjvm.
> Try reporting it to them and see what they say.
Kazuyuki Shudo address@hidden http://www.shudo.net/