Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8344944

Remove SecurityManager Permission-related metadata fields in com.sun.management.DiagnosticCommandMBean

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 24
    • core-svc
    • None
    • behavioral
    • minimal
    • Minimal to no known use of SecurityManager and these Permissions.
    • Java API
    • JDK

      Summary

      Remove the SecurityManager Permission-related metadata fields in the Descriptor available in com.sun.management.DiagnosticCommandMBean.

      Problem

      Removal of the SecurityManager makes redundant the Permissions stored in HotSpot DiagnosticCommands. These permission details have been available via JMX in the Descriptor available from com.sun.management.DiagnosticCommandMBean.

      The Descriptor fields dcmd.permissionClass, dcmd.permissionName, and dcmd.permissionAction have no meaning after SecurityManager removal, and should be removed.

      Solution

      Remove these metadata fields.

      Specification

      This will affect the table of Descriptor fields, in the API docs for jdk.management / com.sun.management.DiagnosticCommandMBean

      Log of the proposed change to src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java, deleting three items from the table describing the Descriptor:

      diff --git a/src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java b/src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java
      index 4e64e17f45f..d5fedf93855 100644
      --- a/src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java
      +++ b/src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
        * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        *
        * This code is free software; you can redistribute it and/or modify it
      @@ -138,26 +138,6 @@
        *     <td>True if the diagnostic command is enabled, false otherwise</td>
        *   </tr>
        *   <tr>
      - *     <th scope="row">dcmd.permissionClass</th><td>String</td>
      - *     <td>Some diagnostic command might require a specific permission to be
      - *          executed, in addition to the MBeanPermission to invoke their
      - *          associated MBean operation. This field returns the fully qualified
      - *          name of the permission class or null if no permission is required
      - *   </td>
      - *   </tr>
      - *   <tr>
      - *     <th scope="row">dcmd.permissionName</th><td>String</td>
      - *     <td>The fist argument of the permission required to execute this
      - *          diagnostic command or null if no permission is required</td>
      - *   </tr>
      - *   <tr>
      - *     <th scope="row">dcmd.permissionAction</th><td>String</td>
      - *     <td>The second argument of the permission required to execute this
      - *          diagnostic command or null if the permission constructor has only
      - *          one argument (like the ManagementPermission) or if no permission
      - *          is required</td>
      - *   </tr>
      - *   <tr>
        *     <th scope="row">dcmd.arguments</th><td>Descriptor</td>
        *     <td>A Descriptor instance containing the descriptions of options and
        *          arguments supported by the diagnostic command (see below)</td>

      Github PR: https://github.com/openjdk/jdk/pull/22315

            kevinw Kevin Walls
            kevinw Kevin Walls
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: