Yep, that's exactly my point. One may argue that using a local variable might help. I don't think there is a warning for this kind of code pattern though.
-andy From: openjfx-dev <openjfx-dev-r...@openjdk.org> on behalf of Michael Strauß <michaelstr...@gmail.com> Date: Monday, December 4, 2023 at 09:55 To: Cc: openjfx-dev@openjdk.org <openjfx-dev@openjdk.org> Subject: Re: eclipse warnings Side effects are not limited to race conditions. A getter might return a different value every time, or it might execute code other than simply returning a value, or a lazy evaluation scheme might cause other code to be executed. The point is, we don't know that at the call site, we'd need to inspect what the getter actually does. On Mon, Dec 4, 2023 at 6:47 PM Andy Goryachev <andy.goryac...@oracle.com> wrote: > > This might be different. > > > > If we can guarantee that the access to the underlying variable(s) is single > threaded - then no. But we had at least one bug recently in JFXPanel where > two threads were involved. Those cases need to use a very different access > pattern(s), depending on the exact circumstances. > > > > -andy