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

Regression: ResourceBundle.getString can't access root bundle anymore

XMLWordPrintable

    • kestrel
    • generic
    • generic

      ResourceBundle.getString returns different value than 1.2.2-W w/ 1.3-L
      if Locale("","","") is passed to ResourceBundle.getBundle to get ResourceBundle
      associated with given property.

      Try example code attached under ja locale.

      java PropsCheck foo

      It returns a pair of message from foo.properties and foo_ja.properties
      (Default & Japanese) associated with property key w/ 1.2.2.

      This program is to see if there is any missing(new) messages in localized property file no longer work 2/ 1.3.

      In 1.2.x, the system returns an instance of ResourceBundle which refers to
      default property(in above case, it is foo.properties.) if Locale("","","")
      is given as an argument to getBundle of ResourceBundle.

      So that 1.2.x allows the application to access explicitly default property file
      or property file associated with current locale.

      ResourceBundle.getBundle("foo", Locale("","","") -> foo.properties
      ResourceBundle.getBundle("foo") -> foo_<LOCALE>.properties -> foo_ja.properties

      In 1.3, however, it always access foo_<LOCALE>.properties first even if
      Locale("","","") is given to instanciate ResourceBundle in order to
      access the message.

            joconnersunw John Oconner (Inactive)
            sishidasunw Shoji Ishida (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: