From 96c5ff87ef1f00689ea245fd912f71694517cc43 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 31 May 2018 10:26:32 +0200 Subject: [PATCH] DATACMNS-1328 - DefaultRepositoryInvokerFactory now uses a ConcurrentHashMap. We now use ConcurrentHashMap to prevent ConcurrentModificationExceptions in multithreaded access to repository invokers. --- .../repository/support/DefaultRepositoryInvokerFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactory.java b/src/main/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactory.java index 421eaade9..08481e8b5 100644 --- a/src/main/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactory.java +++ b/src/main/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactory.java @@ -17,9 +17,9 @@ package org.springframework.data.repository.support; import static org.springframework.data.util.Optionals.*; -import java.util.HashMap; import java.util.Map; import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; import org.springframework.core.convert.ConversionService; import org.springframework.data.repository.CrudRepository; @@ -67,7 +67,7 @@ public class DefaultRepositoryInvokerFactory implements RepositoryInvokerFactory this.repositories = repositories; this.conversionService = conversionService; - this.invokers = new HashMap<>(); + this.invokers = new ConcurrentHashMap<>(); } /*