RFR: 8159048: Null PulseReciever in AbstractMasterTimer
Jose Pereda
jpereda at openjdk.org
Sun Jul 30 10:20:43 UTC 2023
On Sat, 29 Jul 2023 13:53:06 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> This PR adds a check to the Animation and AnimationTimer public methods to verify that these are called from the JavaFX Application thread. If the call is done from any other thread, an IllegalStateException will be thrown.
>>
>> This will prevent users from getting unexpected errors (typically NPE, like the one posted in the JBS issue), and will fail fast with a clear exception and reason for it.
>>
>> The javadoc of the Animation and AnimationTimer classes and public methods has been updated accordingly.
>>
>> Tests for both classes have been included, failing (as in no exceptions were thrown when calling from a background thread) before this patch, and passing (as in ISE was thrown).
>
> At first glance, this looks like a good fix. Since this enforces a new threading restriction on existing animation methods, it will need a CSR.
Thanks, @kevinrushforth, I've missed that, indeed.
I've filed the CSR draft: https://bugs.openjdk.org/browse/JDK-8313378
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1167#issuecomment-1657100415
More information about the openjfx-dev
mailing list