RFR: 8344231: SecurityManager cleanup in java.lang.module and jdk.internal.module

Eirik Bjørsnøs eirbjo at openjdk.org
Thu Nov 14 20:32:32 UTC 2024


Please review this PR which removes code depending on SecurityManager from the `java.lang.module` and `jdk.internal.module` packages:

* `ModuleFinder::ofSystem` is updated to not check the `"accessSystemModules"` RuntimePermission
* The `ModuleReferences.ExplodedModuleReader` constructor is updated to remove the check that the caller has access to the directory.
* `Modules::addProvides` is updated to not use `AccessController::doPrivileged` when getting the module class loader
* `SystemModuleFinder::ofSystem` is updated to not returned a wrapped result calling `AccessController::doPrivileged`
* `SystemModuleFinders.SystemImage` is updated to remove a class level comment referring to the SM
* `SystemModuleFinders.SystemModuleReader::checkPermissionToConnect` is removed. The URI constructor parameter in `SystemModuleReader` becomes unused and is removed.


Testing: I have run `test/jdk/java/lang/module`, `test/jdk/java/lang/ModuleTests`,  and `test/jdk/java/lang/ModuleLayer` successfully. GHA results pending.

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

Commit messages:
 - Remove SecurityManager dependent code in java.lang.module, jdk.internal.module

Changes: https://git.openjdk.org/jdk/pull/22113/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22113&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8344231
  Stats: 66 lines in 4 files changed: 0 ins; 59 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/22113.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22113/head:pull/22113

PR: https://git.openjdk.org/jdk/pull/22113


More information about the core-libs-dev mailing list