You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2009/10/06 11:27:54 UTC

Small thing

Hi to all,

just found this, with the latest FindBugs:

ApplicationContext.java:1420 Inconsistent synchronization of
org.apache.pivot.wtk.ApplicationContext$QueuedCallback.executed;
locked 50% of time

All could be already right, be a check could be useful.

Description:

The fields of this class appear to be accessed inconsistently with
respect to synchronization.  This bug report indicates that the bug
pattern detector judged that

The class contains a mix of locked and unlocked accesses,
At least one locked access was performed by one of the class's own methods, and
The number of unsynchronized field accesses (reads and writes) was no
more than one third of all accesses, with writes being weighed twice
as high as reads
A typical bug matching this bug pattern is forgetting to synchronize
one of the methods in a class that is intended to be thread-safe.

You can select the nodes labeled "Unsynchronized access" to show the
code locations where the detector believed that a field was accessed
without synchronization.

Note that there are various sources of inaccuracy in this detector;
for example, the detector cannot statically detect all situations in
which a lock is held.  Also, even when the detector is accurate in
distinguishing locked vs. unlocked accesses, the code in question may
still be correct.


Bye,
Sandro

Re: Small thing

Posted by Greg Brown <gk...@mac.com>.
>just found this, with the latest FindBugs:
>
>ApplicationContext.java:1420 Inconsistent synchronization of
>org.apache.pivot.wtk.ApplicationContext$QueuedCallback.executed;
>locked 50% of time

Thanks for catching this. I just checked in a fix.


Re: Small thing

Posted by Sandro Martini <sa...@gmail.com>.
Ok.

Bye

Re: Small thing

Posted by Greg Brown <gk...@mac.com>.
I believe these are all safe to ignore.
 
On Tuesday, October 06, 2009, at 06:07AM, "Sandro Martini" <sa...@gmail.com> wrote:
>Hi, other small things:
>
>TreeNodeComparator.java:1
>org.apache.pivot.tutorials.TreeNodeComparator implements Comparator
>but not Serializable
>
>ListViews.java:68 Method
>org.apache.pivot.tutorials.lists.ListViews$1.updateSelection(ListView)
>concatenates strings using + in a loop
>RSSFeedDemo.java:155 Method
>org.apache.pivot.demos.rss.RSSFeedDemo$RSSItemRenderer.render(Object,
>int, ListView, boolean, boolean, boolean, boolean) concatenates
>strings using + in a loop
>
>ValueSeries.java:1 org.apache.pivot.charts.content.ValueSeries doesn't
>override org.apache.pivot.collections.ArrayList.equals(Object)
>
>I can do the fix, tell me if wanted.
>
>Bye,
>Sandro
>
>

Re: Small thing

Posted by Sandro Martini <sa...@gmail.com>.
Hi, other small things:

TreeNodeComparator.java:1
org.apache.pivot.tutorials.TreeNodeComparator implements Comparator
but not Serializable

ListViews.java:68 Method
org.apache.pivot.tutorials.lists.ListViews$1.updateSelection(ListView)
concatenates strings using + in a loop
RSSFeedDemo.java:155 Method
org.apache.pivot.demos.rss.RSSFeedDemo$RSSItemRenderer.render(Object,
int, ListView, boolean, boolean, boolean, boolean) concatenates
strings using + in a loop

ValueSeries.java:1 org.apache.pivot.charts.content.ValueSeries doesn't
override org.apache.pivot.collections.ArrayList.equals(Object)

I can do the fix, tell me if wanted.

Bye,
Sandro