diff --git a/spring-test/src/main/java/org/springframework/test/context/support/DefaultContextCache.java b/spring-test/src/main/java/org/springframework/test/context/support/DefaultContextCache.java index bcb5c21df4..511a85f611 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/DefaultContextCache.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/DefaultContextCache.java @@ -21,10 +21,12 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.style.ToStringCreator; @@ -32,19 +34,16 @@ import org.springframework.test.annotation.DirtiesContext.HierarchyMode; import org.springframework.test.context.ContextCache; import org.springframework.test.context.MergedContextConfiguration; import org.springframework.util.Assert; -import org.springframework.util.ConcurrentReferenceHashMap; /** * Default implementation of the {@link ContextCache} API. * - *
Uses Spring's {@link ConcurrentReferenceHashMap} to store - * {@linkplain java.lang.ref.SoftReference soft references} to cached - * contexts and {@code MergedContextConfiguration} instances. + *
Uses {@link ConcurrentHashMap ConcurrentHashMaps} to cache
+ * {@link ApplicationContext} and {@link MergedContextConfiguration} instances.
*
* @author Sam Brannen
* @author Juergen Hoeller
* @since 2.5
- * @see ConcurrentReferenceHashMap
*/
public class DefaultContextCache implements ContextCache {
@@ -54,7 +53,7 @@ public class DefaultContextCache implements ContextCache {
* Map of context keys to Spring {@code ApplicationContext} instances.
*/
private final Map