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

Allow \n@ inside inline tags.

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P4
    • 15
    • tools
    • None
    • behavioral
    • minimal
    • Just permits the use of a previously invalid syntax
    • File or wire format
    • JDK

    Description

      Summary

      Permit use in comments of lines beginning @ in inline tags

      Problem

      It is currently disallowed to have a line in an inline tag that begins with whitespace @ in a documentation comment. The line is treated as if the inline tag has been prematurely terminated (causing an error) and then the line treated as the beginning of a block tag.

      This means it is not possible to place code samples containing annotations in an inline tag, because the standard practice is to place annotations (which begin with @) at the beginning of a line. This leads to some dreadful hack workarounds.

      Solution

      It is already the case that braces inside an inline tag must be "balanced", meaning an equal number of { and matching } characters. Given that rule, there is no ambiguity with a line beginning with whitespace @

      Specification

      The Documentation Comment Specification for the Standard Doclet is amended to include the following text:

      Lines beginning with @ that are enclosed within an inline tag are not considered as beginning a block tag.

      Attachments

        Issue Links

          Activity

            People

              jjg Jonathan Gibbons
              jjg Jonathan Gibbons
              Pavel Rappo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: