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

Javadoc doesn't work properly if {@summary} tag is not defined first

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      The Javadoc tool doesn't properly generate the Javadoc when {@summary} tag is not used first. Also with certain HTML elements, the same behavior can be obtained.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Make a test class in any package (Here I have used TestP package), add Javadoc to the top class. Generate the Javadoc using CLI or any in IDE tool if you use it.
      I can't attach screenshots as proof otherwise I would have.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The summary for the class - The first line doesn't end with a period

      The summary for the method - The first line doesn't end with a period
      ACTUAL -
      The summary for the class - The first line doesn't end with a period This will be included in summary when it shouldn't be.

      The summary for the method - The first line doesn't end with a period

      ---------- BEGIN SOURCE ----------
      package TestP;

      /**
       * The first line doesn't end with a period
       * {@summary This will be included in summary when it shouldn't be.}
       */
      public class Test {

          /**
           * <p>The first line doesn't end with a period</p>
           * {@summary This will be not be included in summary.}
           */
          public void method() {
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      As a workaround for now, if you add a period at the end of the top sentence, the contents of the summary tag are not included in the actual Javadoc summary.

      FREQUENCY : always


        1. WithoutPeriod.png
          13 kB
          Anupam Dev
        2. WithPeriod.png
          10 kB
          Anupam Dev

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: