Tom Tromey <[EMAIL PROTECTED]> wrote:

> >>>>> "Patrick" == Patrick Doyle <[EMAIL PROTECTED]> 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        [EMAIL PROTECTED]      http://www.shudo.net/

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to