Skip to content

Commit a920af2

Browse files
8303689: javac -Xlint could/should report on "dangling" doc comments
Reviewed-by: vromero, ihse, prr
1 parent f3bb3e2 commit a920af2

File tree

58 files changed

+575
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+575
-89
lines changed

Diff for: make/CompileDemos.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ $(eval $(call SetupBuildDemo, SampleTree, \
216216
))
217217

218218
$(eval $(call SetupBuildDemo, TableExample, \
219-
DISABLED_WARNINGS := rawtypes unchecked deprecation this-escape, \
219+
DISABLED_WARNINGS := rawtypes unchecked deprecation this-escape dangling-doc-comments, \
220220
DEMO_SUBDIR := jfc, \
221221
))
222222

Diff for: make/CompileToolsJdk.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
5555
build/tools/depend \
5656
, \
5757
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
58-
DISABLED_WARNINGS := options, \
58+
DISABLED_WARNINGS := dangling-doc-comments options, \
5959
JAVAC_FLAGS := \
6060
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
6161
--add-exports java.base/sun.text=ALL-UNNAMED \

Diff for: make/GenerateLinkOptData.gmk

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@ $(eval $(call SetupJavaCompilation, CLASSLIST_JAR, \
4343
SMALL_JAVA := false, \
4444
SRC := $(TOPDIR)/make/jdk/src/classes, \
4545
INCLUDES := build/tools/classlist, \
46+
DISABLED_WARNINGS := dangling-doc-comments, \
4647
BIN := $(BUILDTOOLS_OUTPUTDIR)/classlist_classes, \
4748
JAR := $(SUPPORT_OUTPUTDIR)/classlist.jar, \
4849
))

Diff for: make/modules/java.desktop/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += lossy-conversions this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments lossy-conversions this-escape
2727
DOCLINT += -Xdoclint:all/protected \
2828
'-Xdoclint/package:java.*,javax.*'
2929
COPY += .gif .png .wav .txt .xml .css .pf

Diff for: make/modules/java.management/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
2727

2828
DOCLINT += -Xdoclint:all/protected \
2929
'-Xdoclint/package:java.*,javax.*'

Diff for: make/modules/java.naming/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
2727

2828
DOCLINT += -Xdoclint:all/protected \
2929
'-Xdoclint/package:java.*,javax.*'

Diff for: make/modules/java.security.jgss/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
2727

2828
DOCLINT += -Xdoclint:all/protected \
2929
'-Xdoclint/package:java.*,javax.*'

Diff for: make/modules/java.security.sasl/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,4 +23,4 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape

Diff for: make/modules/java.sql.rowset/Java.gmk

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,8 @@
2323
# questions.
2424
#
2525

26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
27+
2628
DOCLINT += -Xdoclint:all/protected \
2729
'-Xdoclint/package:java.*,javax.*'
2830
CLEAN_FILES += $(wildcard \

Diff for: make/modules/java.sql/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
2727

2828
DOCLINT += -Xdoclint:all/protected \
2929
'-Xdoclint/package:java.*,javax.*'

Diff for: make/modules/java.xml.crypto/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
2727

2828
DOCLINT += -Xdoclint:all/protected \
2929
'-Xdoclint/package:java.*,javax.*'

Diff for: make/modules/java.xml/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += lossy-conversions this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments lossy-conversions this-escape
2727
DOCLINT += -Xdoclint:all/protected \
2828
'-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \
2929
javax.xml.transform javax.xml.validation javax.xml.xpath)'

Diff for: make/modules/jdk.accessibility/Java.gmk

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation. Oracle designates this
8+
# particular file as subject to the "Classpath" exception as provided
9+
# by Oracle in the LICENSE file that accompanied this code.
10+
#
11+
# This code is distributed in the hope that it will be useful, but WITHOUT
12+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
# version 2 for more details (a copy is included in the LICENSE file that
15+
# accompanied this code).
16+
#
17+
# You should have received a copy of the GNU General Public License version
18+
# 2 along with this work; if not, write to the Free Software Foundation,
19+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
#
21+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
# or visit www.oracle.com if you need additional information or have any
23+
# questions.
24+
#
25+
26+
DISABLED_WARNINGS_java += dangling-doc-comments

Diff for: make/modules/jdk.crypto.cryptoki/Java.gmk

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation. Oracle designates this
8+
# particular file as subject to the "Classpath" exception as provided
9+
# by Oracle in the LICENSE file that accompanied this code.
10+
#
11+
# This code is distributed in the hope that it will be useful, but WITHOUT
12+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
# version 2 for more details (a copy is included in the LICENSE file that
15+
# accompanied this code).
16+
#
17+
# You should have received a copy of the GNU General Public License version
18+
# 2 along with this work; if not, write to the Free Software Foundation,
19+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
#
21+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
# or visit www.oracle.com if you need additional information or have any
23+
# questions.
24+
#
25+
26+
DISABLED_WARNINGS_java += dangling-doc-comments

Diff for: make/modules/jdk.hotspot.agent/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -24,5 +24,5 @@
2424
#
2525

2626
DISABLED_WARNINGS_java += rawtypes serial cast static overrides \
27-
fallthrough this-escape
27+
dangling-doc-comments fallthrough this-escape
2828
COPY += .gif .png .properties

Diff for: make/modules/jdk.internal.le/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,6 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
2727

2828
COPY += .properties .caps .txt

Diff for: make/modules/jdk.internal.vm.ci/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += this-escape
26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
2727

2828
# -parameters provides method's parameters information in class file,
2929
# JVMCI compilers make use of that information for various sanity checks.

Diff for: make/modules/jdk.jdi/Java.gmk

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,8 @@
2323
# questions.
2424
#
2525

26+
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
27+
2628
EXCLUDES += \
2729
com/sun/tools/example/debug/bdi \
2830
com/sun/tools/example/debug/event \

Diff for: make/modules/jdk.jfr/Java.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,6 @@
2323
# questions.
2424
#
2525

26-
DISABLED_WARNINGS_java += exports
26+
DISABLED_WARNINGS_java += dangling-doc-comments exports
2727
COPY := .xsd .xml .dtd .ini
2828
JAVAC_FLAGS := -XDstringConcat=inline

Diff for: make/modules/jdk.security.auth/Java.gmk

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation. Oracle designates this
8+
# particular file as subject to the "Classpath" exception as provided
9+
# by Oracle in the LICENSE file that accompanied this code.
10+
#
11+
# This code is distributed in the hope that it will be useful, but WITHOUT
12+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
# version 2 for more details (a copy is included in the LICENSE file that
15+
# accompanied this code).
16+
#
17+
# You should have received a copy of the GNU General Public License version
18+
# 2 along with this work; if not, write to the Free Software Foundation,
19+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
#
21+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
# or visit www.oracle.com if you need additional information or have any
23+
# questions.
24+
#
25+
26+
DISABLED_WARNINGS_java += dangling-doc-comments

Diff for: make/modules/jdk.zipfs/Java.gmk

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation. Oracle designates this
8+
# particular file as subject to the "Classpath" exception as provided
9+
# by Oracle in the LICENSE file that accompanied this code.
10+
#
11+
# This code is distributed in the hope that it will be useful, but WITHOUT
12+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
# version 2 for more details (a copy is included in the LICENSE file that
15+
# accompanied this code).
16+
#
17+
# You should have received a copy of the GNU General Public License version
18+
# 2 along with this work; if not, write to the Free Software Foundation,
19+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
#
21+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
# or visit www.oracle.com if you need additional information or have any
23+
# questions.
24+
#
25+
26+
DISABLED_WARNINGS_java += dangling-doc-comments
27+

Diff for: make/test/BuildTestLib.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
6464
BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \
6565
HEADERS := $(TEST_LIB_SUPPORT)/test-lib_headers, \
6666
JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \
67-
DISABLED_WARNINGS := try deprecation rawtypes unchecked serial cast removal preview, \
67+
DISABLED_WARNINGS := try deprecation rawtypes unchecked serial cast removal preview dangling-doc-comments, \
6868
JAVAC_FLAGS := --add-exports java.base/sun.security.util=ALL-UNNAMED \
6969
--add-exports java.base/jdk.internal.classfile=ALL-UNNAMED \
7070
--add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \

Diff for: src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1059,6 +1059,11 @@ public String getText() {
10591059
return "";
10601060
}
10611061

1062+
@Override
1063+
public JCDiagnostic.DiagnosticPosition getPos() {
1064+
return null;
1065+
}
1066+
10621067
@Override
10631068
public int getSourcePos(int index) {
10641069
return offset + index;

0 commit comments

Comments
 (0)