RFR: 8342456: Remove calls to doPrivileged in javafx.graphics/other [v2]

Lukasz Kostyra lkostyra at openjdk.org
Thu Oct 31 14:09:52 UTC 2024


> 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`.
> 
> One exception to the above is `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 code and the fallback became essentially dead code, which was removed and `loadStylesheetUnPrivileged()` was renamed to `loadStylesheet()`.
> 
> 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).

Lukasz Kostyra has updated the pull request incrementally with one additional commit since the last revision:

  Scene: Remove missed doPrivileged use

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

Changes:
  - all: https://git.openjdk.org/jfx/pull/1619/files
  - new: https://git.openjdk.org/jfx/pull/1619/files/7ccf2607..bd3780cf

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=1619&range=01
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=1619&range=00-01

  Stats: 9 lines in 1 file changed: 0 ins; 7 del; 2 mod
  Patch: https://git.openjdk.org/jfx/pull/1619.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1619/head:pull/1619

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


More information about the openjfx-dev mailing list