|
80 | 80 | * <p> |
81 | 81 | * Environments using a security manager will typically set the security |
82 | 82 | * manager at startup. In the JDK implementation, this is done by setting |
83 | | - * the system property {@code java.security.manager} on the command line to |
84 | | - * the class name of the security manager. It can also be set to the empty |
85 | | - * String ("") or the special token "{@code default}" to use the |
| 83 | + * the system property {@systemProperty java.security.manager} on the command |
| 84 | + * line to the class name of the security manager. It can also be set to the |
| 85 | + * empty String ("") or the special token "{@code default}" to use the |
86 | 86 | * default {@code java.lang.SecurityManager}. If a class name is specified, |
87 | 87 | * it must be {@code java.lang.SecurityManager} or a public subclass and have |
88 | 88 | * a public no-arg constructor. The class is loaded by the |
89 | 89 | * {@linkplain ClassLoader#getSystemClassLoader() built-in system class loader} |
90 | | - * if it is not {@code java.lang.SecurityManager}. If the |
91 | | - * {@code java.security.manager} system property is not set, the default value |
92 | | - * is {@code null}, which means a security manager will not be set at startup. |
| 90 | + * if it is not {@code java.lang.SecurityManager}. |
93 | 91 | * <p> |
94 | 92 | * The Java run-time may also allow, but is not required to allow, the security |
95 | 93 | * manager to be set dynamically by invoking the |
96 | 94 | * {@link System#setSecurityManager(SecurityManager) setSecurityManager} method. |
97 | | - * In the JDK implementation, if the Java virtual machine is started with |
98 | | - * the {@code java.security.manager} system property set to the special token |
99 | | - * "{@code disallow}" then a security manager will not be set at startup and |
100 | | - * cannot be set dynamically (the |
| 95 | + * In the JDK implementation, the default value of the |
| 96 | + * {@systemProperty java.security.manager} system property, if not set, is |
| 97 | + * the special token "{@code disallow}". If the Java virtual machine is |
| 98 | + * started with the {@systemProperty java.security.manager} system property |
| 99 | + * not set or set to "{@code disallow}" then a security manager will not be |
| 100 | + * set at startup and cannot be set dynamically (the |
101 | 101 | * {@link System#setSecurityManager(SecurityManager) setSecurityManager} |
102 | 102 | * method will throw an {@code UnsupportedOperationException}). If the |
103 | | - * {@code java.security.manager} system property is not set or is set to the |
| 103 | + * {@systemProperty java.security.manager} system property is set to the |
104 | 104 | * special token "{@code allow}", then a security manager will not be set at |
105 | 105 | * startup but can be set dynamically. Finally, if the |
106 | | - * {@code java.security.manager} system property is set to the class name of |
107 | | - * the security manager, or to the empty String ("") or the special token |
108 | | - * "{@code default}", then a security manager is set at startup (as described |
109 | | - * previously) and can also be subsequently replaced (or disabled) dynamically |
110 | | - * (subject to the policy of the currently installed security manager). The |
111 | | - * following table illustrates the behavior of the JDK implementation for the |
112 | | - * different settings of the {@code java.security.manager} system property: |
| 106 | + * {@systemProperty java.security.manager} system property is set to the |
| 107 | + * class name of the security manager, or to the empty String ("") or the |
| 108 | + * special token "{@code default}", then a security manager is set at startup |
| 109 | + * (as described previously) and can also be subsequently replaced (or |
| 110 | + * disabled) dynamically (subject to the policy of the currently installed |
| 111 | + * security manager). The following table illustrates the behavior of the JDK |
| 112 | + * implementation for the different settings of the |
| 113 | + * {@systemProperty java.security.manager} system property: |
113 | 114 | * <table class="striped"> |
114 | 115 | * <caption style="display:none">property value, |
115 | 116 | * the SecurityManager set at startup, |
|
167 | 168 | * |
168 | 169 | * </tbody> |
169 | 170 | * </table> |
170 | | - * <p> A future release of the JDK may change the default value of the |
171 | | - * {@code java.security.manager} system property to "{@code disallow}". |
172 | 171 | * <p> |
173 | 172 | * The current security manager is returned by the |
174 | 173 | * {@link System#getSecurityManager() getSecurityManager} method. |
|
313 | 312 | * @see java.security.ProtectionDomain |
314 | 313 | * |
315 | 314 | * @since 1.0 |
| 315 | + * @deprecated The Security Manager is deprecated and subject to removal in a |
| 316 | + * future release. There is no replacement for the Security Manager. |
| 317 | + * See <a href="https://openjdk.java.net/jeps/411">JEP 411</a> for |
| 318 | + * discussion and alternatives. |
316 | 319 | */ |
| 320 | +@Deprecated(since="17", forRemoval=true) |
317 | 321 | public class SecurityManager { |
318 | 322 |
|
319 | 323 | /* |
@@ -1084,7 +1088,7 @@ public void checkMulticast(InetAddress maddr) { |
1084 | 1088 | * @deprecated Use #checkPermission(java.security.Permission) instead |
1085 | 1089 | * @see #checkPermission(java.security.Permission) checkPermission |
1086 | 1090 | */ |
1087 | | - @Deprecated(since="1.4") |
| 1091 | + @Deprecated(since="1.4", forRemoval=true) |
1088 | 1092 | public void checkMulticast(InetAddress maddr, byte ttl) { |
1089 | 1093 | String host = maddr.getHostAddress(); |
1090 | 1094 | if (!host.startsWith("[") && host.indexOf(':') != -1) { |
|
0 commit comments