Integrated: 8159048: Animation and AnimationTimer methods must be called on JavaFX Application thread

Jose Pereda jpereda at openjdk.org
Mon Aug 14 22:51:18 UTC 2023


On Mon, 3 Jul 2023 15:49:31 GMT, Jose Pereda <jpereda 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).

This pull request has now been integrated.

Changeset: c3257fc6
Author:    Jose Pereda <jpereda at openjdk.org>
URL:       https://git.openjdk.org/jfx/commit/c3257fc6a6ce7a50a67a01a3a483ce7e2b4a8688
Stats:     266 lines in 4 files changed: 253 ins; 0 del; 13 mod

8159048: Animation and AnimationTimer methods must be called on JavaFX Application thread

Reviewed-by: angorya, kcr

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

PR: https://git.openjdk.org/jfx/pull/1167


More information about the openjfx-dev mailing list