PATCH: fix libgcj/7060

Jeff Sturm jsturm@one-point.com
Sat Jun 22 03:09:00 GMT 2002


On 21 Jun 2002, Tom Tromey wrote:
> Jeff> I decided it would be best to invoke getMethod recursively,
> Jeff> since interfaces may inherit from a tree of other interfaces.
> Jeff> To avoid catching NoSuchMethodExceptions I split getMethod into
> Jeff> two, introducing a new private method.
> 
> Jeff> Is this acceptable?
> 
> There doesn't seem to be a simple, clean way to make it compute the
> utf8const just once :-(.

Not from lack of trying.  I first wrote a C++ static method that couldn't
directly access Class members, then scrapped it for the current method
that can't declare a utf8const parameter.

At least the recursive call isn't the common case.

> In any case, I think _getMethod needs to search the superinterfaces
> even if `this' is not an interface itself.  So I think you'd at least
> need to remove the `if'.

I thought so too at first, and tried to write a failing test.  I couldn't.
It seems that gcj provides even abstract classes with a method entry for
each method of each interface implemented.  So searching the interfaces
wasn't necessary to pass the tests.

> This method diverges from the spec in a number of ways :-(

How so?  I should really pay more attention to the spec...

Jeff



More information about the Java-patches mailing list