Skip to content

Commit bc07a54

Browse files
committed
Clear AnnotationUtils cache after context refresh (along with others)
Issue: SPR-16675
1 parent 8a93216 commit bc07a54

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -66,6 +66,7 @@
6666
import org.springframework.context.weaving.LoadTimeWeaverAware;
6767
import org.springframework.context.weaving.LoadTimeWeaverAwareProcessor;
6868
import org.springframework.core.ResolvableType;
69+
import org.springframework.core.annotation.AnnotationUtils;
6970
import org.springframework.core.convert.ConversionService;
7071
import org.springframework.core.env.ConfigurableEnvironment;
7172
import org.springframework.core.env.Environment;
@@ -900,15 +901,18 @@ protected void cancelRefresh(BeansException ex) {
900901
}
901902

902903
/**
903-
* Reset Spring's common core caches, in particular the {@link ReflectionUtils},
904-
* {@link ResolvableType} and {@link CachedIntrospectionResults} caches.
904+
* Reset Spring's common reflection metadata caches, in particular the
905+
* {@link ReflectionUtils}, {@link AnnotationUtils}, {@link ResolvableType}
906+
* and {@link CachedIntrospectionResults} caches.
905907
* @since 4.2
906908
* @see ReflectionUtils#clearCache()
909+
* @see AnnotationUtils#clearCache()
907910
* @see ResolvableType#clearCache()
908911
* @see CachedIntrospectionResults#clearClassLoader(ClassLoader)
909912
*/
910913
protected void resetCommonCaches() {
911914
ReflectionUtils.clearCache();
915+
AnnotationUtils.clearCache();
912916
ResolvableType.clearCache();
913917
CachedIntrospectionResults.clearClassLoader(getClassLoader());
914918
}

0 commit comments

Comments
 (0)