JDK-8075156 : (prefs) get*() and remove() should disallow the use of the null control character '\u0000' as key
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-03-13
  • Updated: 2017-05-17
  • Resolved: 2015-04-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b63Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8164430 :  
Description
Similar to put() in JDK-8068373, the get*() and remove() methods should not allow this invalid key. The various putX() methods should likewise be updated.
Comments
Suggested text for the release notes is as follows. "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."
28-04-2015

Review threads: Initial: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-March/032509.html Suite: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-April/032709.html
15-04-2015

Review thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-March/032509.html
24-03-2015

A CCC request will be in order for the requisite update of the remove() specification.
23-03-2015