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

JDK 21 - NoSuchMethodError for TreeMaker.Select #5672

Closed
cushon opened this issue Feb 27, 2023 · 6 comments · Fixed by #6139
Closed

JDK 21 - NoSuchMethodError for TreeMaker.Select #5672

cushon opened this issue Feb 27, 2023 · 6 comments · Fixed by #6139
Assignees

Comments

@cushon
Copy link
Contributor

cushon commented Feb 27, 2023

The signature of TreeMaker.Select is changing in the next release of the JDK (openjdk/jdk@a917fb3#diff-116d757068eaf94ea4c877b290331659678769ec5e30145f6cb5738fd5c02adcL356-R357), and this line will need to be updated:

(JCTree.JCFieldAccess) maker.Select((JCTree.JCExpression) iterableExpr, iteratorMethod);

Currently that method fails on JDK 21 with errors like:

 Exception: java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree$JCExpression com.sun.tools.javac.tree.TreeMaker.Select(com.sun.tools.javac.tree.JCTree$JCExpression, com.sun.tools.javac.code.Symbol)'; java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree$JCExpression com.sun.tools.javac.tree.TreeMaker.Select(com.sun.tools.javac.tree.JCTree$JCExpression, com.sun.tools.javac.code.Symbol)'
        at org.checkerframework.javacutil.trees.TreeBuilder.buildValueOfMethodAccess(TreeBuilder.java:392)
        at org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseOne.box(CFGTranslationPhaseOne.java:819)
        at org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseOne.commonConvert(CFGTranslationPhaseOne.java:1136)
@mernst
Copy link
Member

mernst commented Feb 27, 2023

@cushon Thanks for the heads-up. We test on released JDKs and so would have noticed this only in a few weeks.

@mernst mernst added this to the Critical milestone Feb 27, 2023
@mernst mernst removed this from the Critical milestone Feb 27, 2023
@mernst
Copy link
Member

mernst commented Feb 27, 2023

@cushon The next release of the JDK will be JDK 20. JDK 21 will be released in September. Did you mean that the failure is on JDK 20?

@cushon
Copy link
Contributor Author

cushon commented Feb 27, 2023

I meant JDK 21

@mernst
Copy link
Member

mernst commented Feb 27, 2023

Thank you for the clarification. I was confused by the mismatch:

The signature of TreeMaker.Select is changing in the next release of the JDK
...
Currently that method fails on JDK 21 with errors like:

So the method is changing in JDK 20 and fails under JDK 21.
Do you know whether the method works under JDK 20? (If not, we can check.)

@cushon
Copy link
Contributor Author

cushon commented Feb 27, 2023

I believe it's only changing in JDK 21, and that the release branch for JDK 20 has already been made and does not include that change

@wendigo
Copy link

wendigo commented May 30, 2023

@mernst error-prone (and checker-framework) seems to work under JDK 20, but not with JDK 21 (ea 24)

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

Successfully merging a pull request may close this issue.

4 participants