[code-reflection] RFR: Replace opField with opMethod for lambdas. [v2]

Mourad Abbay mabbay at openjdk.org
Mon Jan 6 14:47:22 UTC 2025


On Mon, 6 Jan 2025 13:57:36 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java line 495:
>> 
>>> 493:                 Class<?> quotedHelper = layer.findLoader("jdk.incubator.code")
>>> 494:                         .loadClass("jdk.incubator.code.internal.QuotedHelper");
>>> 495:                 Class<?> funcOp = layer.findLoader("jdk.incubator.code")
>> 
>> Maybe we should try to call `findLoader` only once and cache the result?
>
> In fact, perhaps all these classes should be moved to static fields in the inner class `CodeReflectonSupport`, which is used for similar purposes?

The variables quotedHelper and funcOp are used only in the static initializer, so no need to move them to static fields.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/301#discussion_r1904236600


More information about the babylon-dev mailing list