changeset 7580:1fa5eab2b34d

8042797: Avoid strawberries in LogRecord Reviewed-by: dfuchs
author igerasim
date Fri, 06 Jun 2014 00:58:04 +0400
parents 36ea51c7efd1
children eabde5c42157
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	Wed Jun 04 21:18:42 2014 -0700
+++ b/src/share/classes/java/util/logging/LogRecord.java	Fri Jun 06 00:58:04 2014 +0400
@@ -510,7 +510,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.