eclipse warnings
Andy Goryachev
andy.goryachev at oracle.com
Mon Dec 4 17:47:35 UTC 2023
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-retn at openjdk.org> on behalf of Michael Strauß <michaelstrau2 at gmail.com>
Date: Monday, December 4, 2023 at 09:40
To:
Cc: openjfx-dev at openjdk.org <openjfx-dev at 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.goryachev at 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20231204/3e570b2e/attachment.htm>
More information about the openjfx-dev
mailing list