[foreign-memaccess+abi] RFR: 8314592: Add shortcut to SymbolLookup::find

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Aug 18 17:13:23 UTC 2023


This patch adds a default method in `SymbolLookup`, namely `SymbolLookup::get`. Its implementation is very simple: it calls `SymbolLookup::find` and then `Optional::get` on the result. This allows to simplify many clients that end up calling `Optional::get` or `Optional::orElseThrow` after a symbol lookup, but still retains the compositional advantage of the optional-returning lookup primitive.

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

Commit messages:
 - Initial push

Changes: https://git.openjdk.org/panama-foreign/pull/871/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=871&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8314592
  Stats: 55 lines in 12 files changed: 11 ins; 0 del; 44 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/871.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign.git pull/871/head:pull/871

PR: https://git.openjdk.org/panama-foreign/pull/871


More information about the panama-dev mailing list