RFR: 8310905: [lw5] addressing review comments on null restricted types [v7]
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed Jul 19 23:51:08 UTC 2023
On Tue, 18 Jul 2023 18:31:17 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/Type.java line 1120:
> 1118: return isPrimitive() ?
> 1119: addMetadata(new ConstantValue(constValue)) :
> 1120: addMetadata(new ConstantValue(constValue)).addMetadata(new TypeMetadata.NullMarker(NullMarker.NOT_NULL));
One nitpick: I can see why having the call here is handy. On the other hand, in terms of code maintenance it would probably be better if `constType` added just one kind of metadata (and we added the NOT_NULL explicitly where we need it). That said, I understand that, pragmatically, Attr is probably not the only place where we call this method, and chasing all the usages might be a bit hard. So let's just keep a mental note of this, going forward. (especially, should we get stuck in situations where, for whatever reason we'd like to have constant-ness w/o having null-restrictedness).
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/880#discussion_r1268787755
More information about the valhalla-dev
mailing list