Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove System.getSecurityManager calls from java.base and criu #20939

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

theresa-m
Copy link
Contributor

Remove calls to System.getSecurityManager for JDK 24 since this method is deprecated for removal and returns null. This change also removes javadoc references to SecurityException which no longer apply with the removal of System.getSecurityManager.

I have more pull requests removing SecurityException and System.getSecurityManager coming. I wanted to break this into smaller chunks for review since there are many uses in OpenJ9.

Related: #20563

jcl/src/java.base/share/classes/java/lang/Class.java Outdated Show resolved Hide resolved
jcl/src/java.base/share/classes/java/lang/Class.java Outdated Show resolved Hide resolved
@@ -210,7 +210,9 @@ public static void runRunnableInNotCheckpointSafeMode(Runnable run) {

@SuppressWarnings("restriction")
private static Unsafe unsafe;
/*[IF JAVA_SPEC_VERSION < 24]*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains other security manager-related API usages, such as AccessController.doPrivileged(). Are they to be addressed in another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I am planning to do those separately since there are also many uses.

@@ -602,10 +613,12 @@ public InternalCRIUSupport setWorkDir(Path workDir) {
}
String dir = workDir.toAbsolutePath().toString();

/*[IF JAVA_SPEC_VERSION < 24]*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems

/*[IF JAVA_SPEC_VERSION >= 17]*/
@SuppressWarnings({ "deprecation", "removal" })
/*[ENDIF] JAVA_SPEC_VERSION >= 17 */

should be moved to this file and changed to

/*[IF (17 <= JAVA_SPEC_VERSION) & (JAVA_SPEC_VERSION < 24)]*/
@SuppressWarnings({ "deprecation", "removal" })
/*[ENDIF] (17 <= JAVA_SPEC_VERSION) & (JAVA_SPEC_VERSION < 24) */

because the deprecated System.getSecurityManager() usages are being removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants