[foreign-preview] RFR: 8282215: Handle failures when initializing SystemLookup

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Feb 22 10:46:29 UTC 2022


On Tue, 22 Feb 2022 10:39:06 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch handles failures originating from initialization of the SystemLookup class; instead of propagating these failures, we now swallow them, so that initialization of a `CLinker` can proceed. This adds some robustness to client code, and doubles down on the optional return type of the CLinker's lookup method.
> 
> The test checks that, when running with `os.name` set to Windows, we always manage to perform a lookup (even if we are executing the test on Linux/MacOS). The test trivially passes on Windows.

src/java.base/share/classes/java/lang/foreign/SequenceLayout.java line 94:

> 92: 
> 93:     /**
> 94:      * {@return the element count of this sequence layout}

This is an unrelated fix, addressing a javadoc issue introduced by JDK-8282026

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

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


More information about the panama-dev mailing list