RFR: 8344078: Remove security manager dependency in java.nio

Alan Bateman alanb at openjdk.org
Fri Nov 15 08:51:28 UTC 2024


On Fri, 15 Nov 2024 05:37:43 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Expunge the use of the `SecurityManager`, `AccessController`, and the like from the `java.nio` and `sun.nio` package hierarchies.

src/java.base/share/classes/sun/nio/ch/Reflect.java line 45:

> 43: 
> 44:     private static void setAccessible(final AccessibleObject ao) {
> 45:         ao.setAccessible(true);

This method can be removed and lookupConstructor changed to call setAccessible.

src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java line 252:

> 250:                 sm.checkDelete(pathForPermissionCheck);
> 251:         }
> 252: 

The changes in this area need to go a bit deeper and remove the pathForPermissionCheck parameter from this method, the open method, and all the callers.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22132#discussion_r1843396382
PR Review Comment: https://git.openjdk.org/jdk/pull/22132#discussion_r1843393399


More information about the nio-dev mailing list