-
Notifications
You must be signed in to change notification settings - Fork 870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java 14 switch with exception throw #492
Comments
Hi @youurayy - what happens if you follow the instructions over at https://github.com/diffplug/spotless/tree/master/plugin-gradle#applying-to-java-source-with-google-java-format to use google-java-format 1.8, something like the following code snippet? spotless {
java {
googleJavaFormat("1.8")
}
} If this works, then I believe this bug is already fixed! Otherwise, I'm not sure yet if it's a problem with Spotless or google-java-format. |
Hi @jbduncan, thanks for the reply. Yes, that's how I use it:
also tried:
Attaching a full stack trace:
|
Example file: protected String map( String en) { ` error: |
Cheers for confirming, @youurayy! I think @zbychpo's message above confirms that this is a problem with google-java-format, not Spotless, but as I'm not a member of the google-java-format team, or even a Google employee, the best thing we can do is wait until the team acknowledges and responds to this issue. :) |
I think this is a duplicate of 477 or at least the same issue? If so, it's patched at head. |
thanks, closing |
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
Tested with 1.8 through Gradle
com.diffplug.spotless:spotless-plugin-gradle:4.0.1
.The text was updated successfully, but these errors were encountered: