changeset 10851:87f8fd0933fa

8042797: Avoid strawberries in LogRecord Reviewed-by: mchung, skoivu, igerasim
author dfuchs
date Thu, 05 Jun 2014 18:46:37 +0200
parents dbd237820d26
children 46ff4ef2f18e
files src/java.logging/share/classes/java/util/logging/LogRecord.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.logging/share/classes/java/util/logging/LogRecord.java	Fri May 30 16:09:49 2014 +0400
+++ b/src/java.logging/share/classes/java/util/logging/LogRecord.java	Thu Jun 05 18:46:37 2014 +0200
@@ -509,7 +509,13 @@
         // 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.