DATAREST-1489 - Fixed caches in PersistentEntitiesResourceMappings.
We now consistently use ConcurrentReferenceHashMap for all caches to make PersistentEntitiesResourceMappings thread-safe.
This commit is contained in:
@@ -21,7 +21,6 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.springframework.data.mapping.PersistentEntity;
|
||||
import org.springframework.data.mapping.PersistentProperty;
|
||||
@@ -42,9 +41,9 @@ public class PersistentEntitiesResourceMappings implements ResourceMappings {
|
||||
private final SearchResourceMappings searchResourceMappings = new SearchResourceMappings(
|
||||
Collections.<MethodResourceMapping> emptyList());
|
||||
|
||||
private final Map<Class<?>, ResourceMetadata> cache = new ConcurrentHashMap<>();
|
||||
private final Map<Class<?>, ResourceMetadata> cache = new ConcurrentReferenceHashMap<>();
|
||||
private final Map<Class<?>, MappingResourceMetadata> mappingCache = new ConcurrentReferenceHashMap<>();
|
||||
private final Map<PersistentProperty<?>, ResourceMapping> propertyCache = new HashMap<PersistentProperty<?>, ResourceMapping>();
|
||||
private final Map<PersistentProperty<?>, ResourceMapping> propertyCache = new ConcurrentReferenceHashMap<PersistentProperty<?>, ResourceMapping>();
|
||||
|
||||
/**
|
||||
* Creates a new {@link PersistentEntitiesResourceMappings} from the given {@link PersistentEntities}.
|
||||
|
||||
Reference in New Issue
Block a user