From f47e5b2aa4cfd3d22e7c0f9ffe6873b7e80b21b9 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Thu, 7 Nov 2024 11:55:11 +0100 Subject: [PATCH] Adding a test, adjusting the message. --- .../formats/html/resources/standard.properties | 10 +++++++--- .../javadoc/doclet/testPreview/TestPreview.java | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties index 33b81b0b1f04b..9a37f91af744f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties @@ -425,9 +425,13 @@ doclet.UsesDeclaredUsingPreview={0} refers to one or more types which are declar doclet.PreviewTrailingNote1=Programs can only use {0} when preview features are enabled. doclet.PreviewTrailingNote2=Preview features may be removed in a future release, or upgraded to permanent features of the Java platform. doclet.PreviewJavaSERequiresTransitiveJavaBase=\ -
Indirect exports from java.base are associated with requires transitive java.base, a preview feature of the Java language.
\ -
Programs can only use requires transitive java.base when preview features are enabled.
\ -
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
+
Indirect exports from the java.base module are associated \ +with the requires transitive java.base directive, which is \ +a preview feature of the Java language.
\ +
Programs can only use requires transitive java.base when \ +preview features are enabled.
\ +
Preview features may be removed in a future release, or upgraded \ +to permanent features of the Java Platform.
doclet.RestrictedMethod=restricted method doclet.RestrictedLeadingNote={0} is a {1} of the Java platform. doclet.RestrictedTrailingNote1=Programs can only use {0} when access to restricted methods is enabled. diff --git a/test/langtools/jdk/javadoc/doclet/testPreview/TestPreview.java b/test/langtools/jdk/javadoc/doclet/testPreview/TestPreview.java index 369312d690a17..79658e4c606d3 100644 --- a/test/langtools/jdk/javadoc/doclet/testPreview/TestPreview.java +++ b/test/langtools/jdk/javadoc/doclet/testPreview/TestPreview.java @@ -33,6 +33,7 @@ * @run main TestPreview */ +import java.nio.file.Path; import java.nio.file.Paths; import javadoc.tester.JavadocTester; @@ -209,4 +210,18 @@ public void test8282452() { checkOutput("java.base/preview/NoPreview.html", false, "refers to one or more preview"); } + + @Test + public void testRequiresTransitiveJavaBase() { + Path src = Paths.get(testSrc, "requiresTransitiveJavaBase"); + javadoc("-d", "out-requires-transitive-java-base", + "-XDforcePreview", "--enable-preview", "-source", System.getProperty("java.specification.version"), + "--module-source-path", src.toString(), + "--module", "m", + "--expand-requires", "transitive"); + checkExit(Exit.OK); + + checkOutput("m/module-summary.html", true, + "Indirect exports from the java.base module are"); + } }