Summary
Specify what happens on unsupported platforms when using the foreign linker (CLinker) API.
Problem
The behavihour of jdk.incubator.foreign.CLinker on unsupported platforms is currently unspecified.
Solution
Specify that class initialization of CLinker on unsupported platforms will fail.
Specification
diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java
index 0c29f115aa6..d9b53c742e6 100644
--- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java
+++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java
@@ -94,6 +94,8 @@
* {@link #asVarArg(MemoryLayout)} is used to create the memory layouts for each parameter corresponding to a variadic
* argument in a specialized function descriptor.
*
+ * <p>On unsupported platforms this class will fail to initialize with an {@link ExceptionInInitializerError}.
+ *
* @apiNote In the future, if the Java language permits, {@link CLinker}
* may become a {@code sealed} interface, which would prohibit subclassing except by
* explicitly permitted types.
- csr of
-
JDK-8256862 Several java/foreign tests fail on x86_32 platforms
-
- Closed
-