Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-9126

Javadoc linting options silently swallow documentation errors

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Workaround
    • None
    • 9.0
    • None
    • None
    • New

    Description

      I tried to compile javadocs in gradle and I couldn't do it... The output was full of errors.

      I eventually narrowed the problem down to lint options – how they are interpreted and parsed just doesn't make any sense to me. Try this:

      # Examples below use plain javadoc from Java 11.
      cd lucene/core
      

      This emulates what we have in Ant (this is roughly the options Ant emits):

      javadoc -d build\output -encoding "UTF-8" -sourcepath src\java -subpackages org -quiet -Xdoclint:all -Xdoclint:-missing -Xdoclint:-accessibility
      => no errors.
      

      Now rerun it with this syntax:

      javadoc -d build\output -encoding "UTF-8" -sourcepath src\java -subpackages org -quiet -Xdoclint:all,-missing,-accessibility
      => 100 errors, 5 warnings
      

      This time javadoc displays errors about undefined tags (unknown tag: lucene.experimental), HTML warnings (warning: empty <big> tag), etc.

      Let's add our custom tags and add overview file:

      javadoc -overview "src/java/overview.html" -tag "lucene.experimental:a:xxx" -tag "lucene.internal:a:xxx" -tag "lucene.spi:t:xxx" -d build\output -encoding "UTF-8" -sourcepath src\java -subpackages org -quiet -Xdoclint:all,-missing,-accessibility
      => 100 errors, 5 warnings
      => still HTML warnings
      

      Let's get rid of html linting:

      javadoc -overview "src/java/overview.html" -tag "lucene.experimental:a:xxx" -tag "lucene.internal:a:xxx" -tag "lucene.spi:t:xxx" -d build\output -encoding "UTF-8" -sourcepath src\java -subpackages org -quiet -Xdoclint:all,-missing,-accessibility,-html
      => 3 errors
      => malformed HTML syntax in overview.html: src\java\overview.html:150: error: bad use of '>' (<blockquote><tt>>)
      

      Finally, let's get rid of syntax linting:

      javadoc -overview "src/java/overview.html" -tag "lucene.experimental:a:xxx" -tag "lucene.internal:a:xxx" -tag "lucene.spi:t:xxx" -d build\output -encoding "UTF-8" -sourcepath src\java -subpackages org -quiet -Xdoclint:all,-missing,-accessibility,-html,-syntax
      => passes
      

      There are definitely bugs in our documentation – look at the extra ">" in the overview file, for example:
      https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/overview.html#L150

      What I can't understand is why the first syntax suppresses pretty much ALL the errors, including missing custom tag definitions. This should work, given what's written in [1]?

      [1] https://docs.oracle.com/en/java/javase/11/tools/javadoc.html

      Attachments

        Issue Links

          Activity

            People

              dweiss Dawid Weiss
              dweiss Dawid Weiss
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: