On Tue, 2 Sep 2025 19:29:37 GMT, Naoto Sato <[email protected]> wrote:
> Adding a `@throws` clause for NPE in `java.text.DateFormatSymbols(Locale)`
> constructor. The bug suggests it should throw a `MissingResourceException`,
> but I don't think we can change this long standing behavior. Instead,
> explicitly specify the NPE in the javadoc.
src/java.base/share/classes/java/text/DateFormatSymbols.java line 148:
> 146: * if the resources for the specified locale cannot be
> 147: * found or cannot be loaded.
> 148: * @throws NullPointerException if {@code locale} is null
Adding an explicit Objects.requireNull(locale, "locale") would clearly identify
when the NPE is thrown.
Though it might be earlier than without the check.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27060#discussion_r2317509928