FindBugs finds bugs

I came across this piece of software called FindBugs recently, which,
shockingly, finds bugs.

I gave it a test run over the trunk, and it found this gem in
PieceAccessConfigurer:

public void setPrompts(String[] prompts) {
  this.prompts = prompts;
  if (selectType == null) {
    selectType.setModel(new DefaultComboBoxModel(prompts));
  }
}

That whole method dates back to r892. Apparently 5 April 2006 was not one of
Rodney’s best days. :slight_smile:

On the other hand, it seems that selectType is never null, or otherwise we’d
have had some bug reports from this…

Anyhow, if you want to find some bugs we didn’t know about before, give this
a shot:

findbugs.sourceforge.net/

Here’s another really funny one, from Inventory:

if (arg1.equals(arg1))
          return 0;

swampwallaby-work@4925 contains findsbug fixes in GamepieceImages. Nothing vital that needs to be backported to 3.1.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

swampwallaby-work@4926 fixes the issues findbugs found in Inventory.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Eclipse Findbugs plugin doesn’t appear to work with libgcj9. There’s a function in gcj that isn’t implemented that FindBugs calls. Brent, what are you running Eclipse on?

  • M.

2009/1/19 Brent Easton <b.easton@exemail.com.au (b.easton@exemail.com.au)>

Post generated using Mail2Forum (mail2forum.com)

Version: 3.4.1
Build id: M20080911-1700
Findsbug version 1.3.7.20081230

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

What OS are you running?

  • M

On 23/01/2009, Brent Easton b.easton@exemail.com.au wrote:


Michael Kiefte, Ph.D.
Associate Professor
School of Human Communication Disorders
Dalhousie University
Halifax, Nova Scotia, Canada
tel: +1 902 494 5150
fax: +1 902 494 5151


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

*********** REPLY SEPARATOR ***********

On 24/01/2009 at 8:28 AM Michael Kiefte wrote:

Vista.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

At Rodney’s expense, and I am sure he is laughing just as hard as the rest of us, I am sorry to say this has to be one of the funniest threads.
However, I have to admit I do stuff like the referenced code all the time, “best days” or not! I would be quite wealthy if I only had a dollar for every time I typed ‘=’ instead of ‘==’ (that one is my personal bane of existence for whatever way my brain is miswired). And of course when the compiler does not catch stuff like that all of us who can not type worth java beans are left out to dry trying to figure out where that pesky bug is.

On Jan 24, 2009, at 6:38 AM, IrishBouzouki wrote:

I think a good claim could be made that the problem isn’t in your (or
other programmer’s brains), but rather that this particular problem
is a consequence of poor programming language design.

I was always more of a fan of the Algol/Pascal convention of using :=
from assignment.

And if the languages had been designed properly, there it wouldn’t be
legal to use assignment in a context calling for a boolean value. It
should not be an expression in the C family of languages.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

I just started playing with FindBugs on the weekend and I have to admit that it’s quite amazing. A lot of things I had never thought of before. What a fantastic tool.

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

It is pretty remarkable what you can deduce about code just through static
analysis.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)