Community
Participate
Working Groups
Some anonymous classes can be represented by method references, e.g. as in this example: -------------------------------------------------------- import java.util.function.Consumer; public class Test { public static void main(String[] args) { run(new Consumer<Object>() { @Override public void accept(Object o) { System.out.println(o); } }); } static void run(Consumer<Object> r) { r.accept("Hello"); } } -------------------------------------------------------- The following code is equivalent: -------------------------------------------------------- public static void main(String[] args) { run(System.out::println); } -------------------------------------------------------- Today, I can convert the anonymous class into a lambda, and then into a method reference. It would be nice to have an option in content assist to go directly from anonymous class to method reference.
(In reply to Lukas Eder from comment #0) > Today, I can convert the anonymous class into a lambda, and then into a > method reference. It would be nice to have an option in content assist to go > directly from anonymous class to method reference. You mean: in *content assist* => in *quick assist*
> You mean: > in *content assist* => in *quick assist* Yes, I'm sorry for the confusion. I mean in *quick assist*, i.e. when hitting Ctrl+1
I think this one is fixed? Lukas, can you check?
Not fixed in Version 2020-03 / Build id 20200313-1211 yet, see screenshot
Created attachment 282909 [details] screenshot.png