diff --git a/src/data/articles/structured-concurrency-jdk-25/index.mdx b/src/data/articles/structured-concurrency-jdk-25/index.mdx index 1d29a29a..3aa0b73a 100644 --- a/src/data/articles/structured-concurrency-jdk-25/index.mdx +++ b/src/data/articles/structured-concurrency-jdk-25/index.mdx @@ -384,7 +384,7 @@ We can copy from the previous article the implementation of the `FindRepositorie ```java class FindRepositoriesByUserIdCache implements FindRepositoriesByUserIdPort { - private final Map> cache = new HashMap<>(); + private final Map> cache = new ConcurrentHashMap<>(); public FindRepositoriesByUserIdCache() { cache.put( @@ -504,7 +504,7 @@ class GitHubRepository @Override public Map> findRepositories(List userIds) throws InterruptedException { - var repositoriesByUserId = new HashMap>(); + var repositoriesByUserId = new ConcurrentHashMap>(); try (var scope = StructuredTaskScope.open(Joiner.awaitAll())) { userIds.forEach( userId -> {