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.security field and getSecurityManager calls for JDK 24 #20851

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

Conversation

theresa-m
Copy link
Contributor

This change removes the System.security private field from Java 24 which fixes the previously failing reflection check to System.security in test/functional/Java8andUp/src_110_up/org/openj9/test/java/lang/Test_Class.java.

For previous JDK versions System.security was included in jdk/internal/reflect/Reflection.fieldFilterMap which would cause a NoSuchFieldException to be thrown during an attempt to reflectively access System.security. In JDK 24 OpenJDK has removed the security field from the System class and from the fieldFilterMap as well. Since OpenJ9 does not need this field in JDK 24 I will remove it as well. The absence of this field will cause a NoSuchFieldException to be thrown if reflective access is attempted.

I have also removed all the calls to System.getSecurityManager from JDK 24+ in the System class since it just returns null. There are many other unnecessary calls to System.getSecurityManager throughout the code base. I will work on removing these for JDK 24 in a future pull request.

Related: #20563

With the removal of the security manager (JEP 486) the System.security
field is not used for anything meaningful.

Signed-off-by: Theresa Mammarella <[email protected]>
These calls are not needed since System.getSecurityManager
 returns null for JDK 24+.

Signed-off-by: Theresa Mammarella <[email protected]>
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.

1 participant