RFR: 8343064: ClassFormatError: Illegal class name from InnerClassLambdaMetafactory [v3]

Chen Liang liach at openjdk.org
Wed Nov 13 00:05:24 UTC 2024


On Tue, 12 Nov 2024 23:13:16 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>> 
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into fix/lmf-hidden-serial-class-format
>>  - Update docs per suggestion
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into fix/lmf-hidden-serial-class-format
>>  - Add a test to ensure serializable lambda creation and basic execution in hidden classes
>>  - Specify consequence
>>  - 8343064: ClassFormatError: Illegal class name from InnerClassLambdaMetafactory
>
> src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java line 244:
> 
>> 242:  * implementation class from unloading when the caller is a {@linkplain
>> 243:  * MethodHandles.Lookup.ClassOption#STRONG hidden class} and is unloaded, or when
>> 244:  * the returned call site is no longer strongly reachable.
> 
> I don't get the last part of the sentence here. When the call site is no longer reachable _that_ prevents the class from being unloaded?
> 
> I like the implNote though. Maybe: "This technique reduces heap memory use, but it prevents the implementation class from being unloaded independently of its defining class loader" ?

Re this sentence: I wish to indicate "caller is unloaded and impl class is unreachable elsewhere (besides in the ClassLoader)".  Maybe just "caller is unloaded" is fine. Thoughts on phrasing?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21912#discussion_r1839028569


More information about the core-libs-dev mailing list