< prev index next > src/java.base/share/classes/java/lang/reflect/Proxy.java
Print this page
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.BooleanSupplier;
import jdk.internal.access.JavaLangAccess;
import jdk.internal.access.SharedSecrets;
+ import jdk.internal.value.PrimitiveClass;
import jdk.internal.module.Modules;
import jdk.internal.misc.VM;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
import jdk.internal.loader.ClassLoaderValue;
// 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) {
throw new InternalError("proxy access flags must be Modifier.PUBLIC or 0");
}
}
}
// All proxy superinterfaces are public, must be in named dynamic module
throw new InternalError("public proxy in unnamed module: " + module);
}
}
! if ((accessFlags & ~(Modifier.PUBLIC | Modifier.IDENTITY)) != 0) {
throw new InternalError("proxy access flags must be Modifier.PUBLIC or 0");
}
}
}
/*
* Generate the specified proxy class.
*/
byte[] proxyClassFile = ProxyGenerator.generateProxyClass(loader, proxyName, interfaces,
! context.accessFlags() | Modifier.FINAL);
try {
Class<?> pc = JLA.defineClass(loader, proxyName, proxyClassFile,
null, "__dynamic_proxy__");
reverseProxyCache.sub(pc).putIfAbsent(loader, Boolean.TRUE);
return pc;
/*
* Generate the specified proxy class.
*/
byte[] proxyClassFile = ProxyGenerator.generateProxyClass(loader, proxyName, interfaces,
! 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;
Class<?> type = null;
try {
type = Class.forName(c.getName(), false, ld);
} catch (ClassNotFoundException e) {
}
! if (type != c) {
throw new IllegalArgumentException(c.getName() +
" referenced from a method is not visible from class loader: " + JLA.getLoaderNameID(ld));
}
}
Class<?> type = null;
try {
type = Class.forName(c.getName(), false, ld);
} catch (ClassNotFoundException e) {
}
! if (PrimitiveClass.asPrimaryType(type) != PrimitiveClass.asPrimaryType(c)) {
throw new IllegalArgumentException(c.getName() +
" referenced from a method is not visible from class loader: " + JLA.getLoaderNameID(ld));
}
}
< prev index next >