You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Frank Bille Jensen (JIRA)" <ji...@apache.org> on 2007/12/06 19:56:49 UTC

[jira] Updated: (WICKET-830) FindBugs static alalyser shows many coding issues/errors

     [ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Bille Jensen updated WICKET-830:
--------------------------------------

    Fix Version/s:     (was: 1.3.0-rc2)
                   1.3.0-rc3

> 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-rc3
>
>         Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.patch.gz, findbugs-badpractice-stringequality.patch.gz, findbugs-badpractice-versionid.patch.gz, findbugs-correctness-comparisonwithself.patch.gz, findbugs-correctness-impossiblecast.patch.gz, findbugs-correctness-possiblenpe-inline.patch.gz, findbugs-correctness-possiblenpe.patch.gz, findbugs-correctness-redundantnullcheck.patch.gz, findbugs-correctness-tostringonarray.patch.gz, findbugs-dodgy.patch.gz, findbugs-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields-roundup.patch.gz, findbugs-performance-unreadfields.patch.gz, findbugs-vulnerable-mutablestatic-dependent.patch.gz, findbugs-vulnerable-mutablestatic-questionable.patch.gz, findbugs-vulnerable-mutablestatic.patch.gz
>
>
> 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.