JDK-8228897 : jdeps throws NPE when analyzing javafx.media that references a non-existent class used to be in JDK
  • Type: Bug
  • Component: tools
  • Affected Version: 11.0.4
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2019-07-30
  • Updated: 2019-10-10
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Linux 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

openjdk 11.0.4 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)

and

java 11.0.4 2019-07-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)

A DESCRIPTION OF THE PROBLEM :
`jdeps  --list-reduced-deps logback-classic-1.2.3.jar` fails with NPE in JDK 11.

In the original issue JDK-8211887 it is fixed for JDK 12, but JDK 11 is LTS hence must be fixed too.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. take logback-classic-1.2.3.jar from https://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.2.3/
2. Run `jdeps --list-reduced-deps logback-classic-1.2.3.jar`
   or 
       `jdeps --print-module-deps logback-classic-1.2.3.jar`

exited with code 1, NPE exception is printed to STDOUT

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exception, exit code 0
ACTUAL -
exited with code 1, NPE exception is printed to STDOUT

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)


CUSTOMER SUBMITTED WORKAROUND :
Additional info: unpacking and deeper analyzes shows the problem in PackagingDataCalculator.class:
`unzip logback-classic-1.2.3.jar -d logback-classic/`
`jdeps  --list-reduced-deps logback-classic/ch/qos/logback/classic/spi/PackagingDataCalculator.class`

https://github.com/qos-ch/logback/blob/v_1.2.3/logback-classic/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java#L20


FREQUENCY : always



Comments
Seems also to be related to https://bugs.openjdk.java.net/browse/JDK-8225773 -- at least the NPE happens in the same source code line.
10-10-2019

This issue is duplicate of JDK-8213909, which is already fixed in JDK12. Please use jdk12 or later version to avoid this issue. Marking as open, for community to triage for 11 update release
31-07-2019