RFR: 8286797: Guards of constant value false are not permitted [v2]

Vicente Romero vromero at openjdk.java.net
Wed May 18 17:57:54 UTC 2022


On Wed, 18 May 2022 07:19:06 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> Simple fix that addresses this line from the spec:
>> 
>>> It is a compile-time error if a when expression is a constant expression ([15.29](https://docs.oracle.com/javase/specs/jls/se18/html/jls-15.html#jls-15.29)) with the value false.
>> 
>> Extracts one small utility method `isBooleanWithValue` in `TreeInfo`.
>
> Aggelos Biboudis has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   8286797: Guards of constant value false are not permitted

looks good, just a minor suggestion, don't need another iteration

src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties line 516:

> 514: 
> 515: compiler.err.guard.has.constant.expression.false=\
> 516:     this case label has a guard that is a constant expression with value false

suggestion:
`... with value ''false''`

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

Marked as reviewed by vromero (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8745


More information about the compiler-dev mailing list