RFR: 8027682: javac wrongly accepts semicolons in package and import decls [v6]

Archie L. Cobbs duke at openjdk.org
Tue Mar 21 17:57:48 UTC 2023


On Tue, 21 Mar 2023 17:42:31 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>>> Please use "--release 20" instead if possible.
>> 
>> Thanks - that works better.
>
> Why is any `--release` option required?   The test should only be run by JDK 20 and later, right?

Per [this CSR comment](https://bugs.openjdk.org/browse/JDK-8301905?focusedCommentId=14559000&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14559000) it was requested to make this an error for source versions >= 21 and a warning for source versions prior to 21.

In order to satisfy `diags/CheckExamples.java` I needed an example that would generate the warning.

But I guess you're right... so the alternative would be to add `compiler.warn.extraneous.semicolon` to `diags/examples.not-yet.txt`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12448#discussion_r1143798466


More information about the compiler-dev mailing list