[lworld] RFR: JDK-8251986: [lworld] implement Class::valueType and Class::referenceType in Java [v5]

Mandy Chung mchung at openjdk.java.net
Thu Aug 20 19:45:26 UTC 2020


On Wed, 19 Aug 2020 19:25:17 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Mandy Chung has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   improve getProjectionTypes per Roger's suggestion
>
> src/java.base/share/classes/java/lang/Class.java line 631:
> 
>> 630:         } else if (isReferenceProjectionType()) {
>> 631:             projectionTypes = new Class<?>[] { valueProjectionType(), this };
>> 632:         } else {
> 
> It seems odd that isReferenceProjectType() uses projectionTypes before it is initialized (or is it re-initialized).
> (Though there is a check for null).
> The logic is not very straightforward; though I haven't looked at how to make it easier to follow.

I have redone the logic and incorporated your suggestion in `getProjectionType` method.

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

PR: https://git.openjdk.java.net/valhalla/pull/152


More information about the valhalla-dev mailing list