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 2010/06/25 01:20:49 UTC

FindBugs report on trunk

Hi to all,
some little things seen by FindBugs on Pivot trunk:

Core:
BeanSerializer.java:81 Method
org.apache.pivot.beans.BeanSerializer$NamedObjectBindings.putAll(Map)
makes inefficient use of keySet iterator instead of entrySet iterator

Tools:
EventLoggerSkin.java:44
org.apache.pivot.tools.wtk.EventLoggerSkin$TreeNodeComparator
implements Comparator but not Serializable
ComponentPropertyInspectorSkin.java:30
org.apache.pivot.tools.wtk.ComponentPropertyInspectorSkin$NameComparator
implements Comparator but not Serializable
ComponentPropertyInspectorSkin.java:37
org.apache.pivot.tools.wtk.ComponentPropertyInspectorSkin$ClassComparator
implements Comparator but not Serializable

Tutorials (ok, small things but good to show our users that all Pivot
code is written in the right way):
Expenses.java:46 Write to static field
org.apache.pivot.tutorials.webqueries.Expenses.instance from instance
method new org.apache.pivot.tutorials.webqueries.Expenses()
ListViews.java:69 Method
org.apache.pivot.tutorials.lists.ListViews$1.updateSelection(ListView)
concatenates strings using + in a loop

Wtk:
TreeView.java:626 org.apache.pivot.wtk.TreeView$PathComparator
implements Comparator but not Serializable
BindException.java:1 The class name
org.apache.pivot.wtkx.BindException shadows the simple name of the
superclass org.apache.pivot.beans.BindException
Bindable.java:1 The class name org.apache.pivot.wtkx.Bindable shadows
the simple name of implemented interface
org.apache.pivot.beans.Bindable
TextAreaSkin.java:1397 instanceof will always return true, since all
org.apache.pivot.wtk.text.Element are instances of
org.apache.pivot.wtk.text.Element
TextAreaSkin.java:1377 instanceof will always return true, since all
org.apache.pivot.wtk.text.Element are instances of
org.apache.pivot.wtk.text.Element

Wtk-Terra:
TerraActivityIndicatorSkin.java:88 Dead store to increment
TerraPanoramaSkin.java:378 Dead store to scrollTop
TerraPanoramaSkin.java:385 Dead store to scrollLeft


Tell me on what to do ...


Bye,
Sandro

Re: FindBugs report on trunk

Posted by Sandro Martini <sa...@gmail.com>.
I've just seen commits ... very good, and as always thank you very much.

Bye,
Sandro

Re: FindBugs report on trunk

Posted by Greg Brown <gk...@mac.com>.
> TextAreaSkin.java:1397 instanceof will always return true, since all
> org.apache.pivot.wtk.text.Element are instances of
> org.apache.pivot.wtk.text.Element
> TextAreaSkin.java:1377 instanceof will always return true, since all
> org.apache.pivot.wtk.text.Element are instances of
> org.apache.pivot.wtk.text.Element

Fixed.

> Wtk-Terra:
> TerraActivityIndicatorSkin.java:88 Dead store to increment

That may be a false positive. The increment value is a local final and is used elsewhere.

> TerraPanoramaSkin.java:378 Dead store to scrollTop
> TerraPanoramaSkin.java:385 Dead store to scrollLeft

Fixed.


Re: FindBugs report on trunk

Posted by Sandro Martini <sa...@gmail.com>.
Hi Greg,

>> Wtk-Terra:
>> TerraActivityIndicatorSkin.java:88 Dead store to increment
>> TerraPanoramaSkin.java:378 Dead store to scrollTop
>> TerraPanoramaSkin.java:385 Dead store to scrollLeft
>
> These are probably worth looking into.
These are less important on all I send in the previous mail ...
FindBugs in this case say: "the variable x is defined (and assigned
and maybe computed as a value), but never read, or never used after
its assignment".

Bye

Re: FindBugs report on trunk

Posted by Greg Brown <gk...@mac.com>.
> Core:
> BeanSerializer.java:81 Method
> org.apache.pivot.beans.BeanSerializer$NamedObjectBindings.putAll(Map)
> makes inefficient use of keySet iterator instead of entrySet iterator

Ignore this.

> Tools:
> EventLoggerSkin.java:44
> org.apache.pivot.tools.wtk.EventLoggerSkin$TreeNodeComparator
> implements Comparator but not Serializable
> ComponentPropertyInspectorSkin.java:30
> org.apache.pivot.tools.wtk.ComponentPropertyInspectorSkin$NameComparator
> implements Comparator but not Serializable
> ComponentPropertyInspectorSkin.java:37
> org.apache.pivot.tools.wtk.ComponentPropertyInspectorSkin$ClassComparator
> implements Comparator but not Serializable

Ignore these.

> Tutorials (ok, small things but good to show our users that all Pivot
> code is written in the right way):
> Expenses.java:46 Write to static field
> org.apache.pivot.tutorials.webqueries.Expenses.instance from instance
> method new org.apache.pivot.tutorials.webqueries.Expenses()
> ListViews.java:69 Method
> org.apache.pivot.tutorials.lists.ListViews$1.updateSelection(ListView)
> concatenates strings using + in a loop

Ignore these.

> Wtk:
> TreeView.java:626 org.apache.pivot.wtk.TreeView$PathComparator
> implements Comparator but not Serializable
> BindException.java:1 The class name
> org.apache.pivot.wtkx.BindException shadows the simple name of the
> superclass org.apache.pivot.beans.BindException
> Bindable.java:1 The class name org.apache.pivot.wtkx.Bindable shadows
> the simple name of implemented interface
> org.apache.pivot.beans.Bindable

Ignore these.

> TextAreaSkin.java:1397 instanceof will always return true, since all
> org.apache.pivot.wtk.text.Element are instances of
> org.apache.pivot.wtk.text.Element
> TextAreaSkin.java:1377 instanceof will always return true, since all
> org.apache.pivot.wtk.text.Element are instances of
> org.apache.pivot.wtk.text.Element
> 
> Wtk-Terra:
> TerraActivityIndicatorSkin.java:88 Dead store to increment
> TerraPanoramaSkin.java:378 Dead store to scrollTop
> TerraPanoramaSkin.java:385 Dead store to scrollLeft

These are probably worth looking into.