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

Add shortcut to SymbolLookup::find

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 23
    • 22
    • core-libs
    • None

      While SymbolLookup correctly uses an Optional return to denote whether a symbol has been found by the lookup or not (which enables composition of symbol lookups), many clients end up just calling Optional::get, or Optional::orElseThrow() on the result.

      As such, it would be better if SymbolLookup provided a default method, namely SymbolLookup::get which calls Optional::get on behalf of the user.

            pminborg Per-Ake Minborg
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: