RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v5]

Jan Lahoda jlahoda at openjdk.org
Fri Jun 21 18:35:16 UTC 2024


On Thu, 20 Jun 2024 17:44:54 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> src/jdk.jdeps/share/classes/com/sun/tools/jnativescan/JNativeScanTask.java line 113:
>> 
>>> 111:                     // Class-Path attribute specifies that jars that
>>> 112:                     // are not found are simply ignored. Do the same here
>>> 113:                     classPathJars.offer(otherJar);
>> 
>> The expansion of the class path looks right but the Class-Path attribute is awkward to deal with as its relative URI rather than a file path. More on this this later.
>
> Not important for now but the expansion will probably need to"visited" set to detect cycles (yes, it is possible).
> 
> In addition to cycles, it is possible to have several JAR files with the same Class-Path value, e.g. lib/logging.jar, so a visited set would be useful for that too.

FWIW, javac has `com.sun.tools.javac.file.FSInfo.getJarClassPath`, which is not transitive, and is implemented a bit differently, but I wonder if there's a chance for some code sharing. Maybe not now, but eventually.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19774#discussion_r1649296334


More information about the compiler-dev mailing list