List<PsiLiteralExpression> (@NotNull StringLiteralSearchQuery query, @NotNull Project project) { final GlobalSearchScope scope = GlobalSearchScope.projectScope(project); final List<String> words = ContainerUtil.filter(StringUtil.getWordsInStringLongestFirst(query.stringToFind), s -> s.length() >= query.minStringLength); if (words.isEmpty()) return Collections.emptyList(); List<PsiLiteralExpression> foundExpressions = new SmartList<>(); CacheManager.getInstance(project).processVirtualFilesWithAllWords(words, UsageSearchContext.IN_STRINGS, scope, true, new Processor<>() { int filesWithLiterals; @Override public boolean process(VirtualFile f) { FileViewProvider viewProvider = PsiManager.getInstance(project).findViewProvider(f); // important: skip non-java files with given word in literal (IDEA-126201) if (viewProvider == null || viewProvider.getPsi(JavaLanguage.INSTANCE) == null) return true; PsiFile psiFile = viewProvider.getPsi(viewProvider.getBaseLanguage()); if (psiFile != null) { List<PsiLiteralExpression> duplicateLiteralsInFile = findDuplicateLiteralsInFile(query.stringToFind, query.ignorePropertyKeys, psiFile); if (!duplicateLiteralsInFile.isEmpty()) { foundExpressions.addAll(duplicateLiteralsInFile); if (query.isOnFlySearch && ++filesWithLiterals >= MAX_FILES_TO_ON_THE_FLY_SEARCH) { return false; } } } return true; } }); return foundExpressions; }