JDK-8347992 : Deprecate java.management Permission classes for removal
  • Type: CSR
  • Component: core-svc
  • Sub-Component: javax.management
  • Priority: P4
  • Status: Proposed
  • Resolution: Unresolved
  • Fix Versions: 25
  • Submitted: 2025-01-17
  • Updated: 2025-01-20
Related Reports
CSR :  
Description
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;


```
Comments
Thanks Serguei! That label is on the issue, I didn't duplicate the label into the CSR here. This looks normal from other issues I've looked at.
17-01-2025

Q: Do we need label jep486 here?
17-01-2025