mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-33358 - AIOOBE: TextOccurrencesUtil$.process
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user