PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!PsiUtil.isLanguageLevel7OrHigher(holder.getFile())) return PsiElementVisitor.EMPTY_VISITOR; return new JavaElementVisitor() { @Override public void visitMethod(@NotNull PsiMethod method) { super.visitMethod(method); PsiCodeBlock methodBody = method.getBody(); if (methodBody == null) return; CallReporter reporter = new CallReporter(methodBody, isOnTheFly, holder); FileAttributeCallsVisitor visitor = new FileAttributeCallsVisitor(methodBody, reporter); methodBody.accept(visitor); reporter.accept(visitor.myCalls); } }; }