Skip to content

Commit 819bae3

Browse files
author
Pawel Badenski
committed
Fix concurrency issues
As per: http://stackoverflow.com/a/3752264/4220980
1 parent 3c9a3c5 commit 819bae3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/org/axonframework/intellij/ide/plugin/publisher/DefaultEventPublisherProvider.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ public void scanPublishers(final Project project, GlobalSearchScope scope, final
3737
cleanClosedProjects();
3838
Set<PsiMethod> psiMethods = publisherMethodsPerProject.get(project);
3939
if (psiMethods == null) {
40-
psiMethods = new HashSet<PsiMethod>();
41-
publisherMethodsPerProject.put(project, psiMethods);
40+
final Set<PsiMethod> newHashSet = new HashSet<PsiMethod>();
41+
psiMethods = publisherMethodsPerProject.putIfAbsent(project, newHashSet);
42+
if (psiMethods == null) {
43+
psiMethods = newHashSet;
44+
}
4245
}
4346
psiMethods.addAll(findMethods(project, GlobalSearchScope.allScope(project),
4447
"org.axonframework.eventsourcing.AbstractEventSourcedAggregateRoot", "apply"));

0 commit comments

Comments
 (0)