jdk/src/java.logging/share/classes/java/util/logging/Logger.java
changeset 42462 c12ae7eefac0
parent 42338 a60f280f803c
child 44545 83b611b88ac8
child 44538 a603c475d649
--- a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java	Fri Dec 09 10:17:27 2016 -0500
+++ b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java	Fri Dec 09 15:48:48 2016 +0000
@@ -259,8 +259,13 @@
     private static final LoggerBundle NO_RESOURCE_BUNDLE =
             new LoggerBundle(null, null);
 
-    private static final JavaUtilResourceBundleAccess RB_ACCESS =
+    // Calling SharedSecrets.getJavaUtilResourceBundleAccess()
+    // forces the initialization of ResourceBundle.class, which
+    // can be too early if the VM has not finished booting yet.
+    private static final class RbAccess {
+        static final JavaUtilResourceBundleAccess RB_ACCESS =
             SharedSecrets.getJavaUtilResourceBundleAccess();
+    }
 
     // A value class that holds the logger configuration data.
     // This configuration can be shared between an application logger
@@ -2183,7 +2188,7 @@
         if (!useCallersModule || callerModule == null || !callerModule.isNamed()) {
             try {
                 Module mod = cl.getUnnamedModule();
-                catalog = RB_ACCESS.getBundle(name, currentLocale, mod);
+                catalog = RbAccess.RB_ACCESS.getBundle(name, currentLocale, mod);
                 catalogName = name;
                 catalogLocale = currentLocale;
                 return catalog;
@@ -2227,7 +2232,7 @@
             // Try with the caller's module
             try {
                 // Use the caller's module
-                catalog = RB_ACCESS.getBundle(name, currentLocale, callerModule);
+                catalog = RbAccess.RB_ACCESS.getBundle(name, currentLocale, callerModule);
                 catalogName = name;
                 catalogLocale = currentLocale;
                 return catalog;