hg: lambda/lambda/langtools: Object methods are not dispatched correctly by the ProxyHelper class (part three - last I hope ; -)).

maurizio.cimadamore at oracle.com maurizio.cimadamore at oracle.com
Wed Aug 25 03:25:30 PDT 2010


Changeset: 0ea4e43f5fc4
Author:    mcimadamore
Date:      2010-08-25 11:24 +0100
URL:       http://hg.openjdk.java.net/lambda/lambda/langtools/rev/0ea4e43f5fc4

Object methods are not dispatched correctly by the ProxyHelper class (part three - last I hope ;-)).
Updated ProxyHelper impl to reflect java.lang.reflect.Proxy behavior:

"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. Other public methods of a proxy instance inherited from java.lang.Object are not overridden by a proxy class, so invocations of those methods behave like they do for instances of java.lang.Object."

Which means ProxyHelper should really only handle hashCode, equals and toString.

! src/share/classes/com/sun/runtime/ProxyHelper.java
! test/tools/javac/lambda/MethodReference12.java



More information about the lambda-dev mailing list