RFR: 8320575: generic type information lost on mandated parameters of record's compact constructors [v15]

Vicente Romero vromero at openjdk.org
Fri Apr 26 23:19:06 UTC 2024


On Fri, 26 Apr 2024 21:27:55 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   special case the new code for records only
>
> src/java.base/share/classes/java/lang/reflect/Executable.java line 354:
> 
>> 352:                      */
>> 353:                     int fromidx = genericParamTypes.length - 1;
>> 354:                     for (int i = out.length - 1; i >= 0; i--) {
> 
> We don't really need this loop any more; can just do something like:
> 
> if (genericParamTypes.length == nonGenericParamTypes.length) {
>     out = genericParamTypes;
> } else {
>     out = nonGenericParamTypes.clone();
> }

yup I like this, thanks

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17070#discussion_r1581603973


More information about the core-libs-dev mailing list