-
Notifications
You must be signed in to change notification settings - Fork 43
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 21 / JEP 441: Pattern Matching for switch result in com.palantir.javaformat.java.FormatterException #952
Comments
Can you manage to compile and try #935? |
I have checked out PR #935 locally and I manage to build it if I use JDK 17 when running Cradle. ./gradlew -v
------------------------------------------------------------
Gradle 7.6.2
------------------------------------------------------------
Build time: 2023-06-30 15:42:51 UTC
Revision: dab132169006b16e7ada4ab2456e0c9d6415b52a
Kotlin: 1.7.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.8 (Amazon.com Inc. 17.0.8+7-LTS)
OS: Mac OS X 13.6.1 x86_64 ./gradlew build
[...]
BUILD SUCCESSFUL in 29s
93 actionable tasks: 56 executed, 25 from cache, 12 up-to-date However, that PR fails when tried to build using JDK 21 as it is not supported for running Gradle according to its compatibility matrix: ./gradlew -v
------------------------------------------------------------
Gradle 7.6.2
------------------------------------------------------------
Build time: 2023-06-30 15:42:51 UTC
Revision: dab132169006b16e7ada4ab2456e0c9d6415b52a
Kotlin: 1.7.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 21 (Amazon.com Inc. 21+35-LTS)
OS: Mac OS X 13.6.1 x86_64 ./gradlew build
[...]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':gradle-palantir-java-format:compileGroovy'.
> Unrecoverable compilation error: startup failed:
General error during conversion: Unsupported class file major version 65 |
Bump: Java 21 is now supported from Gradle ~8.4 @matsev |
Any progress on this? We're starting to use more JDK21 features and this is preventing us to use |
Java 21 / JEP 441 : Pattern Matching for switch code result in
com.palantir.javaformat.java.FormatterException
What happened?
This method compiles using JDK 21:
However, when using the
spotless-maven-plugin
together with<palantirJavaFormat>
results in an exception:Maven config:
Maven:
What did you want to happen?
The
maven-spotless-plugin
andplanter-java-format
should accept or reformat code that is supported by JDK 21The text was updated successfully, but these errors were encountered: