JDK-8165101 : AnchorCertificates throws NPE when cacerts file not found
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-08-30
  • Updated: 2017-03-20
  • Resolved: 2016-10-10
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 8 JDK 9
8u152Fixed 9 b140Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
AnchorCertificates throws NPE when cacerts file doesn't exists. Since this class only throws debug message "Error parsing cacerts" when file is not found, I expect JDK to proceed without NPE.

Comments
While I have not been able to reproduce the failure because the test fails because the cacerts file was not found rather than a null pointer. I am proceeding with the fix as it possible this could occur. There is not regression test because it's removing the cacerts file can't be done concurrently and this is a corner case that it's trivial.
05-10-2016

contains() expects the HashSet object, certs, to be created, but when there is no cacerts file the certs object is still null. Since the cacerts file is always created, this is not a big problem and is appropriately a P4, but contains() should be more careful.
30-08-2016