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 From: openjfx-dev <openjfx-dev-r...@openjdk.org> on behalf of Michael Strauß <michaelstr...@gmail.com> Date: Monday, December 4, 2023 at 09:40 To: Cc: openjfx-dev@openjdk.org <openjfx-dev@openjdk.org> Subject: Re: eclipse warnings I also see lots of instances of a pattern where the the return value of a getter is checked, but then the getter is called again: if (getScene() != null) { getScene().getWindow() // and so on } While this generally works, we can't be 100% sure that this isn't potentially defective code (there could be side effects that cause the returned value to be different). Do we care about fixing that? On Mon, Dec 4, 2023 at 5:34 PM Andy Goryachev <andy.goryac...@oracle.com> wrote: > > Dear colleagues: > > > > Imported the openjfx project into another workspace with a more stringent > error checking and discovered a few issues: > > > > potential null pointer access: 295 > unnecessary cast or instanceof: 190 > redundant null check: 61 > > > > Do we want to clean these up? > > > > -andy > >