On Mon, 11 Apr 2022 09:53:31 GMT, Claes Redestad <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/invoke/VarHandle.java line 2075:
>>
>>> 2073:
>>> 2074: @DontInline
>>> 2075: final void
>>> throwWrongMethodTypeException(VarHandle.AccessDescriptor ad) {
>>
>> This can actually be `private` ~~and `static`~~:
>> Suggestion:
>>
>> private final void
>> throwWrongMethodTypeException(VarHandle.AccessDescriptor ad) {
>
> `private` yes. `static` would require to pass the `MethodType` and since this
> is an exceptional slow-path it doesn't make sense to keep the complexity
> contained inside the `throw...` method.
Right, I missed the `accessModeType(…)` call.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8160