- 
    CSR 
- 
    Resolution: Approved
- 
     P3 P3
- 
    None
- 
        behavioral
- 
        low
- 
        Java API
- 
        SE
Summary
LambdaMetaFactory::metafactory on a REF_invokeSpecial implementation method should behave as if invokespecial instruction unless it's a private method in the caller class.
Problem
The integration of JEP 371 Hidden Classes (JDK-8238358) introduced a regression in JDK 15. The LambdaMetaFactory implementation was enhanced to generate hidden implementation classes that are nestmates (JEP 181: Nest-Based Access Control) of the caller, nest-host, class.
Such nestmates class that invoke private methods on the nest host should use REF_invokeVirtual or REF_invokeInterface. However, the LambdaMetaFactory implementation incorrectly applied that to non-private (public, protected and package private) methods which should be invoked with REF_invokeSpecial.
Solution
Fix the implementation to convert REF_invokeSpecial to REF_invokeVirtual/REF_invokeInterface only if the implementation method is a private method of the caller class.
Specification
No specification change.
- csr of
- 
                    JDK-8274848 LambdaMetaFactory::metafactory on REF_invokeSpecial impl method has incorrect behavior -           
- Resolved
 
-