Skip to content
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

Error processing case statements using JVM "17-ea (Azul Systems, Inc. 17-ea+12)" #1097

Open
ckmcd opened this issue Apr 26, 2024 · 1 comment

Comments

@ckmcd
Copy link

ckmcd commented Apr 26, 2024

It works as expected with 17 (Oracle Corporation 17+35-2724)
It fails as follows with 17-ea (Azul Systems, Inc. 17-ea+12)

 Step 'google-java-format' found problem in 'src/test/java/jdbc/jdbc/MSSQLTestService.java':
195:8: error: java.lang.NoSuchMethodError: 'java.util.List com.sun.source.tree.CaseTree.getLabels()'
        at com.google.googlejavaformat.java.java17.Java17InputAstVisitor.visitCase(Java17InputAstVisitor.java:227)
        at com.google.googlejavaformat.java.java17.Java17InputAstVisitor.visitCase(Java17InputAstVisitor.java:51)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCase.accept(JCTree.java:1317)
        at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
        at com.google.googlejavaformat.java.JavaInputAstVisitor.scan(JavaInputAstVisitor.java:357)
        at com.google.googlejavaformat.java.JavaInputAstVisitor.visitSwitch(JavaInputAstVisitor.java:1914)
        at com.google.googlejavaformat.java.JavaInputAstVisitor.visitSwitch(JavaInputAstVisitor.java:1895)
        at com.google.googlejavaformat.java.JavaInputAstVisitor.visitSwitch(JavaInputAstVisitor.java:167)

./gradlew --version

 ------------------------------------------------------------
Gradle 8.2
------------------------------------------------------------

Build time:   2023-06-30 18:02:30 UTC
Revision:     5f4a070a62a31a17438ac998c2b849f4f6892877

Kotlin:       1.8.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17-ea (Azul Systems, Inc. 17-ea+12)
OS:           Mac OS X 11.3 x86_64

gradle spotless plugin config

        // Apply a specific flavor of google-java-format
        // this matches what was used by spotify.fmt-maven-plugin 2.20
        googleJavaFormat("1.22.0").reflowLongStrings().skipJavadocFormatting()
        indentWithSpaces(2)

        // Ensure every file has the following copyright header.
        licenseHeader("/* ___ (C)\$YEAR */")
    }
@cushon
Copy link
Collaborator

cushon commented Apr 26, 2024

Does it reproduce with the latest version of the CLI? Can you share a self-contained example of the Java code that you're seeing this error for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants