JDK-8151191 : javac error when running javadoc on some inner classes
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-03-03
  • Updated: 2016-04-25
  • Resolved: 2016-04-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b114Fixed
Related Reports
Relates :  
Description
To reproduce this, you need to apply the patch for JDK-8150130 to a recent jdk9-dev and then use that JDK to build the JavaFX docs as described in JDK-8150130.

We get the following exception:

javadoc: error - jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException: jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException: jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException: com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: /localhome/kcr/javafx/9-kcr/jfx/rt/modules/web/build/classes/main/javafx/scene/web/HTMLEditorSkin$2.class
  bad enclosing method attribute for class javafx.scene.web.HTMLEditorSkin$2
  Please remove or make sure it appears in the correct subdirectory of the classpath.

Comments
Based on a suggestion from Kumar, I was able to come up with a workaround, which I will push to FX this week. See JDK-8151565
09-03-2016

Problem comes from reading class files for local or anon inner classes, when the enclosing class is being read from source.
03-03-2016

Turning on debugging, the issue seems to lie deep within javac. Caused by: com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: /scratch/kumasrin/JFX/9-dev/rt/modules/web/build/classes/main/javafx/scene/web/HTMLEditorSkin$2.class bad enclosing method attribute for class javafx.scene.web.HTMLEditorSkin$2 Please remove or make sure it appears in the correct subdirectory of the classpath. at com.sun.tools.javac.jvm.ClassReader.badClassFile(ClassReader.java:260) at com.sun.tools.javac.jvm.ClassReader.readEnclosingMethodAttr(ClassReader.java:1159) at com.sun.tools.javac.jvm.ClassReader$11.read(ClassReader.java:1031) at com.sun.tools.javac.jvm.ClassReader.readAttrs(ClassReader.java:1265) at com.sun.tools.javac.jvm.ClassReader.readClassAttrs(ClassReader.java:1279) at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2230) at com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2321) at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2334) at com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:350) at com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:287) at com.sun.tools.javac.code.ClassFinder.access$000(ClassFinder.java:74) at com.sun.tools.javac.code.ClassFinder$1.complete(ClassFinder.java:166) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:590) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1085) at com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:1019) at com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements(Symbol.java:756) at jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems0(Utils.java:2259) at jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems0(Utils.java:2254) at jdk.javadoc.internal.doclets.toolkit.util.Utils.recursiveGetItems(Utils.java:2242) at jdk.javadoc.internal.doclets.toolkit.util.Utils$14.visitPackage(Utils.java:2227) at jdk.javadoc.internal.doclets.toolkit.util.Utils$14.visitPackage(Utils.java:2223) at com.sun.tools.javac.code.Symbol$PackageSymbol.accept(Symbol.java:937) at javax.lang.model.util.AbstractElementVisitor6.visit(AbstractElementVisitor6.java:115) at jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems(Utils.java:2236) at jdk.javadoc.internal.doclets.toolkit.util.Utils.getClasses(Utils.java:2013) at jdk.javadoc.internal.doclets.toolkit.util.Utils.getAllClasses(Utils.java:2146) at jdk.javadoc.internal.doclets.toolkit.util.Utils.findClassInPackageElement(Utils.java:980) at jdk.javadoc.internal.doclets.toolkit.WorkArounds.searchClass(WorkArounds.java:217) at jdk.javadoc.internal.doclets.toolkit.WorkArounds.searchClass(WorkArounds.java:210) at jdk.javadoc.internal.doclets.toolkit.util.Utils.findClass(Utils.java:998) at jdk.javadoc.internal.doclets.toolkit.taglets.ThrowsTaglet.inherit(ThrowsTaglet.java:76) at jdk.javadoc.internal.doclets.toolkit.util.DocFinder.search(DocFinder.java:257) at jdk.javadoc.internal.doclets.toolkit.taglets.ThrowsTaglet.inheritThrowsDocumentation(ThrowsTaglet.java:133) at jdk.javadoc.internal.doclets.toolkit.taglets.ThrowsTaglet.getTagletOutput(ThrowsTaglet.java:164) at jdk.javadoc.internal.doclets.toolkit.taglets.TagletWriter.genTagOutput(TagletWriter.java:246) at jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.addTagsInfo(HtmlDocletWriter.java:308) at jdk.javadoc.internal.doclets.formats.html.MethodWriterImpl.addTags(MethodWriterImpl.java:208) at jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.buildTagInfo(MethodBuilder.java:229) at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:520) at jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.invokeMethod(AbstractBuilder.java:189) at jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:143) ... 50 more
03-03-2016