From 1866c0c2ce925ed5236532cb7e3bdc61a6cd18d5 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Fri, 15 Nov 2024 17:22:11 +0000 Subject: [PATCH] 8344259: Annotate Float16 with jdk.internal.ValueBased Reviewed-by: liach, darcy --- src/java.base/share/classes/module-info.java | 2 ++ .../share/classes/jdk/incubator/vector/Float16.java | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java index d683d837a09..828e0d41504 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java @@ -146,6 +146,8 @@ module java.base { jdk.compiler; exports com.sun.security.ntlm to java.security.sasl; + exports jdk.internal to + jdk.incubator.vector; // Note: all modules in the exported list participate in preview features // and therefore if they use preview features they do not need to be // compiled with "--enable-preview". diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float16.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float16.java index 5a7cdb89dde..f5f5a5a4e7e 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float16.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float16.java @@ -95,8 +95,7 @@ import static java.lang.Math.multiplyHigh; // Currently Float16 is a value-based class and in future it is // expected to be aligned with Value Classes and Object as described in // JEP-401 (https://openjdk.org/jeps/401). -// @jdk.internal.MigratedValueClass -// @jdk.internal.ValueBased +@jdk.internal.ValueBased public final class Float16 extends Number implements Comparable { @@ -323,7 +322,7 @@ public final class Float16 * @param f a {@code float} */ public static Float16 valueOf(float f) { - return new Float16(Float.floatToFloat16(f)); + return new Float16(floatToFloat16(f)); } /**