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

RemoveUnusedImports fails with NoSuchMethodError com.sun.tools.javac.tree.JCTree$JCImport.getQualifiedIdentifier() #916

Closed
slachiewicz opened this issue Aug 27, 2023 · 1 comment

Comments

@slachiewicz
Copy link

slachiewicz commented Aug 27, 2023

What happened?

Java 21 (Corretto) for the project https://github.com/codehaus-plexus/modello
When I try to run spotless-maven-plugin:2.38.0:check (spotless-check) on project modello-core

Execution spotless-check of goal com.diffplug.spotless:spotless-maven-plugin:2.38.0:check failed: An API incompatibility was encountered while executing com.diffplug.spotless:spotless-maven-plugin:2.38.0:check: java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree com.sun.tools.javac.tree.JCTree$JCImport.getQualifiedIdentifier()'

with stacktrace
Caused by: java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree com.sun.tools.javac.tree.JCTree$JCImport.getQualifiedIdentifier()' at com.palantir.javaformat.java.RemoveUnusedImports.getSimpleName (RemoveUnusedImports.java:245) at com.palantir.javaformat.java.RemoveUnusedImports.buildReplacements (RemoveUnusedImports.java:225) at com.palantir.javaformat.java.RemoveUnusedImports.removeUnusedImports (RemoveUnusedImports.java:209) at com.diffplug.spotless.glue.pjf.PalantirJavaFormatFormatterFunc.apply (PalantirJavaFormatFormatterFunc.java:42) at com.diffplug.spotless.FormatterFunc.apply (FormatterFunc.java:32)

Build with one of the latest Java 20 works fine in same environment.

What did you want to happen?

Have a possibility to uselib with soon to be released Java 21

@slachiewicz
Copy link
Author

Duplicate of #909

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

1 participant