|
|
|
|
@ -22,7 +22,6 @@ import java.lang.reflect.Constructor;
@@ -22,7 +22,6 @@ import java.lang.reflect.Constructor;
|
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
|
import java.lang.reflect.Modifier; |
|
|
|
|
import java.lang.reflect.Proxy; |
|
|
|
|
import java.security.AccessControlException; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
@ -365,6 +364,7 @@ public abstract class ClassUtils {
@@ -365,6 +364,7 @@ public abstract class ClassUtils {
|
|
|
|
|
*/ |
|
|
|
|
public static boolean isCacheSafe(Class<?> clazz, ClassLoader classLoader) { |
|
|
|
|
Assert.notNull(clazz, "Class must not be null"); |
|
|
|
|
try { |
|
|
|
|
ClassLoader target = clazz.getClassLoader(); |
|
|
|
|
if (target == null) { |
|
|
|
|
return true; |
|
|
|
|
@ -381,6 +381,11 @@ public abstract class ClassUtils {
@@ -381,6 +381,11 @@ public abstract class ClassUtils {
|
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
catch (SecurityException ex) { |
|
|
|
|
// Probably from the system ClassLoader - let's consider it safe.
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -768,7 +773,7 @@ public abstract class ClassUtils {
@@ -768,7 +773,7 @@ public abstract class ClassUtils {
|
|
|
|
|
return (specificMethod != null ? specificMethod : method); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (AccessControlException ex) { |
|
|
|
|
catch (SecurityException ex) { |
|
|
|
|
// Security settings are disallowing reflective access; fall back to 'method' below.
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|