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

javadoc crashes:: class cast exeception com.sun.tools.javac.code.Symtab$6

    Details

    • Subcomponent:
    • Introduced In Build:
      b01
    • Introduced In Version:
      11

      Description

      ADDITIONAL SYSTEM INFORMATION :
      System 76 Pop!_OS 19.10 (base on Ubunu)
      openjdk version 11.0.6 (2020-01-14)

      Note: I selected 'always' as the frequency because the bug repeats when I re-run javadoc. This
      is the first time I've seen it, however, and don't know at this point if it will go away when I fix some
      warning messages.

      A DESCRIPTION OF THE PROBLEM :
      When running javadoc on a file with some errors, the following error message and stack trace was generated:

      ava.lang.ClassCastException: class com.sun.tools.javac.code.Symtab$6 cannot be cast to class com.sun.tools.javac.code.Symbol$ClassSymbol (com.sun.tools.javac.code.Symtab$6 and com.sun.tools.javac.code.Symbol$ClassSymbol are in module jdk.compiler of loader 'app')
      at jdk.compiler/com.sun.tools.javac.code.Symbol.outermostClass(Symbol.java:490)
      at jdk.javadoc/jdk.javadoc.internal.tool.ToolEnvironment.getFileKind(ToolEnvironment.java:196)
      at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable.isTypeElementSelected(ElementsTable.java:985)
      at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable$IncludedVisitor.visitType(ElementsTable.java:1062)
      at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable$IncludedVisitor.visitType(ElementsTable.java:1038)
      at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:1447)
      at java.compiler@11.0.6/javax.lang.model.util.AbstractElementVisitor6.visit(AbstractElementVisitor6.java:106)
      at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable.isIncluded(ElementsTable.java:334)
      at jdk.javadoc/jdk.javadoc.internal.tool.DocEnvImpl.isIncluded(DocEnvImpl.java:85)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.isIncluded(Utils.java:2685)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.LinkFactoryImpl.getClassLink(LinkFactoryImpl.java:95)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.links.LinkFactory.getLink(LinkFactory.java:194)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.getLink(HtmlDocletWriter.java:679)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.seeTagToContent(HtmlDocletWriter.java:1051)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter$2.visitLink(HtmlDocletWriter.java:1454)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter$2.visitLink(HtmlDocletWriter.java:1315)
      at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCLink.accept(DCTree.java:538)
      at jdk.compiler/com.sun.source.util.SimpleDocTreeVisitor.visit(SimpleDocTreeVisitor.java:79)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.commentTagsToContent(HtmlDocletWriter.java:1530)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.TagletWriterImpl.paramTagOutput(TagletWriterImpl.java:239)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.ParamTaglet.processParamTag(ParamTaglet.java:289)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.ParamTaglet.processParamTags(ParamTaglet.java:259)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.ParamTaglet.getTagletOutput(ParamTaglet.java:164)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.ParamTaglet.getTagletOutput(ParamTaglet.java:137)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.TagletWriter.genTagOutput(TagletWriter.java:242)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.addTagsInfo(HtmlDocletWriter.java:332)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.MethodWriterImpl.addTags(MethodWriterImpl.java:207)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.buildTagInfo(MethodBuilder.java:193)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.buildMethodDoc(MethodBuilder.java:140)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.build(MethodBuilder.java:115)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildMethodDetails(ClassBuilder.java:393)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildMemberDetails(ClassBuilder.java:341)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildClassDoc(ClassBuilder.java:145)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.build(ClassBuilder.java:120)
      at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:264)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:286)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:268)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:207)
      at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.run(AbstractDoclet.java:114)
      at jdk.javadoc/jdk.javadoc.doclet.StandardDoclet.run(StandardDoclet.java:72)
      at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:588)
      at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:432)
      at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:345)
      at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
      at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      The javadoc command being run was
      javadoc -d /home/wtz/Projects/libbzdev/BUILD/api --module-path BUILD \
      --module-source-path src:tmpsrc \
      --add-modules org.bzdev.base,org.bzdev.obnaming,org.bzdev.desktop,org.bzdev.ejws,org.bzdev.devqsim,org.bzdev.drama,org.bzdev.anim2d,org.bzdev.p3d \
      -link file:///usr/share/doc/openjdk-11-doc/api \
      -overview src/overview.html \
      --module org.bzdev.base,org.bzdev.obnaming,org.bzdev.desktop,org.bzdev.ejws,org.bzdev.devqsim,org.bzdev.drama,org.bzdev.anim2d,org.bzdev.p3d \
      -exclude org.bzdev.protocols.resource:org.bzdev.protocols.sresource:org.bzdev.graphs.symbols:org.bzdev.obnaming.lpack:: | grep -E -v -e '^Generating' \
      | grep -E -v -e '^Copying file'
      (copied from a Makefile - the '::" is the result of the makefile contatenating package names. Eliminating it does not change the behavior).

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      javadoc runs to completion.
      ACTUAL -
      the stack trace given above (it had instructions as to where to file a bug report).

      ---------- BEGIN SOURCE ----------
       Not currently available. I was using javadoc for a class library with over 150,000 lines of code. One file was being edited, and there were some javadoc errors when the crash occurred. It is not clear at this point if the crash was due to that file or something else. I've saved the file that was modified in case that caused the error but would have to test that separately.

      Please contact me if you want the file for which warnings occurred.
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          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: