< prev index next >

src/java.logging/share/classes/java/util/logging/Logger.java

Print this page
@@ -38,10 +38,11 @@
  import java.util.function.Supplier;
  
  import jdk.internal.access.JavaUtilResourceBundleAccess;
  import jdk.internal.access.SharedSecrets;
  import jdk.internal.reflect.CallerSensitive;
+ import jdk.internal.reflect.CallerSensitiveAdapter;
  import jdk.internal.reflect.Reflection;
  import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
  
  /**
   * A Logger object is used to log messages for a specific

@@ -712,10 +713,11 @@
       * @param   name            A name for the logger.
       * @param   callerClass     The class that called {@link
       *                          #getLogger(java.lang.String)}.
       * @return a suitable Logger for {@code callerClass}.
       */
+     @CallerSensitiveAdapter
      private static Logger getLogger(String name, Class<?> callerClass) {
          return demandLogger(name, null, callerClass);
      }
  
      /**

@@ -786,10 +788,11 @@
       *                          This class will also be used for locating the
       *                          resource bundle if {@code resourceBundleName} is
       *                          not {@code null}.
       * @return a suitable Logger for {@code callerClass}.
       */
+     @CallerSensitiveAdapter
      private static Logger getLogger(String name, String resourceBundleName,
                                      Class<?> callerClass) {
          Logger result = demandLogger(name, resourceBundleName, callerClass);
  
          // MissingResourceException or IllegalArgumentException can be
< prev index next >