diffplug / diffplug/spotless

Auto-apply syntactic sugar

Open
#2,010 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
5.6k
Forks
559
Avg merge
1d 13h
Merged PRs (30d)
34

Description

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

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

can be simplified to

```java
foo.ifPresent(Foo::someMethod);
```

Also,

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

can be simplified to

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

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.