From 67adc10125a6582ae2aaffee7a318308f49f583c Mon Sep 17 00:00:00 2001 From: Theresa Mammarella Date: Mon, 9 Dec 2024 08:32:59 -0500 Subject: [PATCH] Rename initSecurityManager to initPhase3 ... to match Error stack trace of openjdk java/lang/System/SecurityManagerWarnings.java.SecurityManagerWarnings Signed-off-by: Theresa Mammarella --- .../share/classes/java/lang/ClassLoader.java | 2 +- .../java.base/share/classes/java/lang/System.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/jcl/src/java.base/share/classes/java/lang/ClassLoader.java b/jcl/src/java.base/share/classes/java/lang/ClassLoader.java index 49274f54637..1c91f4ff946 100644 --- a/jcl/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/jcl/src/java.base/share/classes/java/lang/ClassLoader.java @@ -294,7 +294,7 @@ static final void initializeClassLoaders() { /*[ENDIF] JAVA_SPEC_VERSION >= 10 */ jdk.internal.misc.VM.initLevel(2); System.checkTmpDir(); - System.initSecurityManager(applicationClassLoader); + System.initPhase3(applicationClassLoader); jdk.internal.misc.VM.initLevel(3); /*[ELSE] JAVA_SPEC_VERSION >= 9 */ String smvalue = System.internalGetProperties().getProperty("java.security.manager"); //$NON-NLS-1$ diff --git a/jcl/src/java.base/share/classes/java/lang/System.java b/jcl/src/java.base/share/classes/java/lang/System.java index e878e1d9dff..af54a3af337 100644 --- a/jcl/src/java.base/share/classes/java/lang/System.java +++ b/jcl/src/java.base/share/classes/java/lang/System.java @@ -1264,7 +1264,18 @@ static void checkTmpDir() { } /*[IF JAVA_SPEC_VERSION >= 9]*/ -static void initSecurityManager(ClassLoader applicationClassLoader) { +/** + * Initialize the security manager according + * to the java.security.manager system property. + * @param applicationClassLoader + * @throws Error +/*[IF JAVA_SPEC_VERSION >= 24] + * if the user attempts to enable the security manager +/*[ELSE] JAVA_SPEC_VERSION >= 24 + * if the security manager could not be initialized +/*[ENDIF] JAVA_SPEC_VERSION >= 24 + */ +static void initPhase3(ClassLoader applicationClassLoader) { /*[IF JAVA_SPEC_VERSION >= 24]*/ boolean throwErrorOnInit = false; /*[ENDIF] JAVA_SPEC_VERSION >= 24 */