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

(rb) ResourceBundle and MissingResourceException should support 'cause'

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 1.4.0, 1.4.2, 6
    • core-libs
    • b38
    • generic, x86
    • generic, windows_nt, windows_xp


      If a properties file has a wrong unicode notation such as the typo \uu instead of \u, for example, in MyProperty.properties

      mykey=\uu006c

      ResourceBundle.getBundle("MyProperty") throws MissingResourceException which doesn't help in debugging. Let's say the properties file size is very big and each line has a long \u notated string. And only one has a typo out of several thousand chars. It is almost impossible to find this typo from the MissingResourceException message.

      Exception message should be a malformed encode instead.

      This unclear exception message is because the catch block of ResourceBundle.java(line#944) does nothing and just exit.

      return new PropertyResourceBundle(stream);
      } catch( Exception e ) {
      }

      If there is e.printStackTrace() in the catch it prints out the exact reason for failing.

      bae-chul.kim@eng 2000-07-18

            okutsu Masayoshi Okutsu
            bkimsunw Bae-chul Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: