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

-Xdoclint doesn't report missing/unexpected comments

    XMLWordPrintable

    Details

      Backports

        Description

        ADDITIONAL SYSTEM INFORMATION :
        openjdk full version "14+36-1461"

        A DESCRIPTION OF THE PROBLEM :
        The behavior of Xdoclint's "missing" group doesn't work as expected for javadoc (note that it does for javac)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        * create 2 directories, 1 named "docs", 1 named "foo"
        * in "foo", create a file Doc.java as provided below
        * open a terminal in "docs" and run the following 2 commands:
        ** javadoc -private -Xdoclint:all ../foo/Doc.java
        ** javac -Xdoclint:all ../foo/Doc.java

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Both commands give equivalent results and report 3 warnings, namely:
        ..\foo\Doc.java:4: warning: documentation comment not expected here
        package foo;
        ^
        ..\foo\Doc.java:6: warning: no comment
        public class Doc {
               ^
        ..\foo\Doc.java:8: warning: no comment
            public void bar() {
                        ^
        3 warnings
        ACTUAL -
        The javadoc command doesn't report any warnings, whereas the javac command reports the expected result.

        ---------- BEGIN SOURCE ----------
        /**
         * Something unexpected.
         */
        package foo;

        public class Doc {

            public void bar() {

            }

        }

        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Use javac instead of javadoc

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jjg Jonathan Gibbons
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: