Summary
Refine the null
locale processing of constructors and factory methods in DateFormatSymbols
and DecimalFormatSymbols
Problem
There is no description in the javadoc of java.text.DateFormatSymbols(Locale)
constructor when the argument is null. The implementation throws an NPE, but that is not specified.
Solution
Add @throws NullPointerException
clause in the javadoc. Also, change the implementation of constructors and factory methods that take locale
argument to call Objects.requireNonNull()
methods first. That will produce clearer error messages, instead of some internal null reference as in the issue description.
Specification
Add the following @throws clause to the javadoc:
@@ -145,6 +145,7 @@
* @throws java.util.MissingResourceException
* if the resources for the specified locale cannot be
* found or cannot be loaded.
+ * @throws NullPointerException if {@code locale} is null
*/
- csr of
-
JDK-8366517 Refine null locale processing of ctor/factory methods in `Date/DecimalFormatSymbols`
-
- Resolved
-