Details
-
Bug
-
Resolution: Fixed
-
P3
-
18
-
b26
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8282063 | 17.0.4-oracle | Sean Coffey | P3 | Resolved | Fixed | b01 |
JDK-8283301 | 17.0.4 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 |
Description
├───mod.bar
│ module-info.java
│
├───mod.baz
│ module-info.java
Compile and create 2 jar files, each with the module-info class under a separate version:
$ javac --module-source-path . -d out -m mod.bar
$ javac --module-source-path . -d out -m mod.baz
$ jar --create --file mod-bar.jar --release 11 -C 'out/mod.bar' module-info.class
$ jar --create --file mod-baz.jar --release 12 -C 'out/mod.baz' module-info.class
Then run jdeps over both jars with the higher of the 2 release versions passed to multi-release:
jdeps --multi-release 12 --print-module-deps mod-bar.jar mod-baz.jar
This will sometimes produce an exception (just spam it in the console a few times, and you should see it):
Exception in thread "main" java.lang.Error: java.util.concurrent.ExecutionException: com.sun.tools.jdeps.MultiReleaseException
at jdk.jdeps/com.sun.tools.jdeps.DependencyFinder.waitForTasksCompleted(DependencyFinder.java:271)
at jdk.jdeps/com.sun.tools.jdeps.DependencyFinder.parse(DependencyFinder.java:133)
at jdk.jdeps/com.sun.tools.jdeps.DepsAnalyzer.run(DepsAnalyzer.java:129)
at jdk.jdeps/com.sun.tools.jdeps.ModuleExportsAnalyzer.run(ModuleExportsAnalyzer.java:74)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask$ListModuleDeps.run(JdepsTask.java:1047)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:574)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
at jdk.jdeps/com.sun.tools.jdeps.Main.run(Main.java:64)
at jdk.jdeps/com.sun.tools.jdeps.Main$JDepsToolProvider.run(Main.java:73)
at java.base/java.util.spi.ToolProvider.run(ToolProvider.java:138)
at main.JDepsMultiRelease.main(JDepsMultiRelease.java:12)
Caused by: java.util.concurrent.ExecutionException: com.sun.tools.jdeps.MultiReleaseException
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at jdk.jdeps/com.sun.tools.jdeps.DependencyFinder.waitForTasksCompleted(DependencyFinder.java:267)
... 10 more
Caused by: com.sun.tools.jdeps.MultiReleaseException
at jdk.jdeps/com.sun.tools.jdeps.VersionHelper.add(VersionHelper.java:62)
at jdk.jdeps/com.sun.tools.jdeps.ClassFileReader$JarFileReader.readClassFile(ClassFileReader.java:360)
at jdk.jdeps/com.sun.tools.jdeps.ClassFileReader$JarFileIterator.hasNext(ClassFileReader.java:402)
at jdk.jdeps/com.sun.tools.jdeps.DependencyFinder.lambda$parse$5(DependencyFinder.java:179)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
The reason that an exception is only reported _sometimes_ is the result of a data-race in jdep's VersionHelper. See: https://bugs.openjdk.java.net/browse/JDK-8277166 (applying the fix I suggested in the comments there makes this 100% reproducible).
2 jars defining a module-info.class in a different versioned directory is valid as far as I know (it's not a case of split packages). So, an exception should not be thrown in this case I think.
Attachments
Issue Links
- backported by
-
JDK-8282063 jdeps --multi-release --print-module-deps fails if module-info.class in different versioned directories
- Resolved
-
JDK-8283301 jdeps --multi-release --print-module-deps fails if module-info.class in different versioned directories
- Resolved
- duplicates
-
JDK-8277564 jdeps --print-module-deps fails with --multi-release
- Resolved
- relates to
-
JDK-8277166 Data race in jdeps VersionHelper
- Resolved
-
JDK-8277123 jdeps does not report some exceptions correctly
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/defd25c9
-
Commit openjdk/jdk/7e54d065
-
Review openjdk/jdk17u-dev/256
-
Review openjdk/jdk17u/314
-
Review openjdk/jdk/6530