changeset 9860:4615b5d3480e

8042797: Avoid strawberries in LogRecord Reviewed-by: mchung, skoivu, igerasim
author dfuchs
date Thu, 05 Jun 2014 14:43:45 +0200
parents 62eabe5515c2
children b651c4342099
files src/share/classes/java/util/logging/LogRecord.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/logging/LogRecord.java	Thu Jun 05 03:48:43 2014 -0700
+++ b/src/share/classes/java/util/logging/LogRecord.java	Thu Jun 05 14:43:45 2014 +0200
@@ -513,7 +513,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.