RFR: 8288327: Executable.hasRealParameterData should not be volatile [v4]

liach duke at openjdk.org
Fri Jun 17 13:58:59 UTC 2022


On Fri, 17 Jun 2022 11:17:18 GMT, Сергей Цыпанов <duke at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/reflect/Executable.java line 777:
>> 
>>> 775:     }
>>> 776: 
>>> 777:     record ParameterData(Parameter[] parameters, boolean real) {}
>> 
>> The `ParameterData.parameters` field can probably be marked as [`@Stable`] (since the `parameters` array is never modified):
>> Suggestion:
>> 
>>     record ParameterData(@Stable Parameter[] parameters, boolean real) {}
>> 
>> 
>> Also the `real` record component should probably be renamed to `isReal` as @liach suggested in [GH‑9143 (comment)].
>> 
>> [GH‑9143 (comment)]: https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/9143*discussion_r899802093__;Iw!!ACWV5N9M2RV99hQ!J63u7Go-g9GhEjZFWdnrewEwa84zjq6BtIGWjYCaadPNKrGsj8BMqbuBJYk0Bp-sEM4dNuRmK0TwyzeT3lIc$ 
>> [`@Stable`]: https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java__;!!ACWV5N9M2RV99hQ!J63u7Go-g9GhEjZFWdnrewEwa84zjq6BtIGWjYCaadPNKrGsj8BMqbuBJYk0Bp-sEM4dNuRmK0Twy8KsGcQf$ 
>
> Done!

I don't think this stable is critical here, as we don't use the parameters array entries separately, but doesn't seem wrong to have it too.

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

PR: https://git.openjdk.org/jdk/pull/9143


More information about the core-libs-dev mailing list