< prev index next >

src/java.base/share/classes/java/lang/reflect/Proxy.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 1999, 2026, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

@@ -23,10 +23,11 @@
   * questions.
   */
  
  package java.lang.reflect;
  
+ import java.lang.classfile.ClassFile;
  import java.lang.invoke.MethodHandle;
  import java.lang.invoke.MethodHandles;
  import java.lang.invoke.MethodType;
  import java.lang.invoke.WrongMethodTypeException;
  import java.lang.module.ModuleDescriptor;

@@ -465,11 +466,11 @@
  
              /*
               * Generate the specified proxy class.
               */
              byte[] proxyClassFile = ProxyGenerator.generateProxyClass(loader, proxyName, interfaces,
-                                                                       context.accessFlags() | Modifier.FINAL);
+                                                                       context.accessFlags() | Modifier.FINAL | ClassFile.ACC_IDENTITY);
              try {
                  Class<?> pc = JLA.defineClass(loader, proxyName, proxyClassFile,
                                                null, "__dynamic_proxy__");
                  reverseProxyCache.sub(pc).putIfAbsent(loader, Boolean.TRUE);
                  return pc;
< prev index next >