Build c572fa185d05 proxy

Rémi Forax forax at univ-mlv.fr
Sat Sep 11 06:31:38 PDT 2010


Le 11/09/2010 07:30, Howard Lovatt a écrit :
> Hi,
>
> With my usual source and the latest build:
>
>      final ActionListener al4 = Main#print( ActionEvent );
>      b1.addActionListener( al4 );
>      b1.doClick();
>      b1.removeActionListener( al4 );
>      b1.doClick();
>
> Gives:
>
>    Main.print method called
>    Main.print method called
>
> IE the remove doesn't work.
>
> Cheers,
>
>   -- Howard.
>    

yes, in ProxyHelper dispatchObject method should be:

Object dispatchObjectMethod(Method method, Object proxy, Object... args) throws Throwable {
     String name = method.getName();
     if (name.equals("hashCode")) {
         return System.identityHashCode(proxy);
     } else if (name.equals("equals")) {
         return proxy == args[0];
     } else if (name.equals("toString")) {
         return proxy.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(proxy));
     } else {
         throw new AssertionError("Bad Object method " + method);
     }
}

Rémi




More information about the lambda-dev mailing list