On Sat, 27 Jan 2024 21:31:32 GMT, Nir Lisker <nlis...@openjdk.org> wrote:
>> modules/javafx.graphics/src/main/java/com/sun/javafx/util/Utils.java line >> 1008: >> >>> 1006: * @param runnable a {@code Runnable} encapsulating the code >>> 1007: */ >>> 1008: public static void runOnFxThread(Runnable runnable) { >> >> I understand that this is a private package, and not public API, but do we >> need a null check of `runnable`? (Not needed for the current uses added from >> this PR, but possibly for future uses?) > > I thought about it when I wrote this method, but I don't see much value in it > for an internal utility method as it doesn't serve as a boundary. In > addition, there was a discussion about future work that will eliminate the > need for this method by dealing with the threading issue at a deeper level, > so it is somewhat temporary. I wouldn't worry about it. We have many methods that take a Runnable and don't do a null check. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1352#discussion_r1469538109