RFR: 8294583: JShell: NPE in switch with non existing record pattern [v2]

Jan Lahoda jlahoda at openjdk.org
Mon Nov 21 15:21:33 UTC 2022


On Mon, 21 Nov 2022 15:19:39 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> This fixes a situation where attribution errors are not short circuiting the compilation of an expression, e.g., in case of a declaration missing in the JShell evaluation of a switch expression.
>> 
>> Now there are two options:
>> 
>> 1. handle this in `handleSwitch` (specific to switches, and avoid the `NPE` raised according to the JBS description)
>> 2. handle this centrally in the corresponding task that is used in two places: 1) JShell evaluation and 2) `tools.javac.combo`.
>> 
>> I adopted the second option. Any thoughts?
>
> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address review

Looks fine to me.

test/langtools/jdk/jshell/Test8294583.java line 2:

> 1: /*
> 2:  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.

Nit: copyright years.

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

Marked as reviewed by jlahoda (Reviewer).

PR: https://git.openjdk.org/jdk/pull/11251


More information about the compiler-dev mailing list