Repository navigation
Accommodate Java 23 in ReloadableJava21ParserVisitor - #4516
Conversation
|
Hey @timtebeek! Have you considered backporting this fix to |
I didn't think that'd be necessary if rewrite-java-21 is available, but it looks like EPS only uses rewrite-java-17: would it be possible to change that in EPS only? Or would you still prefer the backport to 17? |
|
Pending your response I've already pushed up a PR here in case this is indeed needed; tell me it is and we'll merge: |
Fair question. When I upgrade EPS to
(That I could look into having our build require JDK 21, while still targeting and testing against JDK 17 using toolchain support, but a backport would be easier 😅. |
What's changed?
com.sun.tools.javac.tree.DocCommentTable#getCommentTreeused to returncom.sun.tools.javac.tree.DCTree.DCDocCommentin Java 21.As of Java 23 it returns
com.sun.source.doctree.DocCommentTree, an interface that was already present and implemented byDCDocComment.rewrite/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java
Line 1666 in a98d83d
This PR changes the usage downstream in
formatWithCommentTreeto use the interface instead.What's your motivation?
Have you considered any alternatives or workarounds?
A separate Java 23 parser; decided against for now as we still have work to do on our Java 21 parser, and will likely only target LST releases going forward. That said if support is easy to add, as seen here, we will try to do so.
Any additional context