RFR: 8315452: Erroneous AST missing modifiers for partial input

Vicente Romero vromero at openjdk.org
Fri Sep 1 17:21:42 UTC 2023


On Thu, 31 Aug 2023 14:25:43 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> Consider code like:
> 
> package test;
> public
> 
> 
> Before [JDK-8305671](https://bugs.openjdk.org/browse/JDK-8305671), this was producing an AST which included the package clause + an ErroneousTree, which contained the `public` as partial modifiers.
> 
> After [JDK-8305671](https://bugs.openjdk.org/browse/JDK-8305671), the `public` is no longer included in the AST, and hence it is invisible for tools that operate on the AST.
> 
> My proposal is to return the `public` back to the AST. Seems that the problem from [JDK-8305671](https://bugs.openjdk.org/browse/JDK-8305671) can be solved by breaking out of the outter loop, instead of inner loop, as it was before [JDK-8305671](https://bugs.openjdk.org/browse/JDK-8305671), without affecting non-eof situations.

looks sensible

-------------

Marked as reviewed by vromero (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15517#pullrequestreview-1607374701


More information about the compiler-dev mailing list