Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3240

Javadoc gives internal error "com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: linq4j/target/classes/org/apache/calcite/linq4j/Ord$2.class [ERROR] undeclared type variable: E"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.21.0
    • Fix Version/s: 1.21.0
    • Component/s: None
    • Labels:
      None

      Description

      Javadoc gives an internal error on JDK 9 (version 9.0.4) and JDK 10 (version 10.0.2):

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:test-javadoc (default-cli) on project calcite-linq4j: An error has occurred in Test Javadoc report generation: 
      [ERROR] Exit code: 1 - javadoc: error - An internal exception has occurred. 
      [ERROR] 	(com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: /home/jhyde/open1/calcite.2/linq4j/target/classes/org/apache/calcite/linq4j/Ord$2.class
      [ERROR]   undeclared type variable: E
      [ERROR]   Please remove or make sure it appears in the correct subdirectory of the classpath.)
      [ERROR] Please file a bug against the javadoc tool via the Java bug reporting page
      [ERROR] (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com)
      [ERROR] for duplicates. Include error messages and the following diagnostic in your report. Thank you.
      [ERROR] com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: /home/jhyde/open1/calcite.2/linq4j/target/classes/org/apache/calcite/linq4j/Ord$2.class
      [ERROR]   undeclared type variable: E
      [ERROR]   Please remove or make sure it appears in the correct subdirectory of the classpath.
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.badClassFile(ClassReader.java:281)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.findTypeVar(ClassReader.java:966)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readEnclosingMethodAttr(ClassReader.java:1463)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader$10.read(ClassReader.java:1173)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readAttrs(ClassReader.java:1549)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassAttrs(ClassReader.java:1563)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2625)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2718)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2731)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:352)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:284)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1308)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:1242)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements(Symbol.java:800)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems0(Utils.java:2404)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems0(Utils.java:2399)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.recursiveGetItems(Utils.java:2387)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils$17.visitPackage(Utils.java:2372)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils$17.visitPackage(Utils.java:2368)
      [ERROR] 	at jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.accept(Symbol.java:1160)
      [ERROR] 	at java.compiler@10.0.2/javax.lang.model.util.AbstractElementVisitor6.visit(AbstractElementVisitor6.java:106)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems(Utils.java:2381)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getClasses(Utils.java:2121)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getAllClasses(Utils.java:2294)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:277)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:211)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.run(AbstractDoclet.java:117)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.doclet.StandardDoclet.run(StandardDoclet.java:72)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:581)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:430)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:343)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
      [ERROR] 	at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
      [ERROR] 
      [ERROR] Command line was: /usr/lib/jvm/jdk-10/bin/javadoc @options @packages
      [ERROR] 
      [ERROR] Refer to the generated Javadoc files in 'linq4j/target/site/testapidocs' dir.
      

      This occurs in my dev branch for CALCITE-1935, but I am just about to merge that into master, so it will start happening on master.

      The error is reported in Ord.java, but there are no recent changes to that file. If I change that file (e.g. renaming all type variables called E to distinct names E1, E2 etc.) the error pops up in EnumerableDefaults.java. So, it seems to be a problem with javadoc, not our code.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: