Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8027360

(prefs) java.util.prefs API adds a forward slash in front of every uppercase letter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 7u40
    • core-libs

      FULL PRODUCT VERSION :
      java version "1.7.0_40"
      Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
      Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Using the code below the application is saving and reading the preferences.
       
      Preferences prf = Preferences.userRoot().node("/JavaFXApp1");
      prf.putInt("CurrentColor", appCtrl.getIValue());
      Preferences prf = Preferences.userRoot().node("/JavaFXApp1");i = prf.getInt("CurrentColor", 0);

      The registry key created on line 1 looks like '/Java/F/X/App1' and the value name created on line 2 looks like '/Current/Color'
       The forward slash was even added to the string value: saving 'Programmatically set text' string I see '/Programmatically set text'.
       
      This is not isolated to my application. SceneBuilder saves its settings under HKEY_CURRENT_USER\Software\JavaSoft\Prefs\com\oracle\javafx\scenebuilder\/J/V/M/User/Options and its settings are affected too, such as '$/A/P/P/D/I/R\app\logging.properties'


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      call

      Preferences prf = Preferences.userRoot().node("/JavaFXApp1");
      prf.putInt("CurrentColor", appCtrl.getIValue());

      and look in registry for the saved key and value names.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      key/value names saved as supplied.
      ACTUAL -
      '/' is added in front of every uppercase letter in the key names, value names and in the string values.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Preferences prf = Preferences.userRoot().node("/JavaFXApp1");
      prf.putInt("CurrentColor", appCtrl.getIValue());

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      none - complete show stopper for automated deployment and configuration management.

            Unassigned Unassigned
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: