Method reference controversy
Rémi Forax
forax at univ-mlv.fr
Mon May 19 02:07:48 PDT 2008
Zdenek Tronicek a écrit :
> Ok. I will wait for your blog. So now just a few words what I find
> controversial:
>
> class APIClass {
> static void m(Object o) { }
> }
>
> Your code:
>
> { String => void } pp3 = APIClass#m(String);
>
> Another version of API:
>
> class APIClass {
> static void m(Object o) { }
> static void m(String s) { }
> }
>
> Your code remains the same, but now refers to another method.
>
> Z.
yes, this change is not compatible.
Joseph Darcy wrote a great blog entry about that:
http://blogs.sun.com/darcy/entry/compatibly_evolving_bigdecimal
About using classical method resolution for method reference resolution,
i think it's a good idea to not create another way to lookup method.
The algorithm is already complex because it takes care of generics
(inference),
boxing/unboxing and varargs (see JLS3 15.12).
cheers,
Rémi
More information about the closures-dev
mailing list