[code-reflection] RFR: Lazily invoke lambda op building method [v3]

Paul Sandoz psandoz at openjdk.org
Fri Dec 19 22:34:28 UTC 2025


On Fri, 19 Dec 2025 22:18:29 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java line 553:
>> 
>>> 551: 
>>> 552:         clb.withMethod("getModel", MethodTypeDesc.of(reflectableLambdaInfo.funcOpClass()),
>>> 553:                 ACC_PRIVATE + ACC_STATIC + ACC_SYNCHRONIZED,
>> 
>> This method does not need to be synchronized since it is only called by `getQuoted` which is synchronized.
>
> The method is static. So two instance of the lambda class can call it in parallel making the value of the field model undefined and we can no longer guarantee that model is shared.

Doh! yes you are right.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/769#discussion_r2636483438


More information about the babylon-dev mailing list