JDK-8293626 : AccessFlag::locations(ClassFileFormatVersion cffv) does not throw NPEx when parameter is null
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 20
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-09-12
  • Updated: 2022-09-19
  • Resolved: 2022-09-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 20
20 b15Fixed
Related Reports
Cloners :  
Relates :  
Description
As per the spec:
https://download.java.net/java/early_access/jdk20/docs/api/java.base/java/lang/reflect/AccessFlag.html#locations(java.lang.reflect.ClassFileFormatVersion)
"Throws:
NullPointerException - if the parameter is null

Observed that NPE is not thrown when parameter is null.

Attached the snippet to demonstrate this.
Comments
Changeset: 1dc5039f Author: Joe Darcy <darcy@openjdk.org> Date: 2022-09-13 16:51:01 +0000 URL: https://git.openjdk.org/jdk/commit/1dc5039fed9494f4d9b6c7002d28da9bc466fb10
13-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10243 Date: 2022-09-12 18:14:26 +0000
12-09-2022