PsiElementVisitor (@NotNull final ProblemsHolder holder, boolean isOnTheFly) { PsiFile file = holder.getFile(); VirtualFile virtualFile = file.getVirtualFile(); if (!JavaFeature.STREAMS.isFeatureSupported(file) || virtualFile == null || !FileIndexFacade.getInstance(holder.getProject()).isInSourceContent(virtualFile)) { return PsiElementVisitor.EMPTY_VISITOR; } return new StreamApiMigrationVisitor(holder, isOnTheFly); }