mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs, chegar, weijun
This commit is contained in:
parent
b909478b3d
commit
2b5207e74d
78 changed files with 391 additions and 453 deletions
|
@ -39,6 +39,7 @@ import java.util.Optional;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
|
||||
/**
|
||||
* A finder of modules. A {@code ModuleFinder} is used to find modules during
|
||||
|
@ -152,7 +153,7 @@ public interface ModuleFinder {
|
|||
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
PrivilegedAction<String> pa = () -> System.getProperty("java.home");
|
||||
PrivilegedAction<String> pa = new GetPropertyAction("java.home");
|
||||
home = AccessController.doPrivileged(pa);
|
||||
Permission p = new FilePermission(home + File.separator + "-", "read");
|
||||
sm.checkPermission(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue