`this` in concise method bodies
John Rose
john.r.rose at oracle.com
Sat Oct 13 05:00:09 UTC 2018
On Oct 12, 2018, at 12:58 PM, Remi Forax <forax at univ-mlv.fr> wrote:
>
> 1) They are few methods that can be converted to concise methods because the implementation has to be a one liner,
> 2) They are very few methods that can be converted to a concise methods that that use the :: syntax because it only works if the implementation delegates to a method that uses all the parameters in the same order,
> 3) They are very very few methods that can be converted to a concise methods that use the :: and use 'this' explicitly as first parameter.
>
> so before descending into the rabbit hole, i think not me|someone should check how many methods can be converted to use the :: + this syntax in big corpus of Java codes.
>
This is probably true, because Java programmers have limited tools
for software reuse: Inheritance and explicit subroutine calls. If they
had the ability to connect methods directly using CMBs, the source
base would look different. There would be less cut-and-paste. A true
mechanical analysis of the applicability of CMBs to connect methods
would have to disregard lots of hand-crafted of method calls, and
unwind uses of inheritance where delegation (had it been available
at the time) would have been a better choice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20181012/e40df290/attachment.html>
More information about the amber-spec-experts
mailing list