mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8344231: SecurityManager cleanup in java.lang.module and jdk.internal.module
Reviewed-by: alanb
This commit is contained in:
parent
1bb0d3baaa
commit
f62e05ee96
4 changed files with 8 additions and 68 deletions
|
@ -26,9 +26,6 @@
|
|||
package java.lang.module;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.security.AccessController;
|
||||
import java.security.Permission;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -130,16 +127,8 @@ public interface ModuleFinder {
|
|||
*
|
||||
* @return A {@code ModuleFinder} that locates the system modules
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
static ModuleFinder ofSystem() {
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
sm.checkPermission(new RuntimePermission("accessSystemModules"));
|
||||
PrivilegedAction<ModuleFinder> pa = SystemModuleFinders::ofSystem;
|
||||
return AccessController.doPrivileged(pa);
|
||||
} else {
|
||||
return SystemModuleFinders.ofSystem();
|
||||
}
|
||||
return SystemModuleFinders.ofSystem();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue