Skip to content

Commit df07255

Browse files
committed
8297984: Turn on warnings as errors for javadoc
Reviewed-by: serb, erikj
1 parent 227364d commit df07255

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

.github/workflows/main.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ on:
3535
platforms:
3636
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
3737
required: true
38-
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64'
38+
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
3939
configure-arguments:
4040
description: 'Additional configure arguments'
4141
required: false
@@ -65,6 +65,7 @@ jobs:
6565
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
6666
windows-x64: ${{ steps.include.outputs.windows-x64 }}
6767
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
68+
docs: ${{ steps.include.outputs.docs }}
6869

6970
steps:
7071
# This function must be inlined in main.yml, or we'd be forced to checkout the repo
@@ -116,6 +117,7 @@ jobs:
116117
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
117118
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
118119
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
120+
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
119121
120122
###
121123
### Build jobs
@@ -276,6 +278,23 @@ jobs:
276278
make-arguments: ${{ github.event.inputs.make-arguments }}
277279
if: needs.select.outputs.windows-aarch64 == 'true'
278280

281+
build-docs:
282+
name: docs
283+
needs: select
284+
uses: ./.github/workflows/build-linux.yml
285+
with:
286+
platform: linux-x64
287+
debug-levels: '[ "debug" ]'
288+
make-target: 'docs-jdk-bundles'
289+
# Make sure we never try to make full docs, since that would require a
290+
# build JDK, and we do not need the additional testing of the graphs.
291+
extra-conf-options: '--disable-full-docs'
292+
gcc-major-version: '10'
293+
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
294+
configure-arguments: ${{ github.event.inputs.configure-arguments }}
295+
make-arguments: ${{ github.event.inputs.make-arguments }}
296+
if: needs.select.outputs.docs == 'true'
297+
279298
###
280299
### Test jobs
281300
###

make/Docs.gmk

+5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ REFERENCE_TAGS := $(JAVADOC_TAGS)
102102
JAVADOC_DISABLED_DOCLINT_WARNINGS := missing
103103
JAVADOC_DISABLED_DOCLINT_PACKAGES := org.w3c.* javax.smartcardio
104104

105+
# Allow overriding on the command line
106+
# (intentionally sharing name with the javac option)
107+
JAVA_WARNINGS_ARE_ERRORS ?= -Werror
108+
105109
# The initial set of options for javadoc
106110
JAVADOC_OPTIONS := -use -keywords -notimestamp \
107111
-encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
@@ -333,6 +337,7 @@ define SetupApiDocsGenerationBody
333337
# Ignore the doclint warnings in certain packages
334338
$1_OPTIONS += -Xdoclint/package:$$(call CommaList, $$(addprefix -, \
335339
$$(JAVADOC_DISABLED_DOCLINT_PACKAGES)))
340+
$1_OPTIONS += $$(JAVA_WARNINGS_ARE_ERRORS)
336341

337342
$1_DOC_TITLE := $$($1_LONG_NAME)<br>Version $$(VERSION_SPECIFICATION) API \
338343
Specification

src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ public void startAsync() {
394394
* The following code snippet illustrates how this method can be used in
395395
* conjunction with the {@link #startAsync()} method to monitor what happens
396396
* during a test method:
397-
* <p>
397+
*
398398
* {@snippet class="Snippets" region="RecordingStreamStop"}
399399
*
400400
* @return {@code true} if recording is stopped, {@code false} otherwise

0 commit comments

Comments
 (0)