@NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
    return new JavaElementVisitor() {

      @Override
      public void visitNewExpression(@NotNull PsiNewExpression expression) {
        super.visitNewExpression(expression);
        final PsiExpression arg = getZeroArgument(expression.getArgumentList());
        if (arg == null) return;
        final PsiType type = expression.getType();
        if (!TypeUtils.typeEquals(SCHEDULED_THREAD_POOL_EXECUTOR_CLASS_NAME, type)) return;
        holder.registerProblem(arg,
                               JavaBundle.message("scheduled.thread.pool.executor.with.zero.core.threads.description"),
                               ProblemHighlightType.WARNING);
      }

      @Override
      public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) {
        super.visitMethodCallExpression(expression);
        final String methodName = expression.getMethodExpression().getReferenceName();
        if (methodName == null || !methodName.equals(SET_CORE_POOL_SIZE_METHOD_NAME)) return;
        final PsiExpression arg = getZeroArgument(expression.getArgumentList());
        if (arg == null) return;
        final PsiExpression qualifier = expression.getMethodExpression().getQualifierExpression();
        if (qualifier == null) return;
        final TypeConstraint constraint = TypeConstraint.fromDfType(CommonDataflow.getDfType(qualifier));
        final PsiType type = constraint.getPsiType(expression.getProject());
        if (!TypeUtils.typeEquals(SCHEDULED_THREAD_POOL_EXECUTOR_CLASS_NAME, type)) return;
        holder.registerProblem(arg,
                               JavaBundle.message("scheduled.thread.pool.executor.with.zero.core.threads.description"),
                               ProblemHighlightType.WARNING);
      }
    };
  }
@NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly)