Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8225773

jdeps --check produces NPE if there is any missing module dependence

    XMLWordPrintable

    Details

    • Resolved In Build:
      b32

      Backports

        Description

        Running `jdeps` with `--check <module>` and "missing" modules, i.e. some required modules are not available on the module path, yields a NullPointerException.

        See https://github.com/joel-costigliola/assertj-core/issues/1504#issuecomment-501956593 and previous comments for details.

        jdeps --multi-release 9 --module-path target/assertj-core-3.13.0-SNAPSHOT.jar --check org.assertj.core

        org.assertj.core (file:///[...]/assertj-core/target/assertj-core-3.13.0-SNAPSHOT.jar)

          [Module descriptor]
            requires mandated java.base;
            requires java.instrument;

          [Suggested module descriptor for org.assertj.core]
            requires mandated java.base;
            requires java.instrument;
            requires java.logging;
            requires java.management;
            requires java.xml;
            requires transitive unnamed;

        Exception in thread "main" java.lang.NullPointerException
                at jdk.jdeps/com.sun.tools.jdeps.ModuleGraphBuilder.requiresTransitive(ModuleGraphBuilder.java:124)
                at jdk.jdeps/com.sun.tools.jdeps.ModuleGraphBuilder.buildGraph(ModuleGraphBuilder.java:110)
                at jdk.jdeps/com.sun.tools.jdeps.ModuleGraphBuilder.buildGraph(ModuleGraphBuilder.java:80)
                at jdk.jdeps/com.sun.tools.jdeps.ModuleAnalyzer$ModuleDeps.buildReducedGraph(ModuleAnalyzer.java:182)
                at jdk.jdeps/com.sun.tools.jdeps.ModuleAnalyzer$ModuleDeps.reduced(ModuleAnalyzer.java:195)
                at jdk.jdeps/com.sun.tools.jdeps.ModuleAnalyzer$ModuleDeps.analyzeDeps(ModuleAnalyzer.java:215)
                at jdk.jdeps/com.sun.tools.jdeps.ModuleAnalyzer.lambda$run$3(ModuleAnalyzer.java:92)
                at java.base/java.util.HashMap$Values.forEach(HashMap.java:976)
                at jdk.jdeps/com.sun.tools.jdeps.ModuleAnalyzer.run(ModuleAnalyzer.java:88)
                at jdk.jdeps/com.sun.tools.jdeps.JdepsTask$CheckModuleDeps.run(JdepsTask.java:968)
                at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:560)
                at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:519)
                at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mchung Mandy Chung
                Reporter:
                cstein Christian Stein
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: