Olivier Jolly wrote:
It's not an error for an interface to declare a method that matches
an Object method (such as equals), and then for some bytecode somewhere
to INVOKEINTERFACE that method, even though INVOKEVIRTUAL would "make
more sense". E.g. code somewhere in Eclipse does this.
No, it's not an error and it actually mostly works just like everyone
expects it to. Excepted that Sun stated special cases in the javadoc of
Proxy :
"An invocation of the hashCode, equals, or toString methods declared in
java.lang.Object on a proxy instance will be encoded and dispatched to
the invocation handler's invoke method in the same manner as interface
method invocations are encoded and dispatched, as described above. The
declaring class of the Method object passed to invoke will be
java.lang.Object."
Ah, thanks... I knew there had to be a kludge in there somewhere :-)
-Archie
__________________________________________________________________________
Archie Cobbs * CTO, Awarix * http://www.awarix.com