<i18n dev> RFR: 8341445: DecimalFormatSymbols setters should throw NPE [v3]

Justin Lu jlu at openjdk.org
Tue Oct 8 23:10:59 UTC 2024


On Tue, 8 Oct 2024 23:04:18 GMT, Justin Lu <jlu at openjdk.org> wrote:

>> Please review this PR which improves the safety of equality checking for DecimalFormatSymbols. As certain setters did not throw NPE, this allowed for NPE in the equality method. This PR now updates the setters to throw NPE.
>> 
>> In addition to the NPEs, there is also a behavioral change that `setInternationalCurrencySymbol` no longer sets currency to null if the `currencyCode` is invalid. Instead, it simply does not update `currency`. This must be done, because we do not want to allow nullable instance variables post `initalizeCurrency`.
>
> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   reflect review - setters throw NPE

https://github.com/openjdk/jdk/pull/21315/commits/91b1c78f0cfe4fe866c5eca3e84bf42e4c45adf1 updates this PR to take the throws NPE for all setters route. Please see the CSR filed: https://bugs.openjdk.org/browse/JDK-8341801.

Also note that there is an additional behavioral change that `setInternationalCurrencySymbol(String currencyCode)` will now not update the currency field if currencyCode is invalid, rather than nulling the currency field. This must be done to ensure that currency is not null (post lazy loading of the currency fields).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/21315#issuecomment-2400968309


More information about the i18n-dev mailing list