mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8317356: Fix missing null checks in the ClassFile API
Co-authored-by: Nizar Benalla <nbenalla@openjdk.org> Reviewed-by: asotona
This commit is contained in:
parent
60713463c7
commit
a2c775222e
36 changed files with 249 additions and 116 deletions
|
@ -54,6 +54,7 @@ import java.lang.classfile.CodeBuilder;
|
|||
import java.lang.classfile.TypeKind;
|
||||
|
||||
import jdk.internal.constant.ConstantUtils;
|
||||
import jdk.internal.loader.ClassLoaders;
|
||||
import jdk.internal.module.Modules;
|
||||
import jdk.internal.reflect.CallerSensitive;
|
||||
import jdk.internal.reflect.Reflection;
|
||||
|
@ -371,7 +372,8 @@ public class MethodHandleProxies {
|
|||
*/
|
||||
private static byte[] createTemplate(ClassLoader loader, ClassDesc proxyDesc, ClassDesc ifaceDesc,
|
||||
String methodName, List<MethodInfo> methods) {
|
||||
return ClassFile.of(ClassHierarchyResolverOption.of(ClassHierarchyResolver.ofClassLoading(loader)))
|
||||
return ClassFile.of(ClassHierarchyResolverOption.of(ClassHierarchyResolver.ofClassLoading(loader == null ?
|
||||
ClassLoaders.platformClassLoader() : loader)))
|
||||
.build(proxyDesc, clb -> {
|
||||
clb.withSuperclass(CD_Object)
|
||||
.withFlags(ACC_FINAL | ACC_SYNTHETIC)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue