< prev index next >
src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java
Print this page
@@ -30,10 +30,11 @@
import java.security.PrivilegedAction;
import java.util.ResourceBundle;
import java.util.function.Supplier;
import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
+import java.lang.reflect.Module;
import java.util.Objects;
import java.util.logging.LogManager;
import jdk.internal.logger.DefaultLoggerFinder;
import java.util.logging.LoggingPermission;
import sun.util.logging.PlatformLogger;
@@ -396,25 +397,24 @@
}
/**
- * Creates a java.util.logging.Logger for the given caller.
+ * Creates a java.util.logging.Logger for the given module.
* @param name the logger name.
- * @param caller the caller for which the logger should be created.
- * @return a Logger suitable for use in the given caller.
+ * @param module the module for which the logger should be created.
+ * @return a Logger suitable for use in the given module.
*/
private static java.util.logging.Logger demandJULLoggerFor(final String name,
- /* Module */
- final Class<?> caller) {
+ Module module) {
final LogManager manager = LogManager.getLogManager();
final SecurityManager sm = System.getSecurityManager();
if (sm == null) {
- return logManagerAccess.demandLoggerFor(manager, name, caller);
+ return logManagerAccess.demandLoggerFor(manager, name, module);
} else {
final PrivilegedAction<java.util.logging.Logger> pa =
- () -> logManagerAccess.demandLoggerFor(manager, name, caller);
+ () -> logManagerAccess.demandLoggerFor(manager, name, module);
return AccessController.doPrivileged(pa, null, LOGGING_CONTROL_PERMISSION);
}
}
/**
@@ -427,21 +427,21 @@
* @return {@inheritDoc}
* @throws SecurityException if the calling code doesn't have the
* {@code RuntimePermission("loggerFinder")}.
*/
@Override
- protected Logger demandLoggerFor(String name, /* Module */ Class<?> caller) {
+ protected Logger demandLoggerFor(String name, Module module) {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(LOGGERFINDER_PERMISSION);
}
- return JULWrapper.of(demandJULLoggerFor(name,caller));
+ return JULWrapper.of(demandJULLoggerFor(name,module));
}
public static interface LogManagerAccess {
java.util.logging.Logger demandLoggerFor(LogManager manager,
- String name, /* Module */ Class<?> caller);
+ String name, Module module);
}
// Hook for tests
public static LogManagerAccess getLogManagerAccess() {
final SecurityManager sm = System.getSecurityManager();
< prev index next >