8042797: Avoid strawberries in LogRecord

Reviewed-by: mchung, skoivu, igerasim
This commit is contained in:
Daniel Fuchs 2014-06-05 18:46:37 +02:00
parent 7d730f7819
commit 52d7b541a6

View File

@ -509,7 +509,13 @@ public class LogRecord implements java.io.Serializable {
// If necessary, try to regenerate the resource bundle.
if (resourceBundleName != null) {
try {
resourceBundle = ResourceBundle.getBundle(resourceBundleName);
// use system class loader to ensure the ResourceBundle
// instance is a different instance than null loader uses
final ResourceBundle bundle =
ResourceBundle.getBundle(resourceBundleName,
Locale.getDefault(),
ClassLoader.getSystemClassLoader());
resourceBundle = bundle;
} catch (MissingResourceException ex) {
// This is not a good place to throw an exception,
// so we simply leave the resourceBundle null.