Name: rmT116609 Date: 10/28/2002
FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Capital letters are prefixed with '/' when saved with putXXX in registry e.g. node 'ExampleKey' is saved as node '/Example/Key' in registry, key 'Pluto' is saved as key '/Pluto' in registry, value 'Pluto' is saved as
value '/Pluto' in registry.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the attached source code.
2. Look in the registry.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected to see nodes, keys and values to be saved as they were written, without being modified.
Problem: When accessing this data in the registry with other programs, data is not found due to the modification.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Registry entries produced by attached source code exporter from the registry:
---
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs\/Example]
"/Mercury"="/Mercury"
"/Venus"="/Venus"
"/Earth"="/Earth"
"/Mars"="/Mars"
"/Jupiter"="/Jupiter"
"/Saturn"="/Saturn"
"/Uranus"="/Uranus"
"/Neptune"="/Neptune"
"/Pluto"="/Pluto"
---
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.prefs.*;
public class PlanetPrefs {
public static void main(String args[]) {
String names[] = {"Mercury", "Venus", "Earth",
"Mars", "Jupiter", "Saturn", "Uranus",
"Neptune", "Pluto"};
Preferences prefs = Preferences.systemRoot().node("Example");
for (int i=0, n=names.length; i < n; i++) {
prefs.put(names[i], names[i]);
}
try {
String keys[] = prefs.keys();
for (int i=0, n=keys.length; i < n; i++) {
System.out.println(keys[i] + ": " + prefs.get(keys[i], ""));
}
} catch (BackingStoreException e) {
System.err.println("Unable to read backing store: " + e);
}
}
}
---------- END SOURCE ----------
(Review ID: 166213)
======================================================================
- duplicates
-
JDK-4759324 java.util.prefs.Preferences: some characters make unreadable registry key
-
- Closed
-