void (@NotNull final RefVisitor visitor) { if (visitor instanceof RefJavaVisitor refJavaVisitor) { ApplicationManager.getApplication().runReadAction(() -> refJavaVisitor.visitMethod(this)); } else { super.accept(visitor); } }