RFR: 8342454: Remove calls to doPrivileged in javafx.graphics/com.sun.glass

Kevin Rushforth kcr at openjdk.org
Tue Nov 5 14:42:38 UTC 2024


On Tue, 5 Nov 2024 14:23:13 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> This PR removes AccessController.doPrivileged() calls in javafx.graphics/com.sun.glass. It is part of umbrella task [JDK-8342441](https://bugs.openjdk.org/browse/JDK-8342441).
>> 
>> Also wherever classes are implementing PrivilegedAction they are replaced with java.util.Supplier and get().
>> 
>> I have removed reference to all AccessControl** class except in `Accessible.java` assuming that AccessControlContext from this class might be needed at some other place and its better if we remove it under [JDK-8342993](https://bugs.openjdk.org/browse/JDK-8342993)
>
> modules/javafx.graphics/src/main/java/com/sun/glass/ui/Accessible.java line 169:
> 
>> 167:             getAttribute.attribute = attribute;
>> 168:             getAttribute.parameters = parameters;
>> 169:             return getAttribute;
> 
> This needs to be `getAttribute.get()` to be equivalent to the previous code.

Alternatively, the following would work and be simpler, if you prefer:


    public Object getAttribute(AccessibleAttribute attribute, Object... parameters) {
        getAttribute.attribute = attribute;
        getAttribute.parameters = parameters;
        return QuantumToolkit.runWithoutRenderLock(getAttribute);
    }

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1624#discussion_r1829472345


More information about the openjfx-dev mailing list