Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278182

Add Optional.orElseThrow(String errorMsg) that throws NoSuchElementEx(errorMsg)

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      There should be an overloaded method to Optional.orElseThrows that accepts a String, then throws a NoSuchElementException with the String argument passed into the constructor. This is much more convenient than Optional.orElseThrows(() -> throw new NoSuchElementException(" error message "));


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: