Testing article tag
- *diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk
index 7290e086387..5f40bba0e1a 100644
--- a/make/CompileJavaModules.gmk
+++ b/make/CompileJavaModules.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@ $(eval $(call IncludeCustomExtension, CompileJavaModules.gmk))
################################################################################
# Module specific build settings
-java.base_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline
+java.base_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline
java.base_COPY += .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties
java.base_CLEAN += intrinsic.properties
@@ -70,7 +70,7 @@ endif
################################################################################
-java.compiler_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
+java.compiler_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################
@@ -79,7 +79,7 @@ java.datatransfer_COPY += flavormap.properties
################################################################################
-java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference \
+java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility \
'-Xdoclint/package:java.*,javax.*' -Xlint:exports \
--doclint-format html4
java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
@@ -220,15 +220,15 @@ java.scripting_CLEAN += .properties
################################################################################
-java.instrument_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
+java.instrument_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################
-java.logging_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
+java.logging_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################
-java.management_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
+java.management_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################
@@ -249,7 +249,7 @@ java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
################################################################################
-java.sql.rowset_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
+java.sql.rowset_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
java.sql.rowset_CLEAN_FILES += $(wildcard \
$(TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \
$(TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties)
@@ -263,14 +263,14 @@ java.rmi_CLEAN_FILES += $(wildcard \
################################################################################
-java.xml_ADD_JAVAC_FLAGS += -Xdoclint:all/protected \
+java.xml_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility \
'-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \
javax.xml.transform javax.xml.validation javax.xml.xpath)'
java.xml_CLEAN += .properties
################################################################################
-java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' -Xlint:-exports
+java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' -Xlint:-exports
java.naming_CLEAN += jndiprovider.properties
################################################################################
@@ -279,7 +279,7 @@ java.security.jgss_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package
################################################################################
-java.smartcardio_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
+java.smartcardio_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java
index 4759a346d18..06f786f3d27 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,6 @@ import com.sun.source.doctree.ErroneousTree;
import com.sun.source.doctree.IdentifierTree;
import com.sun.source.doctree.IndexTree;
import com.sun.source.doctree.InheritDocTree;
-import com.sun.source.doctree.InlineTagTree;
import com.sun.source.doctree.LinkTree;
import com.sun.source.doctree.LiteralTree;
import com.sun.source.doctree.ParamTree;
@@ -140,16 +139,15 @@ public class Checker extends DocTreePathScanner Aria attribute test Label test Teletype text Testing section tag Testing article tag page title.
+ case MODULE:
+ case PACKAGE:
+ case CLASS:
+ case INTERFACE:
+ case ENUM:
+ case ANNOTATION_TYPE:
+ implicitHeadingRank = 1;
+ break;
+
+ // this is for html files
+ // ... if it is a legacy package.html, the doc comment comes after the
page title
+ // ... otherwise, (e.g. overview file and doc-files/*.html files) no additional headings are inserted
+ case COMPILATION_UNIT:
+ implicitHeadingRank = fo.isNameCompatible("package", JavaFileObject.Kind.HTML) ? 1 : 0;
+ break;
+
+ // the following are for member declarations, which appear in the page
+ // for the enclosing type, and so appear after the
"Members"
+ // aggregate heading and the specific
"Member signature" heading.
+ case METHOD:
+ case VARIABLE:
+ implicitHeadingRank = 3;
+ break;
+
+ default:
+ Assert.error("unexpected tree kind: " + p.getLeaf().getKind() + " " + fo);
+ }
+
scan(new DocTreePath(p, tree), null);
if (!isOverridingMethod) {
@@ -328,9 +357,9 @@ public class Checker extends DocTreePathScanner
...
...
+ // check for out of sequence headings, such as ...
...
case H1: case H2: case H3: case H4: case H5: case H6:
- checkHeader(tree, t);
+ checkHeading(tree, t);
break;
}
@@ -446,23 +475,27 @@ public class Checker extends DocTreePathScanner Header
+ * Class heading
*/
-public class ImplicitHeadersTest {
+public class ImplicitHeadingsTest {
+ /**
+ * Method heading
+ * @param args command-line args
+ */
public static void main(String... args) {
File testSrc = new File(System.getProperty("test.src"));
- File testFile = new File(testSrc, ImplicitHeadersTest.class.getSimpleName() + ".java");
+ File testFile = new File(testSrc, ImplicitHeadingsTest.class.getSimpleName() + ".java");
String[] javadocArgs = { "-d", "out", testFile.getPath() };
int rc = jdk.javadoc.internal.tool.Main.execute(javadocArgs);
if (rc != 0)
diff --git a/test/langtools/tools/doclint/AccessibilityTest.java b/test/langtools/tools/doclint/AccessibilityTest.java
index 305c1543766..50bfabcd9b0 100644
--- a/test/langtools/tools/doclint/AccessibilityTest.java
+++ b/test/langtools/tools/doclint/AccessibilityTest.java
@@ -10,17 +10,37 @@
/** */
public class AccessibilityTest {
+ /**
+ * ...
+ */
+ public class Bad_H1 { }
+
+ /**
+ * ...
+ */
+ public class Missing_H2 { }
+
+ /**
+ * ...
+ * ...
+ */
+ public class Missing_H3 { }
/**
* ...
*/
- public void missing_h1() { }
+ public void bad_h2() { }
/**
- * ...
- * ...
+ * ...
*/
- public void missing_h2() { }
+ public void missing_h3() { }
+
+ /**
+ * ...
+ * ...
+ */
+ public void missing_h4() { }
/**
*
diff --git a/test/langtools/tools/doclint/AccessibilityTest.out b/test/langtools/tools/doclint/AccessibilityTest.out
index 20354af7982..94c7611232a 100644
--- a/test/langtools/tools/doclint/AccessibilityTest.out
+++ b/test/langtools/tools/doclint/AccessibilityTest.out
@@ -1,13 +1,25 @@
-AccessibilityTest.java:15: error: header used out of sequence:
- *
...
+AccessibilityTest.java:14: error: unexpected heading used: , compared to implicit preceding heading:
+ *
...
^
-AccessibilityTest.java:21: error: header used out of sequence:
+AccessibilityTest.java:19: error: heading used out of sequence:
, compared to implicit preceding heading:
*
...
^
-AccessibilityTest.java:26: error: no "alt" attribute for image
+AccessibilityTest.java:25: error: heading used out of sequence: , compared to previous heading:
+ *
...
+ ^
+AccessibilityTest.java:30: error: unexpected heading used: , compared to implicit preceding heading:
+ *
...
+ ^
+AccessibilityTest.java:40: error: unexpected heading used: , compared to implicit preceding heading:
+ *
...
+ ^
+AccessibilityTest.java:41: error: heading used out of sequence: , compared to previous heading:
+ *
...
+ ^
+AccessibilityTest.java:46: error: no "alt" attribute for image
*
^
-AccessibilityTest.java:41: error: no summary or caption for table
+AccessibilityTest.java:61: error: no summary or caption for table
*
^
-4 errors
+8 errors
diff --git a/test/langtools/tools/doclint/html/BlockTagsTest.java b/test/langtools/tools/doclint/html/BlockTagsTest.java
index 66406673c38..4042dc49e00 100644
--- a/test/langtools/tools/doclint/html/BlockTagsTest.java
+++ b/test/langtools/tools/doclint/html/BlockTagsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
* @library ..
* @modules jdk.compiler/com.sun.tools.doclint
* @build DocLintTester
- * @run main DocLintTester -Xmsgs BlockTagsTest.java
+ * @run main DocLintTester -Xmsgs:-accessibility BlockTagsTest.java
*/
/** */
diff --git a/test/langtools/tools/doclint/html/HtmlVersionTagsAttrsTest.java b/test/langtools/tools/doclint/html/HtmlVersionTagsAttrsTest.java
index 2ae4ca91478..f65431cd81b 100644
--- a/test/langtools/tools/doclint/html/HtmlVersionTagsAttrsTest.java
+++ b/test/langtools/tools/doclint/html/HtmlVersionTagsAttrsTest.java
@@ -83,7 +83,7 @@ public class HtmlVersionTagsAttrsTest {
*
* head data
* Topics
+ * Topics
* Section
- * Another heading
+ * Section
+ * Another heading
*
* hgroup no longer supported in HTML5.
* Section
+ * Section
* Section text.
* Article
+ * Article
* Article text.
*
diff --git a/test/langtools/tools/doclint/tidy/AnchorAlreadyDefined.java b/test/langtools/tools/doclint/tidy/AnchorAlreadyDefined.java
index 5ed12822649..efcc4eef11c 100644
--- a/test/langtools/tools/doclint/tidy/AnchorAlreadyDefined.java
+++ b/test/langtools/tools/doclint/tidy/AnchorAlreadyDefined.java
@@ -13,6 +13,6 @@
/**
* valid
* duplicate
- *
duplicate
+ * duplicate
*/
public class AnchorAlreadyDefined { }
diff --git a/test/langtools/tools/doclint/tidy/AnchorAlreadyDefined.out b/test/langtools/tools/doclint/tidy/AnchorAlreadyDefined.out
index 89075016b52..ec745ab16e6 100644
--- a/test/langtools/tools/doclint/tidy/AnchorAlreadyDefined.out
+++ b/test/langtools/tools/doclint/tidy/AnchorAlreadyDefined.out
@@ -2,6 +2,6 @@ AnchorAlreadyDefined.java:15: error: anchor already defined: "here"
* duplicate
^
AnchorAlreadyDefined.java:16: error: anchor already defined: "here"
- * duplicate
+ * duplicate
^
2 errors
diff --git a/test/langtools/tools/doclint/tidy/MissingTag.java b/test/langtools/tools/doclint/tidy/MissingTag.java
index 48f3008093a..973de870900 100644
--- a/test/langtools/tools/doclint/tidy/MissingTag.java
+++ b/test/langtools/tools/doclint/tidy/MissingTag.java
@@ -13,6 +13,6 @@
/**
*