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

Bad result for the snippet @link tag if substring/regex consists of whitespace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 19
    • 18
    • tools
    • Java: 18-ea; OpenJDK 64-Bit Server VM 18-ea+27-1924

      Runtime: OpenJDK Runtime Environment 18-ea+27-1924

      System: Windows 10 version 10.0 running on amd64; UTF-8; en_IN (nb)

        What happened
        ----------------------
        Javadoc snippet output displays class name defined in the "target" attribute of @link tag instead of white space hyperlink.

        How to reproduce
        ------------------------
        use below code and generate javadoc using jdk-18.

        public class TestJavaDoc{
        /**
             * {@snippet :
             * class HelloWorld {
             * public static void main(String... args) {
             * System.out.println("Hello World!");// @highlight substring=" " type="highlighted"
             * System.out.println("Hello World!");// @link substring=" " target="System#out"
             * }
             * }
             * }
             */

        public void errorsInLinkTag(){}
        }

        Actual Output (PFA)
        -------------------
        For highlight tag, output is correct.
        For link tag, "System " is displayed over the white space.

        Expected Output:
        -----------------------
        White space used in substring or regex handled properly with hyperlink.

              prappo Pavel Rappo (Inactive)
              aksinsin Akhilesh Singh
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: