Integrated: 8342992: Security manager check should not use deprecated methods

Kevin Rushforth kcr at openjdk.org
Fri Nov 8 17:02:18 UTC 2024


On Tue, 5 Nov 2024 19:37:05 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

> As specified in the security manager removal CSR, [JDK-8341858](https://bugs.openjdk.org/browse/JDK-8341858), JavaFX now checks at startup whether the security manager is enabled and fails fast with an `UnsupportedOperationException` if it is. The check is currently done in the `<clinit>` methods of `PlatformImpl` and `LauncherImpl` by calling the deprecated `System::getSecurityManager` method.
> 
> This PR creates a new `SecurityUtility::checkSecurityManager` utility method in `javafx.base` that uses reflection to avoid calling API that is deprecated for removal. I also added a call to `checkSecurityManager` in `ReflectUtil` and `MethodUtil` in `javafx.base` for non-graphical applications that only use `javafx.base`.

This pull request has now been integrated.

Changeset: 5ac5009d
Author:    Kevin Rushforth <kcr at openjdk.org>
URL:       https://git.openjdk.org/jfx/commit/5ac5009deed0e9c72683a936b26a5c8b081ac58e
Stats:     89 lines in 5 files changed: 77 ins; 8 del; 4 mod

8342992: Security manager check should not use deprecated methods

Reviewed-by: arapte, angorya

-------------

PR: https://git.openjdk.org/jfx/pull/1627


More information about the openjfx-dev mailing list