[9] RFR of 8075156: (prefs) remove() should disallow the use of the null control character '\u0000' as key

Brian Burkhalter brian.burkhalter at oracle.com
Tue Mar 24 19:20:23 UTC 2015


Please review at your convenience.

Issue:	https://bugs.openjdk.java.net/browse/JDK-8075156
Patch:	http://cr.openjdk.java.net/~bpb/8075156/webrev.00/

This is a sequel to the resolved issue https://bugs.openjdk.java.net/browse/JDK-8068373, (prefs) FileSystemPreferences writes \0 to XML storage, causing loss of all preferences, wherein the code point U+0000, the null control character, was made illegal to use as a key in the generic Unix file system-based Preferences.

The issue at hand extends disallowing U+0000 as a key in the put() method on Mac OS X and Windows, and also disallows this use to the remove() methods on these platforms and in the generic Unix file system-based Preferences.

Use of U+0000 in the corresponding get() method has not been disallowed as this method returns a default value. If it would be preferable that the behavior of get() with respect to the key U+0000 were the same as for put() and remove() then this patch may be updated to that effect.

Also, probably the constant CODE_POINT_U0000 could be moved up to a package-private constant in AbstractPreferences.

In any case, a CCC request will be filed, either for the remove() change alone, or for both remove() and get(), as the review comments shall dictate.

Thanks,

Brian


More information about the core-libs-dev mailing list