-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
21
-
None
Various methods of
https://docs.oracle.com/en/java/javase/21/docs/api/java.logging/java/util/logging/LogManager.html
assert
SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control").
However it's not possible to instantiate LoggingPermission("control"),
there's no one-arg constructor https://docs.oracle.com/en/java/javase/21/docs/api/java.logging/java/util/logging/LoggingPermission.html
Moreover it's not possible to instantiate anything other than new LoggingPermission("control", "") or LoggingPermission("control", null)
The OpenJDK's implementation of LogManager contains:
static final Permission controlPermission =
new LoggingPermission("control", null);
void checkPermission() {
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkPermission(controlPermission);
}
So the LogManager's spec could be improved to say for example:
SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control", null).
or simply
SecurityException - if a security manager exists and if the caller does not have LoggingPermission.
https://docs.oracle.com/en/java/javase/21/docs/api/java.logging/java/util/logging/LogManager.html
assert
SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control").
However it's not possible to instantiate LoggingPermission("control"),
there's no one-arg constructor https://docs.oracle.com/en/java/javase/21/docs/api/java.logging/java/util/logging/LoggingPermission.html
Moreover it's not possible to instantiate anything other than new LoggingPermission("control", "") or LoggingPermission("control", null)
The OpenJDK's implementation of LogManager contains:
static final Permission controlPermission =
new LoggingPermission("control", null);
void checkPermission() {
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkPermission(controlPermission);
}
So the LogManager's spec could be improved to say for example:
SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control", null).
or simply
SecurityException - if a security manager exists and if the caller does not have LoggingPermission.