[9] RFC JDK-8068373: (prefs) FileSystemPreferences writes \0 to XML storage, causing loss of all preferences
Brian Burkhalter
brian.burkhalter at oracle.com
Thu Feb 12 01:33:05 UTC 2015
This is a request for comment only, at this point. There is no associated formal test but there is one in the issue description.
Issue: https://bugs.openjdk.java.net/browse/JDK-8068373
Patch: http://cr.openjdk.java.net/~bpb/8068373/webrev.02/
I mostly want to know how out to lunch this approach is, for the moment only in the context of FileSystemPreferences, not exporting/importing to/from XML in general from generic Preferences.
Two things should be noted here. The Preferences (and Properties) can be exported to and imported from an XML format on all platforms. In the case of Unix (Linux and Solaris, I believe) this is also the format used to store the Preferences whereas on other platforms that is not the case. Therefore for these Unix cases there is the possibility of loss if things are not losslessly round trip encoded into XML. The present issue is one such case with dire consequences.
The main problems as I see them are 1) how to maintain compatibility across Java versions, and 2) how to preserve what can be added as a Preference. With respect to the latter item, this should not be constrained because the datum happens to be cached in XML.
This particular solution is data-preserving with respect to the issue addressed if the same or later version of a JVM is used, and does not cause older Java versions reading the XML cache to fail.
Thanks,
Brian
More information about the core-libs-dev
mailing list