JDK-8277932 : Subject:callAs() not throwing NPE when action is null
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.security
  • Affected Version: 18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-11-29
  • Updated: 2021-12-14
  • Resolved: 2021-12-07
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 18 JDK 19
18 b27Fixed 19Fixed
Related Reports
Relates :  
Description
It's observed that the Subject:callAs() method does not throw NPE as per spec.

The spec mentions that : "Throws:
NullPointerException - if action is null"

 For the piece of code : Subject.callAs(new Subject(),null);

expected : NullPointerException.
Actual behavior is : "java.util.concurrent.CompletionException" thrown instead.
Comments
Changeset: 10db0e41 Author: Weijun Wang <weijun@openjdk.org> Date: 2021-12-07 01:37:55 +0000 URL: https://git.openjdk.java.net/jdk/commit/10db0e41634b62be5c1a931bd54ac4260108670d
07-12-2021