< prev index next >

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

Print this page
@@ -516,11 +516,11 @@
                          // All proxy superinterfaces are public, must be in named dynamic module
                          throw new InternalError("public proxy in unnamed module: " + module);
                      }
                  }
  
-                 if ((accessFlags & ~Modifier.PUBLIC) != 0) {
+                 if ((accessFlags & ~(Modifier.PUBLIC | Modifier.IDENTITY)) != 0) {
                      throw new InternalError("proxy access flags must be Modifier.PUBLIC or 0");
                  }
              }
          }
  

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