Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8341445

DecimalFormatSymbols setters should throw NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • core-libs
    • None
    • b22
    • generic
    • generic

      DecimalFormatSymbols provides various setter methods. Most make null checks on the input and throw NPE there. Some setters such as setInfinity(String) do not, and are used in the equals method. Either null safe equality comparisons should be used via Object.equals(), or those setters should throw NPE (but would require behavioral investigation beforehand).

      As it was an oversight to not enforce NPE for the setters, we can make an update to the setter methods. This will of course cause a behavioral change, but it is expected to have minimal impact. A CSR will be required.

      Additionally, some care should be required, as the currency fields are lazily loaded, and can be null internally.

            jlu Justin Lu
            jlu Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: