DATACMNS-1540 - Use thread-safe path cache in QuerydslPredicateBuilder.

We now use ConcurrentHashMap instead of HashMap to cache Path instances by PathInformation.
This commit is contained in:
Mark Paluch
2019-05-27 08:39:30 +02:00
parent 7a89f1c11f
commit efa529a7a6

View File

@@ -19,11 +19,11 @@ import java.beans.PropertyDescriptor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.beans.PropertyValues;
import org.springframework.core.convert.ConversionService;
@@ -46,6 +46,7 @@ import com.querydsl.core.types.Predicate;
*
* @author Christoph Strobl
* @author Oliver Gierke
* @author Mark Paluch
* @since 1.11
*/
public class QuerydslPredicateBuilder {
@@ -68,7 +69,7 @@ public class QuerydslPredicateBuilder {
this.defaultBinding = new QuerydslDefaultBinding();
this.conversionService = conversionService;
this.paths = new HashMap<>();
this.paths = new ConcurrentHashMap<>();
this.resolver = resolver;
}