[foreign-abi] RFR: 8253430: Improve the LibraryLookup API [v2]

Jorn Vernee jvernee at openjdk.java.net
Mon Sep 21 14:30:32 UTC 2020


On Mon, 21 Sep 2020 14:27:56 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> This patch implements a couple of suggestion which were made a couple of weeks ago by @BlueGoliath - here:
>> 
>> https://mail.openjdk.java.net/pipermail/panama-dev/2020-July/010140.html
>> 
>> Two ideas here:
>> * Change the signature of `LibraryLookup::ofPath` to actually take a `Path` (rathar than a `String`)
>> * Tweak `LibraryLookup::lookup` to return `Optional` (rather than throw)
>> 
>> Both suggestions seem to change the API for the better. The second one is probably more controversial: on the one hand
>> it removes the need for having exception handling logic and makes it for more composable logic. On the other hand
>> clients have to manually call `get` on the lookup result. But overall seems a win.
>
> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Require absolute path on LibraryLookup::ofPath

Marked as reviewed by jvernee (Committer).

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

PR: https://git.openjdk.java.net/panama-foreign/pull/348


More information about the panama-dev mailing list