On Thu, 31 Oct 2024 13:55:45 GMT, Lukasz Kostyra <lkost...@openjdk.org> wrote:
> This PR removes uses of `AccessControler.doPrivileged()` from > `javafx.graphics` package. All uses of `doPrivileged()` were removed > _excluding_ `com.sun.javafx.tk` and `com.sun.ui.glass` subpackages - those > are handled by [JDK-8342453](https://bugs.openjdk.org/browse/JDK-8342453) > (already completed) and > [JDK-8342454](https://bugs.openjdk.org/browse/JDK-8342454) respectively. > > Most of these changes are fairly straightforward and follow the standard > replacement from `AccessController.doPrivileged(LAMBDA)` to just simply > `LAMBDA` with a couple exceptions: > > - `StyleManager.java` where `loadStylesheet()` followed two steps - > attempting straightforward stylesheet load via `loadStylesheetUnPrivileged()` > and in case of `AccessControlException` retrying the load via > `AccessController.doPrivileged` with read-only access to stylesheet JAR. Now > that `doPrivileged` is deprecated and not used anymore, > `loadStylesheetUnPrivileged()` was always successful and the fallback became > essentially dead code. Fallback was removed and > `loadStylesheetUnPrivileged()` was renamed to `loadStylesheet()`. > - `Scene.java` integrates with `com.sun.javafx.tk` so only straightforward > `doPrivileged()` calls were removed - `AccessControlContext` remained, as it > needs to be removed from both tk and Scene via a follow-up > ([JDK-8342993](https://bugs.openjdk.org/browse/JDK-8342993)) > > Building graphics module now produces less warnings than before this change > with no new warning messages (all warnings refer to the use of `Unsafe` which > is out of scope of this change). This pull request has now been integrated. Changeset: 58cd76a8 Author: Lukasz Kostyra <lkost...@openjdk.org> URL: https://git.openjdk.org/jfx/commit/58cd76a838542cc20e0ef2e880d18fa762664172 Stats: 1225 lines in 51 files changed: 59 ins; 702 del; 464 mod 8342456: Remove calls to doPrivileged in javafx.graphics/other Reviewed-by: kcr, angorya ------------- PR: https://git.openjdk.org/jfx/pull/1619