Prettier-Java 2.7.3
Playground link
Input:
public abstract class Foo implements MyInterface {
@Override
public String foo() {
Iterable<Map.Entry<String, Object>> iterable = (sortMapKeys && value.size() > 1
? value.entrySet().stream().sorted(Map.Entry.comparingByKey())
: value.entrySet().stream())::iterator;
}
}
Output:
public abstract class Foo implements MyInterface {
@Override
public String foo() {
Iterable<Map.Entry<String, Object>> iterable = (sortMapKeys && value.size() > 1
? value.entrySet().stream().sorted(Map.Entry.comparingByKey())
: value.entrySet().stream())::iterator;
}
}
Expected behavior:
Unsure how but prettier. 😄 Perhaps:
Iterable<Map.Entry<String, Object>> iterable = (
sortMapKeys && value.size() > 1
? value.entrySet().stream().sorted(Map.Entry.comparingByKey())
: value.entrySet().stream()
)
::iterator;
Prettier-Java 2.7.3
Playground link
Input:
Output:
Expected behavior:
Unsure how but prettier. 😄 Perhaps: