[
https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518549
]
Igor Vaynberg commented on WICKET-830:
--------------------------------------
i ran find bugs a while ago (just when we forked 1.3) and it showed so many
issues it was nearly impossible to find relevant ones. most of them were noise,
but it showed over a 1000 issues i believe so it was hard to filter.
for example:
org.apache.wicket.markup.html.form.FormComponent
has issues in equal (line 653 - different types compared)
this is not wrong, javadoc for object.equals() doesnt mention that equality is
only defined for objects of the same class. in this case
inputName.equals("submit") calls PrependingStringBuffer.equals(str) and
PrependingStringBuffer knows how to properly compare itself with a string.
just my 2c.
i did fix check always returns true:
org.apache.wicket.markup.repeater.data.DataViewBase.onDetach - line 144 - some
legacy code left over from when idetachable was a mixin into idataprovider
> 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.