有人知道这个警告是什么意思吗?
o.s.b.CachedIntrospectionResults - Not strongly caching class because it is not cache-safe
这是我的游戏框架应用程序中记录的警告。似乎与春季的class有关,但我找不到更多信息...
似乎是从org.springframework.beans.CachedIntrospectionResults#forClass
库的spring-beans
方法引发的消息,该方法使用org.springframework.util.ClassUtils#isCacheSafe
库的spring-core
方法检查类是否是缓存安全的。
CachedIntrospectionResults#forClass:
/**
* Create CachedIntrospectionResults for the given bean class.
* @param beanClass the bean class to analyze
* @return the corresponding CachedIntrospectionResults
* @throws BeansException in case of introspection failure
*/
static CachedIntrospectionResults forClass(Class<?> beanClass) {
...
if (ClassUtils.isCacheSafe(...)) {
...
}
else {
...
logger.debug("Not strongly caching class [" + beanClass.getName() + "] because it is not cache-safe");
}
...
}
ClassUtils#isCacheSafe:
/**
* Check whether the given class is cache-safe in the given context,
* i.e. whether it is loaded by the given ClassLoader or a parent of it.
* @param clazz the class to analyze
* @param classLoader the ClassLoader to potentially cache metadata in
* (may be {@code null} which indicates the system class loader)
*/
public static boolean isCacheSafe(Class<?> clazz, @Nullable ClassLoader classLoader) {
...
也许CachedIntrospectionResults和ClassUtils类的来源会有所帮助。