mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8167383: Javadoc does not handle packages correctly when used with module option
Reviewed-by: bpatel, jjg
This commit is contained in:
parent
ce5af5d4e8
commit
7ef07fcf9a
5 changed files with 58 additions and 42 deletions
|
@ -38,7 +38,9 @@ import java.util.stream.Collectors;
|
|||
import java.util.stream.Stream;
|
||||
|
||||
import javax.tools.DocumentationTool.DocumentationTask;
|
||||
import javax.tools.DocumentationTool;
|
||||
import javax.tools.JavaFileManager;
|
||||
import javax.tools.JavaFileManager.Location;
|
||||
import javax.tools.JavaFileObject;
|
||||
import javax.tools.StandardJavaFileManager;
|
||||
import javax.tools.StandardLocation;
|
||||
|
@ -303,7 +305,8 @@ public class JavadocTask extends AbstractTask<JavadocTask> {
|
|||
if (fileManager == null)
|
||||
fileManager = internalFileManager = jdtool.getStandardFileManager(null, null, null);
|
||||
if (outdir != null)
|
||||
setLocationFromPaths(StandardLocation.CLASS_OUTPUT, Collections.singletonList(outdir));
|
||||
setLocationFromPaths(DocumentationTool.Location.DOCUMENTATION_OUTPUT,
|
||||
Collections.singletonList(outdir));
|
||||
if (classpath != null)
|
||||
setLocationFromPaths(StandardLocation.CLASS_PATH, classpath);
|
||||
if (sourcepath != null)
|
||||
|
@ -326,7 +329,7 @@ public class JavadocTask extends AbstractTask<JavadocTask> {
|
|||
}
|
||||
}
|
||||
|
||||
private void setLocationFromPaths(StandardLocation location, List<Path> files) throws IOException {
|
||||
private void setLocationFromPaths(Location location, List<Path> files) throws IOException {
|
||||
if (!(fileManager instanceof StandardJavaFileManager))
|
||||
throw new IllegalStateException("not a StandardJavaFileManager");
|
||||
((StandardJavaFileManager) fileManager).setLocationFromPaths(location, files);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue