RFR: 8290310: ChangeListener events are incorrect or misleading when a nested change occurs [v7]

John Hendrikx jhendrikx at openjdk.org
Mon Feb 20 05:42:43 UTC 2023


> This contains the following:
> - Nested changes or invalidations using ExpressionHelper are delayed until the current emission completes
>   - This fixes odd change events being produced (with incorrect oldValue)
>   - Also fixes a bug in ExpressionHelper where a nested change would unlock the listener list early, which could cause a `ConcurrentModificationException` if a nested change was combined with a remove/add listener call
> - A test for ExpressionHelper to verify the new behavior
> - A test for all *Property and *Binding classes that verifies correct listener behavior at the API level (this tests gets 85% coverage on ExpressionHelper on its own, the only thing it is not testing is the locking behavior, which is not relevant at the API level).
> - A fix for `WebColorFieldSkin` which triggered a nested change which used a flag to prevent an event loop (I've changed it now to match how `DoubleFieldSkin` and `IntegerFieldSkin` do it

John Hendrikx has updated the pull request incrementally with three additional commits since the last revision:

 - Ensure change listeners are not called recursively (single and generic)
 - Remove left over System.out.println's
 - Introduce Emission enum to make logic clearer
   
   The logic only has three states, but using two booleans for this allows
   for four states.

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

Changes:
  - all: https://git.openjdk.org/jfx/pull/837/files
  - new: https://git.openjdk.org/jfx/pull/837/files/67e60f01..da56fdc5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=837&range=06
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=837&range=05-06

  Stats: 134 lines in 3 files changed: 99 ins; 5 del; 30 mod
  Patch: https://git.openjdk.org/jfx/pull/837.diff
  Fetch: git fetch https://git.openjdk.org/jfx pull/837/head:pull/837

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


More information about the openjfx-dev mailing list