mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8274848: LambdaMetaFactory::metafactory on REF_invokeSpecial impl method has incorrect behavior
Reviewed-by: psandoz, dlsmith
This commit is contained in:
parent
48f3fcab51
commit
21da218387
2 changed files with 136 additions and 1 deletions
|
@ -26,6 +26,8 @@ package java.lang.invoke;
|
|||
|
||||
import sun.invoke.util.Wrapper;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
import static java.lang.invoke.MethodHandleInfo.*;
|
||||
import static sun.invoke.util.Wrapper.forPrimitiveType;
|
||||
import static sun.invoke.util.Wrapper.forWrapperType;
|
||||
|
@ -157,7 +159,7 @@ import static sun.invoke.util.Wrapper.isWrapperType;
|
|||
// Classes compiled prior to dynamic nestmate support invoke a private instance
|
||||
// method with REF_invokeSpecial. Newer classes use REF_invokeVirtual or
|
||||
// REF_invokeInterface, and we can use that instruction in the lambda class.
|
||||
if (targetClass == implClass) {
|
||||
if (targetClass == implClass && Modifier.isPrivate(implInfo.getModifiers())) {
|
||||
this.implKind = implClass.isInterface() ? REF_invokeInterface : REF_invokeVirtual;
|
||||
} else {
|
||||
this.implKind = REF_invokeSpecial;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue