JDK-8352391 : Deprecate com.sun.tools.attach.AttachPermission for removal
  • Type: CSR
  • Component: core-svc
  • Sub-Component: tools
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 25
  • Submitted: 2025-03-19
  • Updated: 2025-03-24
  • Resolved: 2025-03-24
Related Reports
CSR :  
Description
Summary
-------

The Permission class in the jdk.attach module is obsolete and unused, as the SecurityManager is now permanently disabled by JEP 486. Therefore deprecate for future removal.

Problem
-------
Permission classes in the jdk.attach module are obsolete and unused.

Solution
--------

Deprecate for future removal.

Specification
-------------
Changes in src/jdk.attach/share/classes/com/sun/tools/attach/AttachPermission.java

```
@@ -33,12 +33,17 @@
  * @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.
  *
  * @see com.sun.tools.attach.VirtualMachine
  * @see com.sun.tools.attach.spi.AttachProvider
  * @since 1.6
+ *
+ * @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 AttachPermission extends java.security.BasicPermission {

     /** use serialVersionUID for interoperability */
```


Github PR for reference: https://github.com/openjdk/jdk/pull/24133/files

Comments
Moving to Approved.
24-03-2025

Thanks for the correction [~darcy], this has been code reviewed, proceeding to finalise.
24-03-2025

Moving to Provisional.
24-03-2025

Thanks, changed to core-svc / tools which matches other Attach API changes I see.
20-03-2025

It looks good. I wonder if the enhancement/CSR component/sub-component is right.
20-03-2025