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

Vicente Romero vromero at openjdk.org
Thu Jul 20 03:16:12 UTC 2023


On Wed, 19 Jul 2023 23:48:29 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> 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).

I see your point but yes I agree that for now it is more practical to have the call here. Thanks for all the comments!

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

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



More information about the valhalla-dev mailing list