-
Notifications
You must be signed in to change notification settings - Fork 733
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
Conversation
5204cb3
to
ed204ac
Compare
ed204ac
to
8a971b8
Compare
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]>
8a971b8
to
dc6586b
Compare
Signed-off-by: Theresa Mammarella <[email protected]>
dc6586b
to
93fd41b
Compare
Jenkins test sanity amac jdk17,jdk24 |
Compiling test code failed in each job in
I'll retry on Linux. |
The sanity.openjdk test failures are not unexpected. |
Jenkins test sanity.functional alinux jdk24 |
Linux at least offers a stack trace that may help:
|
The failure in the other job is #20835. |
The segmentation fault problems are tracked by #20870. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new problems seen during testing.
This change removes the
System.security
private field from Java 24 which fixes the previously failing reflection check toSystem.security
intest/functional/Java8andUp/src_110_up/org/openj9/test/java/lang/Test_Class.java
.For previous JDK versions
System.security
was included injdk/internal/reflect/Reflection.fieldFilterMap
which would cause aNoSuchFieldException
to be thrown during an attempt to reflectively accessSystem.security
. In JDK 24 OpenJDK has removed thesecurity
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 aNoSuchFieldException
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 toSystem.getSecurityManager
throughout the code base. I will work on removing these for JDK 24 in a future pull request.Related: #20563