FindBugs static alalyser shows many coding issues/errors
--------------------------------------------------------

                 Key: WICKET-830
                 URL: https://issues.apache.org/jira/browse/WICKET-830
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.0-beta2
            Reporter: Dariusz Wojtas
             Fix For: 1.3.0-beta3


After I found WICKET-829 by examining examples, I tried to run FindBugs against 
the wicket - only core jdk-14.
This showed several easy to fix bugs, nothing really serious.

I really advice someone to run FindBugs from time to time against the project 
(if installed in Eclipse, it's enough to right click on the project, then 2-5 
minutes of analysis and bugs visible in the Bug Tree View).

There are tons of issues found, smaller or bigger.
Some of them are false alarms - like in some tests or inner classes where we 
know something cannot happen.
But many should be fixed

Some of the issues found:

org.apache.wicket.markup.html.form.FormComponent
   has issues in equal (line 653 - different types compared)

org.apache.wicket.Session.getPage   
   line 684 - compares strings with == instead of equals()
   this may be correct but the 'pageMapName' comes as parameter to a public 
method, we never know who will use it

several classes use dead variables (written, never read). Examples:
  org.apache.wicket.markup.html.form.Button - line 206
  org.apache.wicket.markup.html.image.resource.LocalizedImageResource - lines 
254, 255

Some fields should be marked final, but are not. example:
   org.apache.wicket.util.lang.Bytes.MAX

Impossible cast
   org.apache.wicket.util.io.WicketObjectInputStream.get(string, char) - line 
535

Inconsistent synchronization
  Some methods are marked as 'synchronized' when some others are not - when 
working on the same resource.


Inefficient use of keySet iterator instead of entrySet iterator
This occurs in several places in loops.


check always returns true:
org.apache.wicket.markup.repeater.data.DataViewBase.onDetach - line 144

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to