From 52d7b541a6413c6c88b8b95461d974edd1f72d00 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Thu, 5 Jun 2014 18:46:37 +0200 Subject: [PATCH] 8042797: Avoid strawberries in LogRecord Reviewed-by: mchung, skoivu, igerasim --- .../share/classes/java/util/logging/LogRecord.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java b/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java index bfc05201ebc..1ea4d72008d 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java @@ -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.