Integrated: 8314592: Add shortcut to SymbolLookup::find

Per Minborg pminborg at openjdk.org
Wed Apr 24 12:00:59 UTC 2024


On Mon, 25 Mar 2024 14:56:23 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.

This pull request has now been integrated.

Changeset: e923dfe4
Author:    Per Minborg <pminborg at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e923dfe4c51291099d9b7411e6c9f20be79b9a53
Stats:     151 lines in 22 files changed: 88 ins; 0 del; 63 mod

8314592: Add shortcut to SymbolLookup::find

Reviewed-by: jvernee, prr

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

PR: https://git.openjdk.org/jdk/pull/18474


More information about the core-libs-dev mailing list