RFR: 8304446: javap --system flag doesn't override system APIs [v2]

Jan Lahoda jlahoda at openjdk.org
Fri Nov 10 07:31:01 UTC 2023


On Fri, 3 Nov 2023 08:21:15 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> Javap ignores --system option when searching for JDK classes.
>> This patch prepends search over JDK system modules.
>> 
>> Please review.
>> 
>> Thanks,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Skip search over JDK modules for classes in unnamed package (mainly to skip JDK module-infos)

To me, looks reasonable. Is there a chance for a jtreg test? Two other minor comments inline.

src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java line 28:

> 26: package com.sun.tools.javap;
> 27: 
> 28: import com.sun.tools.javac.file.Locations;

Nit: seems unused.

src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java line 864:

> 862:                 fo = fileManager.getJavaFileForInput(moduleLocation, className, JavaFileObject.Kind.CLASS);
> 863:             } else {
> 864:                 if (className.indexOf('.') > 0) try {

I would put the try into a block - it is slightly longer, but much clear, I think.

-------------

PR Review: https://git.openjdk.org/jdk/pull/16476#pullrequestreview-1724173952
PR Review Comment: https://git.openjdk.org/jdk/pull/16476#discussion_r1389013585
PR Review Comment: https://git.openjdk.org/jdk/pull/16476#discussion_r1389014202


More information about the compiler-dev mailing list