RFR: 8310905: [lw5] addressing review comments on null restricted types [v5]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Jul 13 16:27:28 UTC 2023


On Wed, 12 Jul 2023 21:57:46 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> addressing some review comments related to PR [1]
>> 
>> [1] https://github.com/openjdk/valhalla/pull/872
>
> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
> 
>   addressing another round of review comments

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 1288:

> 1286:             @Override
> 1287:             public Boolean visitType(Type t, Type s) {
> 1288:                 Warner warner = !warnStack.isEmpty() ? warnStack.head : noWarnings;

Good cleanup. I assume that now nullability comparator really has no state, so you could in principle create two instances (with the two comparator functions), and just use those instances, right?

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java line 4490:

> 4488:                 case UNCHECKED:
> 4489:                     Check.this.warnUnchecked(pos(), Warnings.ProbFoundReq(diags.fragment(uncheckedKey), found, expected));
> 4490:                     this.warned = true;

Odd - this field is clearly meant to be set in this method, but it is not in mainline. Maybe better to set the field only once, after the switch?

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/880#discussion_r1262786970
PR Review Comment: https://git.openjdk.org/valhalla/pull/880#discussion_r1262792902



More information about the valhalla-dev mailing list