File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/data/articles/structured-concurrency-jdk-25 Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ We can copy from the previous article the implementation of the `FindRepositorie
384384```java
385385class FindRepositoriesByUserIdCache implements FindRepositoriesByUserIdPort {
386386
387- private final Map<UserId, List<Repository>> cache = new HashMap <>();
387+ private final Map<UserId, List<Repository>> cache = new ConcurrentHashMap <>();
388388
389389 public FindRepositoriesByUserIdCache() {
390390 cache.put(
@@ -504,7 +504,7 @@ class GitHubRepository
504504 @Override
505505 public Map<UserId , List<Repository > > findRepositories (List<UserId > userIds )
506506 throws InterruptedException {
507- var repositoriesByUserId = new HashMap <UserId , List<Repository > > ();
507+ var repositoriesByUserId = new ConcurrentHashMap <UserId , List<Repository > > ();
508508 try (var scope = StructuredTaskScope . open(Joiner . awaitAll())) {
509509 userIds. forEach(
510510 userId - > {
You can’t perform that action at this time.
0 commit comments