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

Javadoc IllegalArgumentException: HTML special chars in constant value

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b111
    • Introduced In Version:
      9
    • Resolved In Build:
      b19
    • CPU:
      x86_64
    • OS:
      windows

      Backports

        Description

        ADDITIONAL SYSTEM INFORMATION :
        Microsoft Windows [Version 10.0.16299.431]

        A DESCRIPTION OF THE PROBLEM :
        Javadoc 9 and 10 fails (pre Javadoc 9 works) when creating javadoc with

          [javadoc] java.lang.IllegalArgumentException: "F&O BASIS-WERTPAPIER-REFERENZ"
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.check(HtmlDocletWriter.java:1306)

        This string value "F&O BASIS-WERTPAPIER-REFERENZ" is a constant within an inner class:

        -----------------------------
        public final class MyClass extends Superclass {
        ...
        static public final class MyInnerClass {
                /** F\u0026O Basis-Wertpapier-Referenz: ISIN des Basispapiers, zu dem der Future/Option gehört ({@value}). */
                static public final String ISINUNDERLYING = "F-O BASIS-WERTPAPIER-REFERENZ"; //javadoc error workaround: remove &
        -----------------------------

        If I remove the "&", the exception does not occur. All files are in UTF-8. Works with pre-Java 9 versions.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        See above.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Same behaviour as in pre Java 9 versions.
        ACTUAL -
          [javadoc] java.lang.IllegalArgumentException: "F&O BASIS-WERTPAPIER-REFERENZ"
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.check(HtmlDocletWriter.java:1306)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.getDocLink(HtmlDocletWriter.java:1300)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.getDocLink(HtmlDocletWriter.java:1277)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.getDocLink(HtmlDocletWriter.java:1260)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.TagletWriterImpl.valueTagOutput(TagletWriterImpl.java:409)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.ValueTaglet.getTagletOutput(ValueTaglet.java:161)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.TagletWriter.getInlineTagOutput(TagletWriter.java:274)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter$2.defaultAction(HtmlDocletWriter.java:1921)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter$2.defaultAction(HtmlDocletWriter.java:1716)
          [javadoc] at jdk.compiler/com.sun.source.util.SimpleDocTreeVisitor.visitValue(SimpleDocTreeVisitor.java:499)
          [javadoc] at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCValue.accept(DCTree.java:1050)
          [javadoc] at jdk.compiler/com.sun.source.util.SimpleDocTreeVisitor.visit(SimpleDocTreeVisitor.java:79)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.commentTagsToContent(HtmlDocletWriter.java:1930)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.addCommentTags(HtmlDocletWriter.java:1621)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.addCommentTags(HtmlDocletWriter.java:1602)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.addInlineComment(HtmlDocletWriter.java:1588)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.MethodWriterImpl.addComments(MethodWriterImpl.java:180)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.buildMethodComments(MethodBuilder.java:196)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.buildMethodDoc(MethodBuilder.java:152)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.build(MethodBuilder.java:128)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildMethodDetails(ClassBuilder.java:393)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildMemberDetails(ClassBuilder.java:341)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildClassDoc(ClassBuilder.java:145)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.build(ClassBuilder.java:120)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:267)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:277)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:211)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.run(AbstractDoclet.java:117)
          [javadoc] at jdk.javadoc/jdk.javadoc.doclet.StandardDoclet.run(StandardDoclet.java:72)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:581)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:430)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:343)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
          [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)

        CUSTOMER SUBMITTED WORKAROUND :
        Use pre Java 9 or remove the "&" from the constant string.

        FREQUENCY : always


          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: