Skip to content

Commit 0a58cff

Browse files
jonathan-gibbonsJim Laskey
andcommitted
8298405: Implement JEP 467: Markdown Documentation Comments
8329296: Update Elements for '///' documentation comments Co-authored-by: Jim Laskey <[email protected]> Reviewed-by: prappo, darcy, hannesw
1 parent 39a55e9 commit 0a58cff

File tree

250 files changed

+26315
-707
lines changed

Some content is hidden

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

250 files changed

+26315
-707
lines changed

make/CompileDemos.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ $(eval $(call SetupBuildDemo, SwingSet2, \
183183
))
184184

185185
$(eval $(call SetupBuildDemo, Font2DTest, \
186-
DISABLED_WARNINGS := rawtypes deprecation unchecked serial cast this-escape, \
186+
DISABLED_WARNINGS := rawtypes deprecation unchecked serial cast this-escape dangling-doc-comments, \
187187
DEMO_SUBDIR := jfc, \
188188
))
189189

make/autoconf/spec.gmk.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ DOCS_REFERENCE_JAVADOC := @DOCS_REFERENCE_JAVADOC@
675675
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker
676676

677677
# Interim langtools modules and arguments
678-
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc
678+
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.internal.md jdk.javadoc
679679
INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES))
680680
INTERIM_LANGTOOLS_ADD_EXPORTS := \
681681
--add-exports java.base/sun.reflect.annotation=jdk.compiler.interim \

make/jdk/src/classes/build/tools/taglet/JSpec.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -30,6 +30,8 @@
3030
import java.util.Set;
3131
import java.util.regex.Matcher;
3232
import java.util.regex.Pattern;
33+
import java.util.stream.Collectors;
34+
3335
import javax.lang.model.element.Element;
3436

3537
import com.sun.source.doctree.DocTree;
@@ -157,7 +159,10 @@ public String toString(List<? extends DocTree> tags, Element elem) {
157159
continue;
158160
}
159161

160-
String tagText = contents.toString().trim();
162+
String tagText = contents.stream()
163+
.map(Object::toString)
164+
.collect(Collectors.joining())
165+
.trim();
161166
Matcher m = TAG_PATTERN.matcher(tagText);
162167
if (m.find()) {
163168
String chapter = m.group("chapter");

make/jdk/src/classes/build/tools/taglet/ToolGuide.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -30,6 +30,8 @@
3030
import java.util.Set;
3131
import java.util.regex.Matcher;
3232
import java.util.regex.Pattern;
33+
import java.util.stream.Collectors;
34+
3335
import javax.lang.model.element.Element;
3436
import javax.lang.model.element.PackageElement;
3537
import javax.lang.model.element.TypeElement;
@@ -105,8 +107,11 @@ public String toString(List<? extends DocTree> tags, Element elem) {
105107
continue;
106108
}
107109

108-
UnknownBlockTagTree blockTag = (UnknownBlockTagTree)tag;
109-
String tagText = blockTag.getContent().toString().trim();
110+
UnknownBlockTagTree blockTag = (UnknownBlockTagTree) tag;
111+
String tagText = blockTag.getContent().stream()
112+
.map(Object::toString)
113+
.collect(Collectors.joining())
114+
.trim();
110115
Matcher m = TAG_PATTERN.matcher(tagText);
111116
if (m.matches()) {
112117
String name = m.group("name");

make/modules/java.base/Java.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# new warning is added to javac, it can be temporarily added to the
2828
# disabled warnings list.
2929
#
30-
# DISABLED_WARNINGS_java +=
30+
DISABLED_WARNINGS_java += dangling-doc-comments
3131

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

make/modules/jdk.incubator.vector/Java.gmk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 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,4 +23,6 @@
2323
# questions.
2424
#
2525

26+
DISABLED_WARNINGS_java += dangling-doc-comments
27+
2628
DOCLINT += -Xdoclint:all/protected

make/modules/jdk.jpackage/Java.gmk

Lines changed: 3 additions & 1 deletion
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
27+
2628
COPY += .gif .png .txt .spec .script .prerm .preinst \
2729
.postrm .postinst .list .sh .desktop .copyright .control .plist .template \
2830
.icns .scpt .wxs .wxl .wxi .ico .bmp .tiff .service

make/modules/jdk.unsupported/Java.gmk

Lines changed: 26 additions & 0 deletions
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

make/test/BuildMicrobenchmark.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 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
@@ -95,7 +95,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
9595
SMALL_JAVA := false, \
9696
CLASSPATH := $(JMH_COMPILE_JARS), \
9797
DISABLED_WARNINGS := restricted this-escape processing rawtypes cast \
98-
serial preview, \
98+
serial preview dangling-doc-comments, \
9999
SRC := $(MICROBENCHMARK_SRC), \
100100
BIN := $(MICROBENCHMARK_CLASSES), \
101101
JAVAC_FLAGS := \

src/java.base/share/classes/jdk/internal/jrtfs/JrtFileAttributes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 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
@@ -46,7 +46,7 @@ final class JrtFileAttributes implements BasicFileAttributes {
4646
this.node = node;
4747
}
4848

49-
///////// basic attributes ///////////
49+
//-------- basic attributes --------
5050
@Override
5151
public FileTime creationTime() {
5252
return node.creationTime();
@@ -92,7 +92,7 @@ public Object fileKey() {
9292
return node.resolveLink(true);
9393
}
9494

95-
///////// jrtfs specific attributes ///////////
95+
//-------- jrtfs specific attributes --------
9696
/**
9797
* Compressed resource file. If not available or not applicable, 0L is
9898
* returned.

0 commit comments

Comments
 (0)