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

javadoc rejects '@' in multi-line attribute value

XMLWordPrintable

    • b23
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      The javadoc specifcation "https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html" says "-docfilessubdirs [...] Recursively copies doc-file subdirectories."
      But the implementation obviously does not copy the contained files but tries to process them, which contradicts this specification.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      (1) build the three files as given below (2) cd to "doc" (3) "source ./provokeError.sh"

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The xhtml file should be copied into the generated doc file without any complaints, according to the tool specification.
      ACTUAL -
      error messages:
      ../src/testpackage/doc-files/testHtml.html:11: warning: invalid input: '<'
          <a title='S
          ^
      ../src/testpackage/doc-files/testHtml.html:14: warning: invalid input: '<'
           <a title='S
           ^
      ../src/testpackage/doc-files/testHtml.html:12: warning: Tag @see: reference not found: Modifier' >S</a>
              @see Modifier ' >S</a>
              ^
        
             <a title='S


      ---------- BEGIN SOURCE ----------
      doc/provokeError.sh
      -------------------------
      #!/usr/bin/bash
      /usr/lib/jvm/java-17-openjdk-amd64/bin/javadoc -Xdoclint:-html \
      -sourcepath ../src -d . -docfilessubdirs testpackage
      ----------------------
      src/testpackage/TestClass.java
      ----------------------
      package testpackage ;
      public class TestClass {
      }
      ----------------------
      src/testpackage/doc-files/testHtml.html
      -----------------------
      <?xml version="1.0" encoding="UTF-8" ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-st>
      <html xmlns='http://www.w3.org/1999/xhtml&#39; xmlns:xml='http://www.w3.org/XML/1998/namespace&#39;>
        <head><title>LLJava UMod Source Visualization</title>
        </head>

        <body>
          <p>
          <a title=' @see ' href='x'>X</a>

          <a title='S
              @see Modifier ' >S</a>

           <a title='S
              @see &lt;ABC&gt;
              @see &lt;a&gt;'>A</a>
          </p>
      </body></html>

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

      CUSTOMER SUBMITTED WORKAROUND :
      A bash script which uses "rsync" or "cp" to copy the files in the doc-files subdirs indenpendently from javadoc

      FREQUENCY : always


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

              Created:
              Updated:
              Resolved: