JEP draft: Concise Method Bodies - extend this to local functions?
Alex Buckley
alex.buckley at oracle.com
Thu Sep 20 22:09:29 UTC 2018
On 9/20/2018 2:16 PM, Remi Forax wrote:
> yes, but in your example the return type is not the same, i prefer mine
>
> class Utils {
> Function<String,String> fun() = this::bar;
> Function<String,String> fun2() -> this::bar;
>
> Function<String,String> bar() { return null; }
> String bar(String s) { return null; }
> }
Yes, it's good to omit parameters for the methods with concise bodies.
I've updated the JEP. (Hope I got it right!)
Alex
More information about the amber-spec-experts
mailing list