mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8343064: ClassFormatError: Illegal class name from InnerClassLambdaMetafactory
Reviewed-by: jvernee
This commit is contained in:
parent
4d4951a442
commit
681a57f960
3 changed files with 116 additions and 3 deletions
|
@ -185,13 +185,17 @@ import sun.invoke.util.Wrapper;
|
|||
return i < ARG_NAME_CACHE.length ? ARG_NAME_CACHE[i] : "arg$" + (i + 1);
|
||||
}
|
||||
|
||||
private static String lambdaClassName(Class<?> targetClass) {
|
||||
private static String sanitizedTargetClassName(Class<?> targetClass) {
|
||||
String name = targetClass.getName();
|
||||
if (targetClass.isHidden()) {
|
||||
// use the original class name
|
||||
name = name.replace('/', '_');
|
||||
}
|
||||
return name.replace('.', '/').concat("$$Lambda");
|
||||
return name.replace('.', '/');
|
||||
}
|
||||
|
||||
private static String lambdaClassName(Class<?> targetClass) {
|
||||
return sanitizedTargetClassName(targetClass).concat("$$Lambda");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -430,7 +434,7 @@ import sun.invoke.util.Wrapper;
|
|||
public void accept(CodeBuilder cob) {
|
||||
cob.new_(SerializationSupport.CD_SerializedLambda)
|
||||
.dup()
|
||||
.ldc(classDesc(targetClass))
|
||||
.ldc(ClassDesc.ofInternalName(sanitizedTargetClassName(targetClass)))
|
||||
.ldc(factoryType.returnType().getName().replace('.', '/'))
|
||||
.ldc(interfaceMethodName)
|
||||
.ldc(interfaceMethodType.toMethodDescriptorString())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue