spotless
spotless copied to clipboard
Auto-apply syntactic sugar
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.