-
Enhancement
-
Resolution: Fixed
-
P4
-
1.4.0, 1.4.2, 6
-
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
- duplicates
-
JDK-6210468 ResourceBundle throws Misleading Exception when \u is used in properties file.
-
- Closed
-
-
JDK-5107357 ResourceBundle throwing misguiding MissingResourceException
-
- Closed
-