jdk/src/java.base/share/classes/sun/util/logging/PlatformLogger.java
changeset 37672 03684934dc09
parent 33875 c1c71107d45f
equal deleted inserted replaced
37671:7917477e22a8 37672:03684934dc09
   284         if (ref != null) {
   284         if (ref != null) {
   285             log = ref.get();
   285             log = ref.get();
   286         }
   286         }
   287         if (log == null) {
   287         if (log == null) {
   288             log = new PlatformLogger(PlatformLogger.Bridge.convert(
   288             log = new PlatformLogger(PlatformLogger.Bridge.convert(
   289                     // We pass PlatformLogger.class rather than the actual caller
   289                     // We pass PlatformLogger.class.getModule() (java.base)
       
   290                     // rather than the actual module of the caller
   290                     // because we want PlatformLoggers to be system loggers: we
   291                     // because we want PlatformLoggers to be system loggers: we
   291                     // won't need to resolve any resource bundles anyway.
   292                     // won't need to resolve any resource bundles anyway.
   292                     // Note: Many unit tests depend on the fact that
   293                     // Note: Many unit tests depend on the fact that
   293                     //       PlatformLogger.getLoggerFromFinder is not caller sensitive.
   294                     //       PlatformLogger.getLoggerFromFinder is not caller
   294                     LazyLoggers.getLazyLogger(name, PlatformLogger.class)));
   295                     //       sensitive, and this strategy ensure that the tests
       
   296                     //       still pass.
       
   297                     LazyLoggers.getLazyLogger(name, PlatformLogger.class.getModule())));
   295             loggers.put(name, new WeakReference<>(log));
   298             loggers.put(name, new WeakReference<>(log));
   296         }
   299         }
   297         return log;
   300         return log;
   298     }
   301     }
   299 
   302