Summary
-------
Permission classes in the java.management module are obsolete and unused, as the SecurityManager is now permanently disabled by JEP 486. Therefore deprecate for future removal.
Problem
-------
Permission classes in the java.management module are obsolete and unused.
Solution
--------
Deprecate for future removal.
Specification
-------------
Changes in the files:
- src/java.management/share/classes/java/lang/management/ManagementPermission.java
- src/java.management/share/classes/javax/management/MBeanPermission.java
- src/java.management/share/classes/javax/management/MBeanServerPermission.java
- src/java.management/share/classes/javax/management/MBeanTrustPermission.java
- src/java.management/share/classes/javax/management/remote/SubjectDelegationPermission.java
```
src/java.management/share/classes/java/lang/management/ManagementPermission.java
@@ -31,6 +31,7 @@
* @apiNote
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
+ * Consequently this class is deprecated for removal in a future release.
*
* @author Mandy Chung
* @since 1.5
@@ -41,8 +42,11 @@
* @see java.security.PermissionCollection
* @see java.lang.SecurityManager
*
+ * @deprecated This class was only useful in conjunction with the Security Manager,
+ * which is no longer supported. There is no replacement for this class.
+ *
*/
-
+@Deprecated(since="25", forRemoval=true)
public final class ManagementPermission extends java.security.BasicPermission {
private static final long serialVersionUID = 1897496590799378737L;
src/java.management/share/classes/javax/management/MBeanPermission.java
@@ -161,9 +161,14 @@
* @apiNote
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
+ * Consequently this class is deprecated for removal in a future release.
+ *
+ * @deprecated This class was only useful in conjunction with the Security Manager,
+ * which is no longer supported. There is no replacement for this class.
*
* @since 1.5
*/
+@Deprecated(since="25", forRemoval=true)
public class MBeanPermission extends Permission {
private static final long serialVersionUID = -2416928705275160661L;
src/java.management/share/classes/javax/management/MBeanServerPermission.java
@@ -67,9 +67,14 @@
* @apiNote
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
+ * Consequently this class is deprecated for removal in a future release.
+ *
+ * @deprecated This class was only useful in conjunction with the Security Manager,
+ * which is no longer supported. There is no replacement for this class.
*
* @since 1.5
*/
+@Deprecated(since="25", forRemoval=true)
public class MBeanServerPermission extends BasicPermission {
private static final long serialVersionUID = -5661980843569388590L;
@@ -334,6 +339,7 @@ public PermissionCollection newPermissionCollection() {
* implementation from defining a PermissionCollection there with an
* optimized "implies" method.
*/
+@SuppressWarnings("removal")
class MBeanServerPermissionCollection extends PermissionCollection {
/** @serial Null if no permissions in collection, otherwise a
single permission that is the union of all permissions that
src/java.management/share/classes/javax/management/MBeanTrustPermission.java
@@ -44,9 +44,14 @@
* @apiNote
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
+ * Consequently this class is deprecated for removal in a future release.
+ *
+ * @deprecated This class was only useful in conjunction with the Security Manager,
+ * which is no longer supported. There is no replacement for this class.
*
* @since 1.5
*/
+@Deprecated(since="25", forRemoval=true)
public class MBeanTrustPermission extends BasicPermission {
private static final long serialVersionUID = -2952178077029018140L;
src/java.management/share/classes/javax/management/remote/SubjectDelegationPermission.java
@@ -56,9 +56,14 @@
* @apiNote
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
+ * Consequently this class is deprecated for removal in a future release.
+ *
+ * @deprecated This class was only useful in conjunction with the Security Manager,
+ * which is no longer supported. There is no replacement for this class.
*
* @since 1.5
*/
+@Deprecated(since="25", forRemoval=true)
public final class SubjectDelegationPermission extends BasicPermission {
private static final long serialVersionUID = 1481618113008682343L;
```