RFR: 8314592: Add shortcut to SymbolLookup::find [v6]

Phil Race prr at openjdk.org
Thu Apr 18 18:02:57 UTC 2024


On Thu, 18 Apr 2024 11:32:13 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> 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.
>> 
>> This PR proposes to add a convenience method `SymbolLookup::findOrThrow` that will do a lookup and, if no symbol can be found, throws an `IllegalArgumentException` with a relevant exception message.
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Change exception type

I'm OK with the minimal changes in the desktop code.

-------------

Marked as reviewed by prr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18474#pullrequestreview-2009552015


More information about the client-libs-dev mailing list