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

ExceptionInInitializerError: improve handling of exceptions in user-provided taglets

XMLWordPrintable

        Currently, if a user-provided taglet throws an exception in an initializer, the exception will be wrapped in ExceptionInInitializerError, which is not caught/handled in TagletManager.addCustomTag, with the result that it is reported as a javadoc crash ... as shown in the following trace.

        javadoc: error - An internal exception has occurred.
        (java.lang.ExceptionInInitializerError)
        Please file a bug against the javadoc tool via the Java bug reporting page
        (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com)
        for duplicates. Include error messages and the following diagnostic in your report. Thank you.
        java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
        at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager.addCustomTag(TagletManager.java:263)
        at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.initTagletManager(BaseConfiguration.java:786)
        at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.finishOptionSettings0(BaseConfiguration.java:726)
        at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration.finishOptionSettings0(HtmlConfiguration.java:867)
        at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.setOptions(BaseConfiguration.java:747)
        at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:204)
        at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.run(AbstractDoclet.java:117)
        at jdk.javadoc/jdk.javadoc.doclet.StandardDoclet.run(StandardDoclet.java:72)
        at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:581)
        at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:430)
        at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:343)
        at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
        at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
        Caused by: java.lang.RuntimeException: extlink.spec.version property not set
        at build.tools.taglet.ExtLink.<clinit>(ExtLink.java:60)
        ... 17 more
        1 error

        TagletManager should catch/handle all exceptions that may be caused when instantiating user-provided taglets, and cleanly report them as an issue in the taglet code ... and not as a javadoc issue.

              prappo Pavel Rappo
              jjg Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: