When the new switch contains an exception throw, the formatter fails with:
Caused by: com.google.googlejavaformat.java.FormatterException: 13:30: error: expected token: '}'; generated ; instead
public class EnumBug {
enum Sample {
ONE,
TWO
}
int func(Sample val) {
return switch (val) {
case ONE -> 1;
case TWO -> throw new RuntimeException();
};
}
}
Tested with 1.8 through Gradle com.diffplug.spotless:spotless-plugin-gradle:4.0.1.
When the new switch contains an exception throw, the formatter fails with:
Caused by: com.google.googlejavaformat.java.FormatterException: 13:30: error: expected token: '}'; generated ; insteadTested with 1.8 through Gradle
com.diffplug.spotless:spotless-plugin-gradle:4.0.1.