tags:

views:

175

answers:

2

http://findbugs.sourceforge.net/bugDescriptions.html contains a long list of error types. They belong to a category like correctness and performance but do start with an prefix too. EQ for equality is obvious, same like SQL or BIT. But some cryptic. Is there a list what all these prefixes mean?

+2  A: 

Some of them are explained in a PDF I found on Google: http://www.cs.colostate.edu/~mstrout/CS653Spring06/Slides/student-01-sandeep-findbugs.pdf (last page)

I hope it's OK to quote it here:

Code Description

  • CN Cloneable Not Implemented Correctly
  • DC Double Checked Locking
  • DE Dropped Exception
  • EC Suspicious Equals Comparison
  • Eq Bad Covariant Definition of Equals
  • HE Equal Objects Must Have Equal Hashcodes
  • IS2 Inconsistent Synchronization
  • MS Static Field Modifiable By Untrusted Code
  • NP Null Pointer Dereference
  • NS Non-Short-Circuit Boolean Operator
  • OS Open Stream
  • RCN Redundant Comparison to Null
  • RR Read Return Should Be Checked
  • RV Return Value Should Be Checked
  • Se Non-serializable Serializable Class
  • UR Uninitialized Read In Constructor
  • UW Unconditional Wait
  • Wa Wait Not In Loop
Grzegorz Oledzki
A: 

There is a single XML file within the FindBugs codebase that lists all the alerts that can be generated. You can view this file at the Google code project here.

Here is an excerpt from the file:

<BugPattern abbrev="NP" type="NP_GUARANTEED_DEREF" category="CORRECTNESS"/>
<BugPattern abbrev="NP" type="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH" category="CORRECTNESS"/>
<BugPattern abbrev="OS" type="OS_OPEN_STREAM" category="BAD_PRACTICE" />
<BugPattern abbrev="OS" type="OS_OPEN_STREAM_EXCEPTION_PATH" category="BAD_PRACTICE" />
<BugPattern abbrev="PZLA" type="PZLA_PREFER_ZERO_LENGTH_ARRAYS" category="STYLE" />

The detailed descriptions are stored in a different file, which you can browse here.

Grundlefleck
Yeah. But that doesn't answer the original question. E.g. what does NP mean? One can only guess.
Grzegorz Oledzki
The simplest description is that they're an abbreviation of several error types. To find what 'NP' means, look at the `messages.xml` file (the second link) and from the extended descriptions it's possible to infer what they mean. There's no real definitive list AFAIK (what would be the point, really?) but looking at the detailed descriptions gives a good idea of what they stand for.
Grundlefleck