RFR: 8342459: Remove calls to doPrivileged in javafx.base

Kevin Rushforth kcr at openjdk.org
Tue Nov 5 19:04:41 UTC 2024


On Tue, 5 Nov 2024 17:42:53 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

> Remove `doPrivileged` calls in the javafx.base module.
> The changes are straight forward.
> 1. Remove doPrivileged calls, with keeping the lambda expression.
> 2. Remove SuppressWarnings annotations
> 3. Remove unused imports

Looks good. I did leave one inline comment: I think there is a now-unused private `AccessControllerContext` field in the various `*JavaBeans*` classes. If so, removing that unused field will also allow removing the remaining `SuppressWarnings` annotation and the last of the security-related imports.

If you decide to change this I will reapprove. Otherwise, I'll pick it up in the last of the follow-up fixes.

modules/javafx.base/src/main/java/javafx/beans/property/adapter/JavaBeanBooleanProperty.java line 42:

> 40: import java.security.AccessControlContext;
> 41: import java.security.AccessController;
> 42: import java.security.PrivilegedAction;

I think you can remove the now-unused field `private final AccessControlContext acc`, which will also let you remove the `AccessControlContext` and  `AccessController`. Alternatively, I will remove them as part of [JDK-8342993](https://bugs.openjdk.org/browse/JDK-8342993).

This comment applies to all of the `JavaBeanXXXProperty` classes.

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

Marked as reviewed by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/1625#pullrequestreview-2416449407
PR Review Comment: https://git.openjdk.org/jfx/pull/1625#discussion_r1829854754


More information about the openjfx-dev mailing list