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

Unclosed inline tags cause misalignment in summary tables

XMLWordPrintable

    • 17
    • b14
    • generic
    • generic

        ADDITIONAL SYSTEM INFORMATION :
        Java 21

        A DESCRIPTION OF THE PROBLEM :
        The issue is occurring because JDK 21 constructs the "Method Summary" in HTML without utilizing <td> and <tr> tags as it did in Java 8.

        If there are <i>, <b>, or any other tags in the first line of the JavaDocs, then the entire JavaDocs becomes misaligned.

        ```HTML
            /**
             * <p>
             * <i> <b>This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List
             * API is subject to the Beta Service Participation terms of the <a
             * href="https://aws.amazon.com/service-terms/">Amazon Web Services Service Terms</a> (Section 1.10).</b> </i>
             * </p>
             * <p>
             */
        ```

        - Note that the above JavaDoc is correct since it has both opening and closing <i>, but they are on different lines.
        - However, when Java 21 generates JavaDocs HTML for "Method Summary," it only selects the first line.
        - It selects <i> without </i>, which is three lines down. Due to the absence of the closing </i> tag in the table, the entire JavaDoc HTML becomes distorted.
        - To see an example, refer to https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/pricing/PricingClient.html#describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest and observe "This feature is in preview release and is subject to change." in the Method Summary.

        A similar JavaDoc with the same content generated from Java 8 can be observed functioning correctly at https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/pricing/AWSPricing.html.

        REGRESSION : Last worked in version 8

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Try generating a Java doc with the first line as below in any API

            /**
             * <p>
             * <i> <b>This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List
             * API is subject to the Beta Service Participation terms of the <a
             * href="https://aws.amazon.com/service-terms/">Amazon Web Services Service Terms</a> (Section 1.10).</b> </i>
             * </p>
             * <p>
        */
        public void recreateIssue(){
        }

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        - The Java Doc generation should generate tables with <td> and <tr> so that any missing closing tags due to its presence in multiple line should not leak.
        - Or Java Doc generation should pick the complete line till it gets Java Doc
        ACTUAL -
        Good case : https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/pricing/AWSPricing.html

        ---------- BEGIN SOURCE ----------
        Generate Java doc with Java 21 for a code with Java Doc as https://github.com/aws/aws-sdk-java/blob/aa74c25a97b185df33a32e0934a463655c71f3a4/aws-java-sdk-pricing/src/main/java/com/amazonaws/services/pricing/AWSPricing.java#L141-L170
        ---------- END SOURCE ----------

        FREQUENCY : always


              hannesw Hannes Wallnoefer
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: