public void test2(int y) {
int x;
x = switch (y) {
case 1 -> 1;
case 2 -> throw new IllegalArgumentException();
default -> throw new IllegalStateException();};
}
After this PR
==COMMIT_MSG==
Properly format switch expressions
==COMMIT_MSG==
and now we generate this:
public void test2(int y) {
int x;
x = switch (y) {
case 1 -> 1;
case 2 -> throw new IllegalArgumentException();
default -> throw new IllegalStateException();
};
}
Before this PR
Fixes https://github.com/palantir/palantir-java-format/issues/1025 where before this change, we'd format switch expressions used in an assignment to yield the following:
After this PR
==COMMIT_MSG== Properly format switch expressions ==COMMIT_MSG== and now we generate this:
Possible downsides?