AbstractApplicationContext clears ReflectionUtils cache as well
Issue: SPR-13783
This commit is contained in:
parent
78dad4cfc3
commit
fdc14a16ee
|
@ -77,6 +77,7 @@ import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
|||
import org.springframework.core.io.support.ResourcePatternResolver;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* Abstract implementation of the {@link org.springframework.context.ApplicationContext}
|
||||
|
@ -867,13 +868,15 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* Reset Spring's common core caches, in particular the {@link ResolvableType}
|
||||
* and the {@link CachedIntrospectionResults} caches.
|
||||
* Reset Spring's common core caches, in particular the {@link ReflectionUtils},
|
||||
* {@link ResolvableType} and {@link CachedIntrospectionResults} caches.
|
||||
* @since 4.2
|
||||
* @see ReflectionUtils#clearCache()
|
||||
* @see ResolvableType#clearCache()
|
||||
* @see CachedIntrospectionResults#clearClassLoader(ClassLoader)
|
||||
*/
|
||||
protected void resetCommonCaches() {
|
||||
ReflectionUtils.clearCache();
|
||||
ResolvableType.clearCache();
|
||||
CachedIntrospectionResults.clearClassLoader(getClassLoader());
|
||||
}
|
||||
|
|
|
@ -739,6 +739,15 @@ public abstract class ReflectionUtils {
|
|||
}, COPYABLE_FIELDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the internal method/field cache.
|
||||
* @since 4.2.4
|
||||
*/
|
||||
public static void clearCache() {
|
||||
declaredMethodsCache.clear();
|
||||
declaredFieldsCache.clear();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Action to take on each method.
|
||||
|
|
Loading…
Reference in New Issue