8217868: Crash for overlap between source path and patch module path

When analyzing implicit files, do not look for containing module, but rather use the already known one.

Reviewed-by: jjg
This commit is contained in:
Jan Lahoda 2019-03-04 10:19:35 +01:00
parent 0d13646cbf
commit 76c916516c
3 changed files with 30 additions and 13 deletions

View file

@ -197,9 +197,11 @@ public class JavadocTool extends com.sun.tools.javac.main.JavaCompiler {
}
// Parse the files in the packages and subpackages to be documented
ListBuffer<JCCompilationUnit> packageTrees = new ListBuffer<>();
parse(etable.getFilesToParse(), packageTrees, false);
modules.enter(packageTrees.toList(), null);
ListBuffer<JCCompilationUnit> allTrees = new ListBuffer<>();
allTrees.addAll(classTrees);
parse(etable.getFilesToParse(), allTrees, false);
modules.newRound();
modules.initModules(allTrees.toList());
if (messager.hasErrors()) {
return null;
@ -207,7 +209,7 @@ public class JavadocTool extends com.sun.tools.javac.main.JavaCompiler {
// Enter symbols for all files
toolEnv.notice("main.Building_tree");
javadocEnter.main(classTrees.toList().appendList(packageTrees));
javadocEnter.main(allTrees.toList());
if (messager.hasErrors()) {
return null;