Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8075156 (prefs) get*() and remove() should disallow the use of the null control character '\u0000' as key
  3. JDK-8164430

Release Note: java.util.prefs.Preferences now disallows the use of any String containing the null control character

XMLWordPrintable

    • Verified

      The specification of the class `java.util.prefs.Preferences` was modified to disallow the use of any String containing the null control character, code point U+0000, in any String used as the key or value parameter in any of the abstract put*(), get*(), and remove methods. If such a character is detected, an `IllegalArgumentException` shall be thrown.

      The specification of the class `java.util.prefs.AbstractPreferences` was modified according to the corresponding change in its superclass java.util.prefs.Preferences to disallow the use of any String containing the null control character, code point U+0000, in any String used as the key or value parameter in any of the put*(), get*(), and remove() method implementations. These method implementations were modified to throw an `IllegalArgumentException` upon encountering such a character in a key or value String in these contexts. Also, the class specification was modified to correct the erroneous reference to the flush() and sync() methods as returning a boolean value when they are in fact void.

            bpb Brian Burkhalter
            rcalnan Roger Calnan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: