On Mon, 18 Nov 2024 15:30:15 GMT, Roger Riggs <[email protected]> wrote:
> Circumventing and duplicating the checks in System.getProperty isn't good
> coding technique and is not necessary for performance improvement or code
> size.
My understanding of JDK-8178966 is that the motivation was correctness rather
than performance.
`Boolean::getBoolean` and friends are not specified to throw `IAE` or `NPE`,
but to return false `if the specified name is empty or {@code null}`. So the
implementation must either check for null and emptiness, or it must catch the
exceptions and hope they came from `System::checkKey` and nothing else.
I'm not sure what your alternative solution is here? Drop the PR / issue?
We can't simply drop the null and emptiness checks, since that could throw
unspecified IAE/NPE.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22183#issuecomment-2483416370