@NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
    return !PsiUtil.isModuleFile(holder.getFile()) ? PsiElementVisitor.EMPTY_VISITOR : new JavaElementVisitor() {
      @Override
      public void visitRequiresStatement(@NotNull PsiRequiresStatement statement) {
        super.visitRequiresStatement(statement);
        PsiJavaModuleReferenceElement refElement = statement.getReferenceElement();
        if (refElement != null) {
          PsiJavaModule target = statement.resolve();
          if (target instanceof LightJavaModule) {
            if (!TRANSITIVE_ONLY) {
              holder.registerProblem(refElement, JavaAnalysisBundle.message("inspection.requires.auto.module.message"));
            }
            else if (statement.hasModifierProperty(PsiModifier.TRANSITIVE)) {
              holder.registerProblem(refElement, JavaAnalysisBundle.message("inspection.requires.auto.module.transitive"));
            }
          }
        }
      }
    };
  }
@NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly)