--- a/src/java.base/share/classes/sun/security/util/SecurityProperties.java Wed May 22 06:29:08 2019 -0400
+++ b/src/java.base/share/classes/sun/security/util/SecurityProperties.java Wed May 22 13:19:04 2019 +0200
@@ -43,15 +43,20 @@
* @return the value of the system or security property
*/
public static String privilegedGetOverridable(String propName) {
- return AccessController.doPrivileged((PrivilegedAction<String>)
- () -> {
- String val = System.getProperty(propName);
- if (val == null) {
- return Security.getProperty(propName);
- } else {
- return val;
- }
- });
+ if (System.getSecurityManager() == null) {
+ return getOverridableProperty(propName);
+ } else {
+ return AccessController.doPrivileged((PrivilegedAction<String>) () -> getOverridableProperty(propName));
+ }
+ }
+
+ private static String getOverridableProperty(String propName) {
+ String val = System.getProperty(propName);
+ if (val == null) {
+ return Security.getProperty(propName);
+ } else {
+ return val;
+ }
}
/**