On Fri, 28 Feb 2025 18:24:38 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
>> modules/javafx.controls/src/main/java/javafx/scene/chart/Chart.java line 106: >> >>> 104: >>> 105: // SimpleBooleanProperty or ObjectBinding >>> 106: private volatile Object accessibilityActive; >> >> You can use `ObservableValue<?>` instead of `Object` as the type. >> Alternatively, use two fields, a `SimpleBooleanProperty` for use by the FX >> app thread and an ObjectBinding for use by a background thread. They >> wouldn't need to be volatile in that case. What you have is OK, but using >> two properties might simplify the logic a bit. > > It's a design decision - I won't want to waste an extra pointer. > The cpu cycles are much cheaper nowadays than bytes. > Extra bytes cost much more in cpu cycles (gc) and electricity. While I still think the code would be cleaner with two properties, and the extra memory is not significant, what you have will work, so I won't object. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1697#discussion_r1980035825