Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8216463

rename "header" to "heading" in doclint

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 12
    • Fix Version/s: 13
    • Component/s: tools
    • Labels:

      Description

      There are 3 similar terms in HTML5, with distinct usages:

      Head ... the <head> element of an HTML document
      Header ... a <header> element within an HTML document ... new in HTM5 ... one of the newly defined regions of a document
      Heading ... this seems to be the preferred term for any of the <h1>...<h6> group of elements

      The doclint code, which was written before we adopted use of HTML5, uses "header" extensively to describe the collection of HTML tags H1...H6.
      For consistency and sanity, it would be good to update the code to use Heading in preference to Header.

      Here is a quick grep indicating the affected locations. I assume that most could be fixed up with IDE renames.

      $ grep -r -i header $(find src/jdk.compiler -name doclint) | grep -v COPYRIGHT
      src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java: case HEADER: case FOOTER: case MAIN:
      src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java: HEADER(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
      src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java: case HEADER: case FOOTER: case MAIN:
      src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java: attrs(AttrKind.ALL, COLSPAN, ROWSPAN, HEADERS, VALIGN),
      src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java: attrs(AttrKind.ALL, COLSPAN, ROWSPAN, HEADERS, SCOPE, Attr.ABBR,
      src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java: HEADERS,
      src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java: public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:";
      src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java: } else if (arg.matches(XIMPLICIT_HEADERS + "[1-6]")) {
      src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java: env.setImplicitHeaders(Character.digit(ch, 10));
      src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties:dc.tag.header.sequence.1 = \u30D8\u30C3\u30C0\u30FC\u306E\u6307\u5B9A\u9806\u5E8F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: <{0}>
      src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties:dc.tag.header.sequence.2 = \u30D8\u30C3\u30C0\u30FC\u306E\u6307\u5B9A\u9806\u5E8F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: <{0}>
      src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties:dc.tag.header.sequence.1 = header used out of sequence: <{0}>
      src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties:dc.tag.header.sequence.2 = header used out of sequence: <{0}>
      src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties:dc.tag.header.sequence.1 = \u4F7F\u7528\u7684\u6807\u9898\u8D85\u51FA\u5E8F\u5217: <{0}>
      src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties:dc.tag.header.sequence.2 = \u4F7F\u7528\u7684\u6807\u9898\u8D85\u51FA\u5E8F\u5217: <{0}>
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java: int implicitHeaderLevel = 0;
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java: void setImplicitHeaders(int n) {
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java: implicitHeaderLevel = n;
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: private HtmlTag currHeaderTag;
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: private final int implicitHeaderLevel;
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: implicitHeaderLevel = env.implicitHeaderLevel;
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: currHeaderTag = null;
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: // check for out of sequence headers, such as <h1>...</h1> <h3>...</h3>
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: checkHeader(tree, t);
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: private void checkHeader(StartElementTree tree, HtmlTag tag) {
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: if (getHeaderLevel(tag) > getHeaderLevel(currHeaderTag) + 1) {
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: if (currHeaderTag == null) {
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: env.messages.error(ACCESSIBILITY, tree, "dc.tag.header.sequence.1", tag);
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: env.messages.error(ACCESSIBILITY, tree, "dc.tag.header.sequence.2",
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: tag, currHeaderTag);
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: currHeaderTag = tag;
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: private int getHeaderLevel(HtmlTag tag) {
      src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java: return implicitHeaderLevel;

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pmuthuswamy Priya Lakshmi Muthuswamy (Inactive)
                Reporter:
                jjg Jonathan Gibbons
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: