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

JDK 24 remove java.security.AccessController.doPrivileged part 2 #21061

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

theresa-m
Copy link
Contributor

This pull requests is the second of two prs to remove the use of java.security.AccessController.doPrivileged in JDK 24. It also removes a few cases of System.getSystemProperty and SecurityException mentions that were previously missed.

Related #20563

@keithc-ca @JasonFengJ9 this is the last of the SecurityManager removal JCL changes for Java 24 that I've found, please let me know if there's any you know of that I've missed.

@JasonFengJ9
Copy link
Member

JasonFengJ9 commented Feb 3, 2025

Please remove the following from JDK24+

* @throws SecurityException if a SecurityManager is present and package access is not allowed

* @throws SecurityException if the running thread is not allowed to cause the vm to exit.

Can JDK24+ System.initSecurityManager() be simplified to

/*[MSG "K0B04", "A command line option has attempted to allow or enable the Security Manager. Enabling a Security Manager is not supported."]*/
throw new Error(Msg.getString("K0B04")); //$NON-NLS-1$

without throwErrorOnInit?

@theresa-m
Copy link
Contributor Author

theresa-m commented Feb 4, 2025

Can JDK24+ System.initSecurityManager() be simplified to

/*[MSG "K0B04", "A command line option has attempted to allow or enable the Security Manager. Enabling a Security Manager is not supported."]*/
throw new Error(Msg.getString("K0B04")); //$NON-NLS-1$

without throwErrorOnInit?

This method should not throw an error when java.security.manager is empty or set to "disallow".

@theresa-m theresa-m force-pushed the securitymanager_5 branch 2 times, most recently from 0626094 to 65b95f5 Compare February 4, 2025 15:04
@theresa-m theresa-m requested a review from keithc-ca February 4, 2025 15:05
This pull requests is the second of two prs to remove
the use of java.security.AccessController.doPrivileged
in JDK 24. It also removes a few cases of System.getSystemProperty
and SecurityException mentions that were previously missed.

Signed-off-by: Theresa Mammarella <[email protected]>
@keithc-ca
Copy link
Contributor

Jenkins test sanity amac jdk21,jdk24

@keithc-ca keithc-ca merged commit 43f5280 into eclipse-openj9:master Feb 4, 2025
9 checks passed
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.

3 participants