Marek Sebera
Marek Sebera

Reputation: 40661

FindBugs new Formula

I often do this kind of mistake, instead of:

Toast.makeText(this, getString(R.string.string_id), Toast.LENGTH_SHORT).show();

i do this:

Toast.makeText(this, getString(R.string.string_id), Toast.LENGTH_SHORT);

I think, this should be detectable with FindBugs (or any other static analysis utility), which I currently use with Eclipse.

Conditions:

Message similar to:

You apparently forgot to save returned value of call, or you're missing .show() call on returned Toast variable

This message is strictly localized to this type of mistake, but it could contain more conditions or this can be some common mistake.

But what I do miss, is some tutorial, how can we add new recipes to FindBugs database. Can you please point me to place I haven't found in my search or offer me another solution for finding this kind of problem?

Upvotes: 0

Views: 121

Answers (1)

alf
alf

Reputation: 8513

So far I can see two links that can help you:

The former qualifies as a tutorial, I guess.

Upvotes: 2

Related Questions