JDK-8178966 : Don't swallow early bootstrap exceptions in Boolean.getBoolean, Integer.getInteger and Long.getLong
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 9,10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-04-19
  • Updated: 2024-11-21
  • Resolved: 2024-11-21
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 24
24 masterFixed
Related Reports
Relates :  
Description
JDK-8178832 has shown that System.getProperty(String) may throw NullPointerException not only because the property name passed to it is null, but also as a result of calling it too early in the VM bootstrap sequence. Such exceptions should not be silently swallowed as they mask bugs. Normal flow control should generally not be based on exceptions, so Boolean.getBoolean, Integet.getInteger and Long.getLong should be fixed. 
Comments
Changeset: e03b1506 Branch: master Author: Eirik Bjørsnøs <eirbjo@openjdk.org> Date: 2024-11-21 20:04:39 +0000 URL: https://git.openjdk.org/jdk/commit/e03b1506d3644f9e4053630adc4c0620eaef71c0
21-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22183 Date: 2024-11-17 14:52:06 +0000
17-11-2024

I agree silently swallowing the exception is a bad thing that masks the issue like JDK-8178832. This is a good change.
19-04-2017

Here is a proposed (unverified) fix: http://cr.openjdk.java.net/~plevart/jdk10-dev/8178966_Boolean.getBoolean_etc/webrev.01/
19-04-2017