From df072556a5a155adfe89a2504c2cf680fe4ffac7 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Fri, 2 Dec 2022 14:00:44 +0000 Subject: [PATCH] 8297984: Turn on warnings as errors for javadoc Reviewed-by: serb, erikj --- .github/workflows/main.yml | 21 ++++++++++++++++++- make/Docs.gmk | 5 +++++ .../jdk/jfr/consumer/RecordingStream.java | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 33b8550baf3..cf6d69afefd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ on: platforms: description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")' required: true - default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64' + default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs' configure-arguments: description: 'Additional configure arguments' required: false @@ -65,6 +65,7 @@ jobs: macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }} windows-x64: ${{ steps.include.outputs.windows-x64 }} windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }} + docs: ${{ steps.include.outputs.docs }} steps: # This function must be inlined in main.yml, or we'd be forced to checkout the repo @@ -116,6 +117,7 @@ jobs: echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT + echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT ### ### Build jobs @@ -276,6 +278,23 @@ jobs: make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.windows-aarch64 == 'true' + build-docs: + name: docs + needs: select + uses: ./.github/workflows/build-linux.yml + with: + platform: linux-x64 + debug-levels: '[ "debug" ]' + make-target: 'docs-jdk-bundles' + # Make sure we never try to make full docs, since that would require a + # build JDK, and we do not need the additional testing of the graphs. + extra-conf-options: '--disable-full-docs' + gcc-major-version: '10' + apt-gcc-version: '10.4.0-4ubuntu1~22.04' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} + if: needs.select.outputs.docs == 'true' + ### ### Test jobs ### diff --git a/make/Docs.gmk b/make/Docs.gmk index 0cc5309813f..416a83d2de3 100644 --- a/make/Docs.gmk +++ b/make/Docs.gmk @@ -102,6 +102,10 @@ REFERENCE_TAGS := $(JAVADOC_TAGS) JAVADOC_DISABLED_DOCLINT_WARNINGS := missing JAVADOC_DISABLED_DOCLINT_PACKAGES := org.w3c.* javax.smartcardio +# Allow overriding on the command line +# (intentionally sharing name with the javac option) +JAVA_WARNINGS_ARE_ERRORS ?= -Werror + # The initial set of options for javadoc JAVADOC_OPTIONS := -use -keywords -notimestamp \ -encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \ @@ -333,6 +337,7 @@ define SetupApiDocsGenerationBody # Ignore the doclint warnings in certain packages $1_OPTIONS += -Xdoclint/package:$$(call CommaList, $$(addprefix -, \ $$(JAVADOC_DISABLED_DOCLINT_PACKAGES))) + $1_OPTIONS += $$(JAVA_WARNINGS_ARE_ERRORS) $1_DOC_TITLE := $$($1_LONG_NAME)
Version $$(VERSION_SPECIFICATION) API \ Specification diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java index 233b7634aa2..c77bbd9a2b9 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java @@ -394,7 +394,7 @@ public void startAsync() { * The following code snippet illustrates how this method can be used in * conjunction with the {@link #startAsync()} method to monitor what happens * during a test method: - *

+ * * {@snippet class="Snippets" region="RecordingStreamStop"} * * @return {@code true} if recording is stopped, {@code false} otherwise