RFR: 8342453: Remove calls to doPrivileged in javafx.graphics/com.sun.javafx.tk [v2]

Kevin Rushforth kcr at openjdk.org
Wed Oct 30 22:54:34 UTC 2024


On Wed, 30 Oct 2024 20:44:39 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> I decided to make this change. Thanks for the suggestion.
>
> This looks useful.
> I wonder if it would make sense to create a utility method in some common Util class?
> 
> 
> public static boolean initBoolean(BooleanSupplier c) { return c.getAsBoolean(); }
> 
> 
> edit:
> maybe in `com.sun.javafx.util.Utils`

We could, but I don't see enough value in doing it. The only thing you would save is the explicit cast to `(Supplier<Boolean>)` and the `.get()`.

Rather than that, it might be useful  (as a follow-up, not as part of the various doPriv removal PRs), to have a centralized utility method that also did the reading and parsing of the property. I'm fairly certain we already have some localized methods of this sort somewhere.

In any case, I don't want to make a refactoring change that relies on a new utility method as part of this effort

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1608#discussion_r1823555881


More information about the openjfx-dev mailing list