Note on ClassLoader.defineClass being used as a fallback only

This commit is contained in:
Juergen Hoeller
2021-09-30 18:26:01 +02:00
parent f6a392c5ae
commit ad873617d2

View File

@@ -63,6 +63,8 @@ public class ReflectUtils {
// SPRING PATCH BEGIN
static {
// Resolve protected ClassLoader.defineClass method for fallback use
// (even if JDK 9+ Lookup.defineClass is preferably used below)
Method classLoaderDefineClass;
Throwable throwable = null;
try {
@@ -453,7 +455,7 @@ public class ReflectUtils {
// in case of plain LinkageError (class already defined)
// or IllegalArgumentException (class in different package):
// fall through to traditional ClassLoader.defineClass below
t = target;
t = ex;
}
catch (Throwable ex) {
throw new CodeGenerationException(ex);