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

Bogus warning generated for record with compact constructor

XMLWordPrintable

    • b29
    • generic
    • generic

        A DESCRIPTION OF THE PROBLEM :
        If a record has a compact constructor, a comment for the constructors describing the parameters is required even if the parameters have already been described in the record comment.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Simply "javadoc X.java"

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        No warnings
        ACTUAL -
        X.java:7: warning: no @param for i
            public X { }

        ---------- BEGIN SOURCE ----------
        /**
         * Comment.
         * @param i comment
         */
        public record X(int i) {
            /** Comment. */
            public X { }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Move the parameter description to the comment of the constructor.

        FREQUENCY : always


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

                Created:
                Updated:
                Resolved: