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

John Hendrikx jhendrikx at openjdk.org
Tue Mar 11 06:37:08 UTC 2025


On Tue, 11 Mar 2025 02:48:50 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

> If we can know that the values are going to diverge then logging an error instead of throwing it is fine. However, if they are trying to find a common divisor (as in John's example above), it could take many callbacks for the final value to settle.

I'm unsure what you are saying here.  The common divisor example would not log a warning if I place the warning log in the same location as the SOE.

As for the behavior of multiple listeners, we can never really know for certain if they will eventually agree.  I mean, even the examples with `ExpressionHelper` can avoid a SOE **if** they can change their minds after 100 back-and-forth attempts, and do something else.  The same applies for this implementation.  If listeners are non-deterministic (same input does not lead to same output, by using randomness for example) then we can never be sure if they will reach agreement.

So, aside from letting this "escalate" into a SOE (where the JVM simply gives up) there is no real way to be sure that the values won't converge at some point.  The check I added is making the assumption that listeners are deterministic, but they don't have to be.  Then again, we're again approaching super rare exotic edge cases, that `ExpressionHelper` is not handling either (if it is even possible to handle this).  A non-deterministic listener that also modifies the value of the very property it is monitoring is not something we should have to worry about.

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

PR Comment: https://git.openjdk.org/jfx/pull/1081#issuecomment-2712831349


More information about the openjfx-dev mailing list