PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { final PsiFile file = holder.getFile(); if (PsiUtil.isLanguageLevel9OrHigher(file)) { final PsiJavaModule javaModule = JavaModuleGraphUtil.findDescriptorByElement(file); if (javaModule != null) { return new JavaElementVisitor() { @Override public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); if (isCallToMethod(expression, JAVA_LANG_CLASS, FOR_NAME) || isCallToMethod(expression, JAVA_LANG_CLASS_LOADER, LOAD_CLASS)) { checkClassVisibility(expression, holder, javaModule); } } }; } } return PsiElementVisitor.EMPTY_VISITOR; }