EA-33358 - AIOOBE: TextOccurrencesUtil$.process

This commit is contained in:
Alexey Kudravtsev
2012-03-28 15:39:40 +04:00
parent 698f66b46e
commit ab3b899408
@@ -108,11 +108,14 @@ public class TextOccurrencesUtil {
@NotNull String stringToSearch,
@NotNull final Collection<UsageInfo> results,
@NotNull final UsageInfoFactory factory) {
final Object lock = new Object();
processUsagesInStringsAndComments(element, stringToSearch, false, new PairProcessor<PsiElement, TextRange>() {
public boolean process(PsiElement commentOrLiteral, TextRange textRange) {
UsageInfo usageInfo = factory.createUsageInfo(commentOrLiteral, textRange.getStartOffset(), textRange.getEndOffset());
if (usageInfo != null) {
results.add(usageInfo);
synchronized (lock) {
results.add(usageInfo);
}
}
return true;
}