RFR: Support preview features in libraries

Vicente Romero vromero at openjdk.org
Wed Feb 4 17:49:59 UTC 2026


On Wed, 4 Feb 2026 16:44:19 GMT, Dan Smith <dlsmith at openjdk.org> wrote:

> Always allow preview class files, compile standard libs with --enable-preview

suggestion for all langtools tests to pass:


diff --git a/test/langtools/tools/javac/diags/examples.not-yet.txt b/test/langtools/tools/javac/diags/examples.not-yet.txt
index a1a56c3d445..254659d4f59 100644
--- a/test/langtools/tools/javac/diags/examples.not-yet.txt
+++ b/test/langtools/tools/javac/diags/examples.not-yet.txt
@@ -233,3 +233,6 @@ compiler.misc.attribute.not.applicable.to.field.type                     # bad c
 compiler.misc.attribute.only.applicable.to.fields                        # bad class file
 compiler.warn.suspicious.nullness.conversion
 compiler.err.restricted.array.missing.init
+
+#temporary bworld-apis
+compiler.warn.preview.feature.use.classfile
\ No newline at end of file
diff --git a/test/langtools/tools/javac/diags/examples/PrimitivePatternMatching.java b/test/langtools/tools/javac/diags/examples/PrimitivePatternMatching.java
index 2b953084f3d..15577e7c6c8 100644
--- a/test/langtools/tools/javac/diags/examples/PrimitivePatternMatching.java
+++ b/test/langtools/tools/javac/diags/examples/PrimitivePatternMatching.java
@@ -24,7 +24,6 @@
 // key: compiler.misc.feature.primitive.patterns
 // key: compiler.warn.preview.feature.use.plural
 // as of Valhalla, j.l.Record is a preview class:
-// key: compiler.warn.preview.feature.use.classfile
 // options: --enable-preview -source ${jdk.version} -Xlint:preview
 
 class PrimitivePatternMatching {
diff --git a/test/langtools/tools/javac/preview/classReaderTest/Client.java b/test/langtools/tools/javac/preview/classReaderTest/Client.java
index 74bb99327d6..a9ac174f840 100644
--- a/test/langtools/tools/javac/preview/classReaderTest/Client.java
+++ b/test/langtools/tools/javac/preview/classReaderTest/Client.java
@@ -3,8 +3,6 @@
  * @bug 8199194
  * @summary smoke test for --enabled-preview classreader support
  * @compile -XDforcePreview --enable-preview -source ${jdk.version} Bar.java
- * @compile/fail/ref=Client.nopreview.out -Xlint:preview -XDrawDiagnostics Client.java
- * @compile/fail/ref=Client.preview.out -Werror -Xlint:preview -XDrawDiagnostics --enable-preview -source ${jdk.version} Client.java
  */
 
 public class Client {

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

PR Comment: https://git.openjdk.org/valhalla/pull/2037#issuecomment-3848860358


More information about the valhalla-dev mailing list