processor passed to searchReferences() can be invoked from multiple threads, so we need synchronization around the results array (EA-72834)

This commit is contained in:
Dmitry Jemerov
2015-09-09 12:35:27 +02:00
parent 0096f2668c
commit 736a60cc18
@@ -71,7 +71,7 @@ public abstract class KotlinFindUsagesHandler<T : PsiElement>(psiElement: T,
protected abstract fun searchReferences(element: PsiElement, processor: Processor<UsageInfo>, options: FindUsagesOptions): Boolean
override fun findReferencesToHighlight(target: PsiElement, searchScope: SearchScope): Collection<PsiReference> {
val results = ArrayList<PsiReference>()
val results = Collections.synchronizedList(arrayListOf<PsiReference>())
val options = getFindUsagesOptions().clone()
options.searchScope = searchScope
searchReferences(target, object : Processor<UsageInfo> {