You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Dariusz Wojtas (JIRA)" <ji...@apache.org> on 2007/08/08 22:38:59 UTC
[jira] Created: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
[ 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.1)
1.3.2
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.2
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-doublecheckedlocking.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-performance-mapiteration.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546902 ]
Igor Vaynberg commented on WICKET-830:
--------------------------------------
too bad these are indexes which are unsigned - a list cant have a negative index...so like i said in that code you will never have a negative value....
if anything this
return (item.getIndex() % 2 == 1) ? "even" : "odd";
should be fixed as
return (item.getIndex() % 2 == 0) ? "odd" : "even";
and to make it make even more sense for our particular usecase...
return ((item.getIndex()+1) % 2 == 0) ? "even":"odd";
but what find bugs proposes is pretty nasty imho
just my 2c
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-vulnerable-mutablestatic-questionable.patch.gz
findbugs-vulnerable-mutablestatic-questionable.patch.gz contains two mutable statics that I am unsure of if they are by design or not, and needs to be reviewed by someone who knows.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-performance-unreadfields.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
[ 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.2)
1.3.3
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-doublecheckedlocking.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-badpractice-deadstores.patch.gz
findbugs-badpractice-deadstores.patch.gz contains removals of variables and method calls resulting in dead stores. calls are removed where no sideeffects are caused, as far as I can tell, but it would be good if someone with more experience in wicket could give this one in particular some extra attention.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-performance-inefficientconstructor.patch.gz
findbugs-performance-inefficientconstructor.patch.gz fixes mostly explicitly boxed objects in wicket-examples in accordance with findbugs preferences for jdk1.5 code.
> 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-rc2
>
> Attachments: 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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-badpractice-stringequality.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-performance-redundancy.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-badpractice-streamclosing.patch.gz
findbugs-badpractice-streamclosing.patch.gz is relative to findbugs-performance-stringconcatinloop.patch.gz
Closes the outer reader instead of the inner in a test class.
> 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-rc2
>
> Attachments: findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-badpractice-oddness-revised.patch.gz
revised oddness patch according to suggestions.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-correctness-tostringonarray.patch.gz
two invocations of .toString on arrays, which yields unhelpfull results. Added a class of helper methods matching the JDK 1.5+ Arrays.toString and Arrays.deepToString. The class couldand should be removed when we move to 1.5, and the code has a comment to that effect as a reminder.
> 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-rc2
>
> Attachments: findbugs-correctness-impossiblecast.patch.gz, findbugs-correctness-tostringonarray.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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546937 ]
Igor Vaynberg commented on WICKET-830:
--------------------------------------
return (item.getIndex() % 2 == 0) ? "odd" : "even";
to the uninitiated this might look weird because we are actually returning "odd" for even values...thus my +1 suggestion. but i dont really care either way as long as its not that !=0 thing. its def not something we need to optimize, readability is king here.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-badpractice-streamclosing.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-performance-unreadfields-roundup.patch.gz
findbugs-performance-unreadfields-roundup.patch.gz, one last unread field. created accessors for inaccessible fields that appear to be present for viewing in the debugger to allow static analysis to consider the fields used. Is this class still used at all? I couldn't find any users.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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
>
>
> 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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546883 ]
Johan Karlberg commented on WICKET-830:
---------------------------------------
This will be it from me for now. It's getting a little impractical to resolve further findbug complaints and warnings without stepping on my own toes, so I'll have another look once this batch has been committed or rejected.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-dodgy.patch.gz
findbugs-dodgy.patch.gz contains remaining tweaks in findbugs dodgy category that can be dealt with without stepping on the toes of previous patches.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-vulnerable-mutablestatic.patch.gz
findbugs-vulnerable-mutablestatic.patch.gz, finalizes mutable statics where there is no obvious reason for them to be mutable. comments welcome.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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.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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546928 ]
Johan Karlberg commented on WICKET-830:
---------------------------------------
Actually the != 0 version is not just suggested by findbugs, it's also the solution provided by the aforementioned authors (alongside "(x & i) != 0", which apparently performs better if that is a concern). I can regenerate the patch tomorrow if you prefer, using either of your two suggestions, but I must say that reversing the ternary paths looks a lot cleaner to me than adding a magic one to the index...
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-vulnerable-mutablestatic-dependent.patch.gz
findbugs-vulnerable-mutablestatic-dependent.patch.gz fixes one last mutable static, but is dependent on findbugs-performance-unreadfields-roundup.patch.gz
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-correctness-impossiblecast.patch.gz
A single impossible cast, looks like a cut-and-paste error
> 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-rc2
>
> Attachments: findbugs-correctness-impossiblecast.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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Resolved: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-830.
----------------------------------
Assignee: Igor Vaynberg (was: Johan Compagner)
Resolution: Won't Fix
all these are hopelessly out of date by now. we will have to rerun pmd for 1.5 when its getting closer. making these kinds of changes for 1.4 can be dangerous.
> 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
> Assignee: Igor Vaynberg
> Fix For: 1.5-M2
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-doublecheckedlocking.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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546897 ]
Johan Karlberg commented on WICKET-830:
---------------------------------------
Actually, x % 2 -has- negative values. If x is negative. so (-5) %2 = -1, which according to the old test is even. In the uses we hav ein the patch we are checking an index, which is obviously never negative, but findbugs complains since it doesn't know that. The patch is to make it keep quiet, and to give people an alternative that always works, no matter where they get x from.
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-correctness-possiblenpe.patch.gz
Move check for empty role collections to where they are protected by the null check.
> 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-rc2
>
> Attachments: findbugs-correctness-impossiblecast.patch.gz, findbugs-correctness-possiblenpe-inline.patch.gz, findbugs-correctness-possiblenpe.patch.gz, findbugs-correctness-tostringonarray.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-badpractice-stringequality.patch.gz
findbugs-badpractice-stringequality.patch.gz fixes two string equality comparisson with ==. This makes them more explicit, silences findbugs (and IDEA), and since String.equals does object equality as well, should have no relevant performance impact.
> 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-rc2
>
> 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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-correctness-comparisonwithself.patch.gz
Someone will need to explain to me how a long is supposed to be have two different values, because I don't quite see the logic here. refactoring leftovers?
> 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-rc2
>
> Attachments: 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
>
>
> 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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-correctness-redundantnullcheck.patch.gz
removed redundant null check. checked object is already dereferenced earlier in the method.
> 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-rc2
>
> Attachments: 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
>
>
> 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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-performance-inefficientconstructor.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-mapiteration.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-performance-unreadfields.patch.gz
findbugs-performance-unreadfields.patch.gz makes a number of fields static, or removes them if unread and their scope allows.
> 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-rc2
>
> Attachments: 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-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-doublecheckedlocking.patch.gz
findbugs-doublecheckedlocking.patch.gz fixes a broken double-checked locking idiom. fix with volatile valid for JDK1.5+
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-doublecheckedlocking.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-performance-stringconcatinloop.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546881 ]
Igor Vaynberg commented on WICKET-830:
--------------------------------------
wtf,
Index: jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/repeater/SortingPage.java
===================================================================
--- jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/repeater/SortingPage.java (revision 599365)
+++ jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/repeater/SortingPage.java Thu Nov 29 20:45:22 CET 2007
@@ -55,7 +55,7 @@
{
public Object getObject()
{
- return (item.getIndex() % 2 == 1) ? "even" : "odd";
+ return (item.getIndex() % 2 != 0) ? "even" : "odd";
}
}));
}
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-badpractice-versionid.patch.gz
findbugs-badpractice-versionid.patch.gz adds a missing serialVersionUID to SpringBeanLocator
> 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-rc2
>
> Attachments: findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546890 ]
Johan Karlberg commented on WICKET-830:
---------------------------------------
igor, the reason for the oddity is listed two comments up. It's actually identical to one of the java puzzlers in the puzzlers book by joshua bloch and neal gafter
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg updated WICKET-830:
---------------------------------
Fix Version/s: (was: 1.3.3)
1.5-M1
> 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
> Assignee: Johan Compagner
> Fix For: 1.5-M1
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-doublecheckedlocking.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-performance-stringconcatinloop.patch.gz
findbugs-performance-stringconcatinloop.patch.gz contains conversion from doing string concatenation in loops to using stringbuffers.
> 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-rc2
>
> Attachments: 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-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-badpractice-oddness.patch.gz
findbugs-badpractice-oddness.patch.gz changed oddness checks from "x % 2 == 1" to "x % 2 != 0" to acocunt for negative values. While no negative values are possible in these specific cases, it makes findbugs happy, and might make someone not mess up somewhere else ;)
> 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-rc2
>
> Attachments: findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Commented: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546894 ]
Igor Vaynberg commented on WICKET-830:
--------------------------------------
yeah well, it still seems pretty damn stupid to me
obviously %2 doesnt have any negative values
if i am testing for something that is odd it is natural to test if %2==1 not if %2!=0, in fact it made me stare at it for a while....
> 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-rc2
>
> Attachments: findbugs-badpractice-deadstores.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-performance-inefficientconstructor.patch.gz, findbugs-performance-mapiteration.patch.gz, findbugs-performance-redundancy.patch.gz, findbugs-performance-stringconcatinloop.patch.gz, findbugs-performance-unreadfields.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg updated WICKET-830:
---------------------------------
Fix Version/s: (was: 1.3.0-beta3)
1.3.0-rc1
> 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-rc1
>
>
> 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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-performance-unreadfields-roundup.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-badpractice-versionid.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.patch.gz, findbugs-badpractice-streamclosing.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-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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner updated WICKET-830:
-----------------------------------
Attachment: (was: findbugs-badpractice-deadstores.patch.gz)
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.0-rc3
>
> Attachments: 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.g
z
>
>
> 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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-correctness-possiblenpe-inline.patch.gz
Inlines a trivial method to allow findbugs and the compiler to analyze the flow better. Shuts findbug (and idea in my case) up, and allows the compiler to spot a dead line of code previously hidden.
> 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-rc2
>
> Attachments: findbugs-correctness-impossiblecast.patch.gz, findbugs-correctness-possiblenpe-inline.patch.gz, findbugs-correctness-tostringonarray.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-performance-redundancy.patch.gz
the attached patch removes primarily redundant calls to toString on Strings, and changes some inefficient or redundant construction.
> 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-rc2
>
> Attachments: 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-performance-redundancy.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
[ 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-rc3)
1.3.1
> 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
> Assignee: Johan Compagner
> Fix For: 1.3.1
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-doublecheckedlocking.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.
[jira] Assigned: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg reassigned WICKET-830:
------------------------------------
Assignee: Johan Compagner
go johan go
> 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
> Assignee: Johan Compagner
> 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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Johan Karlberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Karlberg updated WICKET-830:
----------------------------------
Attachment: findbugs-performance-mapiteration.patch.gz
findbugs-performance-mapiteration.patch.gz is dependent on findbugs-performance-redundancy.patch.gz
this patch changes map iteration from iterating on keySet's and looking up values by an additional get operation, to use the entrySet iterator instead.
> 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-rc2
>
> Attachments: 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-performance-mapiteration.patch.gz, findbugs-performance-redundancy.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.
[jira] Updated: (WICKET-830) FindBugs static alalyser shows many
coding issues/errors
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg updated WICKET-830:
---------------------------------
Fix Version/s: 1.5-M2
(was: 1.5-M1)
> 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
> Assignee: Johan Compagner
> Fix For: 1.5-M2
>
> Attachments: findbugs-badpractice-oddness-revised.patch.gz, findbugs-badpractice-oddness.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-doublecheckedlocking.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.