JDK-8149706 : javac AssertionError when sourcepath is used incorrectly with javadoc
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2016-02-11
  • Updated: 2017-12-11
  • Resolved: 2017-12-11
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 10
10Resolved
Related Reports
Relates :  
Description
java.lang.AssertionError
	at com.sun.tools.javac.util.Assert.error(Assert.java:155)
	at com.sun.tools.javac.util.Assert.checkNull(Assert.java:54)
	at com.sun.tools.javac.code.Symtab.enterModule(Symtab.java:752)
	at com.sun.tools.javac.comp.Modules.enterModule(Modules.java:241)
	at com.sun.tools.javac.comp.Modules.enterModules(Modules.java:222)
	at com.sun.tools.javac.comp.Modules.enter(Modules.java:191)
	at com.sun.tools.javac.main.JavaCompiler.readSourceFile(JavaCompiler.java:838)
	at com.sun.tools.javac.main.JavaCompiler.readSourceFile(JavaCompiler.java:800)
	at com.sun.tools.javac.main.JavaCompiler.access$100(JavaCompiler.java:93)
	at com.sun.tools.javac.main.JavaCompiler$1.complete(JavaCompiler.java:331)
	at com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:362)
	at com.sun.tools.javac.code.ModuleFinder.findSingleModule(ModuleFinder.java:211)
	at com.sun.tools.javac.comp.Modules.setCompilationUnitModules(Modules.java:330)
	at com.sun.tools.javac.comp.Modules.enter(Modules.java:193)
	at jdk.javadoc.internal.tool.JavadocTool.getEnvironment(JavadocTool.java:190)
	at jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:400)
	at jdk.javadoc.internal.tool.Start.begin(Start.java:274)
	at jdk.javadoc.internal.tool.Start.begin(Start.java:220)
	at jdk.javadoc.internal.tool.Main.execute(Main.java:70)
	at jdk.javadoc.internal.tool.Main.main(Main.java:52)

This error was experienced with a bad merge and fixed by:
http://hg.openjdk.java.net/jigsaw/jake/rev/ee7c28c82b0d

To make it easy have attached a reproducer, modify the variables for your top-level repo and build directory.

Comments
Too much water has passed under this bridge since the bug was filed, ie. a combined doc bundle is produced, the distinction being, in the test case -sourcepath is being used, however in the current build script is using --module-source-path, and the new source layout oriented along JDK modules, making it very difficult to reproduce the problem in the source and build's current state.
11-12-2017

That is indeed correct, the problem only occurs if the system modules are in the sourcepath, without them the error is not reproducible.
11-02-2016

There's maybe bugs (and need for fixes) at two levels here. The javac code should handle the problem more gracefully, and/or javadoc should cope with any errors coming out of javadoc. In this case, the problem may be a module-info for a system module being placed on the -sourcepath.
11-02-2016