RFR: 8305671: javac rejects semicolons in compilation units with no imports [v5]

Vicente Romero vromero at openjdk.org
Mon Jun 26 17:34:10 UTC 2023


On Tue, 6 Jun 2023 01:52:58 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

>> The fix for [JDK-8027682](https://bugs.openjdk.org/browse/JDK-8027682) created a new bug in which a program like this:
>> 
>> package p;;
>> 
>> would be rejected.
>> 
>> This is due to the previous fix swallowing all the semicolons. Instead, in the case of semicolons followed by EOF, it needs to swallow all but the last one.
>
> Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:
> 
>  - Merge branch 'master' into JDK-8305671
>  - Merge branch 'master' into JDK-8305671
>  - Consume extra semicolons in a more straightforward way.
>  - Merge branch 'master' into JDK-8305671
>  - Use ToolBox and add more tests per review suggestion.
>  - Allow a package declaration followed (only) by multiple commas.

looks sensible

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

Marked as reviewed by vromero (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13361#pullrequestreview-1499050142


More information about the compiler-dev mailing list