mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8330467: NoClassDefFoundError when lambda is in a hidden class
Reviewed-by: psandoz, mchung
This commit is contained in:
parent
fe0227e978
commit
706b421cca
3 changed files with 58 additions and 5 deletions
|
@ -175,13 +175,15 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
lambdaClassName = lambdaClassName(targetClass);
|
||||
// If the target class invokes a protected method inherited from a
|
||||
// superclass in a different package, or does 'invokespecial', the
|
||||
// lambda class has no access to the resolved method. Instead, we need
|
||||
// to pass the live implementation method handle to the proxy class
|
||||
// to invoke directly. (javac prefers to avoid this situation by
|
||||
// generating bridges in the target class)
|
||||
// lambda class has no access to the resolved method, or does
|
||||
// 'invokestatic' on a hidden class which cannot be resolved by name.
|
||||
// Instead, we need to pass the live implementation method handle to
|
||||
// the proxy class to invoke directly. (javac prefers to avoid this
|
||||
// situation by generating bridges in the target class)
|
||||
useImplMethodHandle = (Modifier.isProtected(implInfo.getModifiers()) &&
|
||||
!VerifyAccess.isSamePackage(targetClass, implInfo.getDeclaringClass())) ||
|
||||
implKind == H_INVOKESPECIAL;
|
||||
implKind == H_INVOKESPECIAL ||
|
||||
implKind == H_INVOKESTATIC && implClass.isHidden();
|
||||
cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
int parameterCount = factoryType.parameterCount();
|
||||
if (parameterCount > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue