boolean (VirtualFile file, int[] offsets, PsiManager manager, PsiMethod targetMethod, Processor<? super PsiExpression> consumer, DumbService dumbService) { return dumbService.runReadActionInSmartMode(() -> { PsiFile psiFile = Objects.requireNonNull(manager.findFile(file)); if (!(psiFile instanceof PsiJavaFile)) { LOG.error("Non-java file " + psiFile + "; " + file); return true; } for (int offset : offsets) { PsiJavaToken plusToken = PsiTreeUtil.findElementOfClassAtOffset(psiFile, offset, PsiJavaToken.class, false); if (plusToken == null) { LOG.error("plusToken shouldn't be null in " + psiFile + " at " + offset); continue; } PsiElement parent = plusToken.getParent(); if (parent instanceof PsiPolyadicExpression polyadicExpression) { PsiType exprType = polyadicExpression.getType(); if (exprType == null || !exprType.equalsToText(CommonClassNames.JAVA_LANG_STRING)) { continue; } PsiExpression[] operands = polyadicExpression.getOperands(); for (PsiExpression operand : operands) { if (!processPolyadicExprOperand(operand, consumer, targetMethod)) { return false; } } } } return true; }); }