spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Auto-apply syntactic sugar

Open nickeldan opened this issue 1 year ago • 0 comments

Many constructions in Java can be simplified with syntactic sugar. For example,

foo.ifPresent(value -> value.someMethod());

can be simplified to

foo.ifPresent(Foo::someMethod);

Also,

foo.methodWithCallback(new Foo.Callback() {
    @Override
    public void
    onDone(int result) {
        ...
    }
});

can be simplified to

foo.methodWithCallback(result -> ...);

It would be really helpful to have a plugin that could auto-apply all such simplifications.

nickeldan avatar Jan 19 '24 16:01 nickeldan