JDK-8211887 : jdeps throws NPE when analyzing javafx.media that references a non-existent class used to be in JDK
  • Type: Bug
  • Component: tools
  • Affected Version: 10,11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-10-08
  • Updated: 2020-10-23
  • Resolved: 2018-12-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12 b22Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
$ jdeps  --module-path javafx-sdk-11/lib --print-module-deps ...

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.reduced(ModuleGraphBuilder.java:65)
	at jdk.jdeps/com.sun.tools.jdeps.ModuleExportsAnalyzer.modules(ModuleExportsAnalyzer.java:124)
	at jdk.jdeps/com.sun.tools.jdeps.ModuleExportsAnalyzer.run(ModuleExportsAnalyzer.java:97)
	at jdk.jdeps/com.sun.tools.jdeps.JdepsTask$ListModuleDeps.run(JdepsTask.java:1023)
	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)

Comments
NPE is no longer reproduced after JDK-8213909 and this issue has been resolved. jdeps reports `com.sun.media.jfxmediaimpl.platform.ios.IOSPlatform` not found is a separate issue. See JDK-8211900.
13-12-2018

JDK-8213909 has enhanced `jdeps --print-module-deps`, `--list-deps`, and `--list-reduce-deps` options as follows: 1. by default, it will perform module dependence analysis transitively on the libraries on class path and module path directly and indirectly required by the given input JAR files or classes. 2. if there is any missing dependency, i.e. not found from class path and module path, it will flag as an error. `--ignore-missing-deps` option can be used to suppress missing dependence error. $ jdk12/bin/jdeps --module-path javafx-sdk-11/lib --print-module-deps -m javafx.media Error: Missing dependencies from the module path and classpath. To suppress this error, use --ignore-missing-deps to continue. javafx.media com.sun.media.jfxmediaimpl.platform.PlatformManager -> com.sun.media.jfxmediaimpl.platform.ios.IOSPlatform not found `com.sun.media.jfxmediaimpl.platform.ios.IOSPlatform` is referenced by the source but removed during JavaFX build and hence jdeps flags this error. To workaround until JDK-8211900 is resolved, use --ignore-missing-deps option: $ jdk12/bin/jdeps --module-path javafx-sdk-11/lib --print-module-deps -m javafx.media java.base,javafx.graphics
13-12-2018

jdeps maintains jdk8_internals.txt resource file listing all JDK 8 internal packages that is used to determine if JDK internal API exists in JDK 8 but is removed in a later release. If a library depends on a JDK internal API that has been removed, jdeps will flag that in the output to help developers understand such a broken dependency. com.sun.media.jfxmediaimpl packages of javafx modules are part of JDK 8 but javafx modules are no longer part of JDK 11. When javafx modules are on the module path, jdeps finds a reference to com.sun.media.jfxmediaimpl.platform.ios.IOSPlatform type but not found from the module path. `com.sun.media.jfxmediaimpl.platform.ios` package is considered as JDK removed internal API and leads to NPE. jdeps should handle dangling references gracefully.
09-10-2018

In fact, JDK 10 javafx.media has the same dangling reference to com.sun.media.jfxmediaimpl.platform.ios.IOSPlatform and so it also fails. $ jdk10/bin/jdeps --print-module-deps -m javafx.media 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.reduced(ModuleGraphBuilder.java:65) at jdk.jdeps/com.sun.tools.jdeps.ModuleExportsAnalyzer.modules(ModuleExportsAnalyzer.java:124) at jdk.jdeps/com.sun.tools.jdeps.ModuleExportsAnalyzer.run(ModuleExportsAnalyzer.java:97) at jdk.jdeps/com.sun.tools.jdeps.JdepsTask$ListModuleDeps.run(JdepsTask.java:1023) 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)
08-10-2018