Debian Codegraph @

src/doc/findbugs2.html

raw symbols SCIP
1 <html>
2 <head>
3 <title>FindBugs 2&trade; - Find Bugs in Java Programs</title>
4 <link rel="stylesheet" type="text/css" href="findbugs.css" />
5 @GOOGLE_ANALYTICS@
6 </head>
7
8 <body>
9
10 <table width="100%">
11 <tr>
12
13 @HTML_SIDEBAR@
14
15 <td align="left" valign="top">
16
17 <p></p>
18 <table>
19 <tr>
20 <td valign="center"><a href="@WEBSITE@/"><img src="buggy-sm.png" alt="FindBugs logo"
21 border="0" /> </a></td>
22 <td valign="center"><a href="http://www.umd.edu/"><img src="informal.png"
23 alt="UMD logo" border="0" /> </a></td>
24 </tr>
25 </table>
26
27 <h1>FindBugs 2</h1>
28
29 <p>This page describes the major changes in FindBugs 2. We are well aware that the documentation on
30 the new features in FindBugs 2.0 have not kept up with the implementation. We will be working to
31 improve the documentation, but don't want to hold up the release any longer to improve the
32 documentation.</p>
33 <p>Anyone currently using FindBugs 1.3.9 should find FindBugs 2.0 to largely be a drop-in
34 replacement that offers better accuracy and performance.</p>
35
36
37 <p>
38 Also check out <a href="https://github.com/findbugsproject/findbugs/commits/master">https://github.com/findbugsproject/findbugs/commits/master</a>
39 for more information about some recent features/changes in FindBugs.
40 </p>
41
42 <p>The major new features in FindBugs 2 are as follows:</p>
43 <ul>
44 <li>Bug Rank - bugs are given a rank 1-20, and grouped into the categories scariest (rank 1-4),
45 scary (rank 5-9), troubling (rank 10-14), and of concern (rank 15-20).
46 <ul>
47 <li>priority renamed confidence - many people were confused by the priority reported by
48 FindBugs, and considered all HIGH priority issues to be important. To reflect the
49 actually meaning of this attribute of issues, it has been renamed confidence. Issues of
50 different bug patterns should be compared by there rank, not their confidence.</li>
51 </ul>
52
53 </li>
54 <li><a href="#cloud">Cloud storage</a> - having a convent way for developers to share
55 information about when an issue was first seen, and whether it is believed to be a serious
56 problem, is important to successful and cost-effective deployment of static analysis in a large
57 software project.</li>
58 <li><a href="#updateChecks">update checks</a> - FindBugs will check for releases of new
59 versions of FindBugs. Note: we leverage this capability to count the number of FindBugs users.
60 These update checks can easily be disabled.</li>
61 <li><a href="#plugins">Plugins</a> - FindBugs 2.0 makes it much easier to define plugins that
62 provide various capabilities, and install these plugins either on a per user or per installation
63 basis.</li>
64 <li><code>fb</code> command - rather than using the rather haphazard collection of command line
65 scripts developed over the years for running various FindBugs commands, you can now use just
66 one: <code>fb</code>.
67 <ul>
68 <li><code>fb analyze</code> - invokes the FindBugs analysis</li>
69 <li><code>fb gui</code> - launches the FindBugs GUI
70 <li><code>fb list</code> - lists the issues from a FindBugs analysis file</li>
71 <li><code>fb help</code> - lists the command available.</li>
72 </ul>
73 <p>
74 Plugins can be used to extend the commands that can be invoked via
75 <code>fb</code>.
76 </p>
77 </li>
78 <li><a href="#newBugPatterns">New bug patterns and detectors</a>,
79 and improved accuracy
80 </li>
81 <li><a href="#performance">Improved performance</a>: overall, we've seen an average 10%
82 performance improvement over a large range of benchmarks, although a few users have experienced
83 performance regressions we are still trying to understand.</li>
84 <li id="guava">Guava support - working with Kevin Bourrillion, we have provided additional support for the
85 <a href="http://code.google.com/p/guava-libraries/">Guava library</a>, recognizing many common
86 misuse patterns.
87 </li>
88 <li id="jsr305">JSR-305 support - improved detection of problems identified by JSR-305 annotations. In
89 particular, we've significantly improved both the accuracy and performance of the analysis of
90 type qualifiers.</li>
91 </ul>
92
93 <h2 id="cloud">Cloud storage of issue evaluations</h2>
94 <p>For many years, you could store evaluations of FindBugs issues within the XML containing the
95 analysis results. However, this approach did not work well for a team of distributed developers.
96 Instead, we now provide a cloud based mechanism for storing this information. We are providing a
97 free communal cloud (hostied by Google appengine) for storing evaluations of FindBugs issues. You
98 can set up your own private cloud for storing issues, but at the moment this checking out a copy of
99 FindBugs, making some modifications and building the cloud storage plugin from source. We hope to
100 make it easier to have your own private cloud in FindBugs 2.0.1.</p>
101 <p>We have analyzed several large open source projects, and provide Java web start links to allow
102 you to view the results. We'd be happy to work with projects to make the results available from a
103 continuous build:</p>
104 <ul>
105 <li><a href="http://findbugs.cs.umd.edu/cloud/jdk.jnlp">Sun's JDK 8</a></li>
106 <li><a href="http://findbugs.cs.umd.edu/cloud/eclipse.jnlp">Eclipse 3.8</a></li>
107 <li><a href="http://findbugs.cs.umd.edu/cloud/tomcat.jnlp">Apache Tomcat 7.0</a></li>
108 <li><a href="http://findbugs.cs.umd.edu/cloud/intellij.jnlp">IntelliJ IDEA</a></li>
109 <li><a href="http://findbugs.cs.umd.edu/cloud/jboss.jnlp">JBoss</a></li>
110 </ul>
111
112 <h2 id="updateChecks">FindBugs update checks</h2>
113 <p>
114 FindBugs now checks to see if a new version of FindBugs or a plugin has been released. We make use
115 of this check to collect statistics on the operating system, java version, locale and FindBugs entry
116 point (e.g., ant, command line, GUI). <a href="updateChecking.html">More information is
117 available</a>, including information about how to disable update checks if your organization has a
118 policy against allowing the collection of such information. No information about the code being
119 analyzed is reported.
120
121 </p>
122
123 <h2 id="plugins">Plugins</h2>
124 <p>FindBugs 2.0 makes it much easier to customize FindBugs with plugins.</p>
125 <p>FindBugs looks for plugins in two places: your personal home directory, and in FindBugs home
126 (plugins installed in your home directory take precedence). In both places, it looks in two places:
127 the plugin directory, which contains plugins that are enabled by default, and the optionalPlugin
128 directory, which contains plugins that are disabled by default but can be enabled for a particular
129 project.</p>
130 <p>The FindBugs project includes several plugins:</p>
131 <ul>
132 <li><i>Cloud plugins</i>: These plugins provide ways to persist and share information about
133 issues seen in an analysis (e.g., when was this issue first seen, and any evaluations as to
134 whether this is harmless or a must fix issue, as well as comments about the issue from
135 developers)
136 <ul>
137 <li><code>bugCollectionCloud</code> - stores issue evaluations in the XML. The way
138 issue evaluations were always stored before FindBugs 2.0. Distributed in the
139 optionalPlugin directory.</li>
140 <li><code>findbugsCommunalCloud</code> Stores issue evaluations in the communal cloud
141 hosted at findbugs.appspot.com. Distributed in the plugin directory.</li>
142 <li><code>jdbcCloudClient</code> an older, deprecated cloud that stored information in
143 an SQL database. Not distributed, most be built from source.</li>
144 </ul></li>
145 <li><code>noUpdateChecks</code> - Disables checks for updated versions and usage counting.
146 Distributed in the optionalPlugin directory.</li>
147 <li><code>poweruser</code> - provides a number of additional commands for the <code>fb</code>
148 command. It is believed most of these commands are used by few people outside of the FindBugs
149 development team. Distributed in the optionalPlugin directory.</li>
150 <li><i>Bug filing plugins</i>: these plugins assist in the filing of FindBugs issues in built
151 trackers. The bug filing framework is designed to be extensible to other bug filing systems. At
152 the moment, these plugins are not supported, and must be built from source.
153 <ul>
154 <li><code>jira</code></li>
155 <li><code>google code</code></li>
156 </ul></li>
157 </ul>
158 <h2 id="performance">Performance Improvements/regressions</h2>
159 <p>
160 In our own testing, <a href="performance.html">we've seen an overall improvement of 9% in
161 FindBugs performance from 1.3.9 to 2.0.0, with the majority of benchmarks seeing improvements</a>. A
162 few users have reported significant performance regressions and we are <a href="performance.html">asking
163 for more information from anyone seeing significant performance regressions</a>.
164
165 </p>
166 <h2 id="newBugPatterns">New Bug patterns</h2>
167 <ul>
168 <li><a
169 href="http://findbugs.sourceforge.net/bugDescriptions.html#AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION">AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION</a>
170 </li>
171 <li><a
172 href="http://findbugs.sourceforge.net/bugDescriptions.html#BX_UNBOXING_IMMEDIATELY_REBOXED">BX_UNBOXING_IMMEDIATELY_REBOXED</a>
173 </li>
174 <li><a
175 href="http://findbugs.sourceforge.net/bugDescriptions.html#CO_COMPARETO_RESULTS_MIN_VALUE">CO_COMPARETO_RESULTS_MIN_VALUE</a>
176 </li>
177 <li><a
178 href="http://findbugs.sourceforge.net/bugDescriptions.html#DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD</a>
179 </li>
180 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_ARGUMENTS_WRONG_ORDER">DMI_ARGUMENTS_WRONG_ORDER</a>
181 </li>
182 <li><a
183 href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE</a>
184 </li>
185 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_DOH">DMI_DOH</a></li>
186 <li><a
187 href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS</a>
188 </li>
189 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#DM_DEFAULT_ENCODING">DM_DEFAULT_ENCODING</a>
190 </li>
191 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#ICAST_INT_2_LONG_AS_INSTANT">ICAST_INT_2_LONG_AS_INSTANT</a>
192 </li>
193 <li><a
194 href="http://findbugs.sourceforge.net/bugDescriptions.html#INT_BAD_COMPARISON_WITH_INT_VALUE">INT_BAD_COMPARISON_WITH_INT_VALUE</a>
195 </li>
196 <li><a
197 href="http://findbugs.sourceforge.net/bugDescriptions.html#JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT</a>
198 </li>
199 <li><a
200 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD</a>
201 </li>
202 <li><a
203 href="http://findbugs.sourceforge.net/bugDescriptions.html#OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE</a>
204 </li>
205 <li><a
206 href="http://findbugs.sourceforge.net/bugDescriptions.html#PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS</a>
207 </li>
208 <li><a
209 href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE">RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE</a>
210 </li>
211 <li><a
212 href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_NEGATING_RESULT_OF_COMPARETO">RV_NEGATING_RESULT_OF_COMPARETO</a>
213 </li>
214 <li><a
215 href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_RETURN_VALUE_IGNORED_INFERRED">RV_RETURN_VALUE_IGNORED_INFERRED</a>
216 </li>
217 <li><a
218 href="http://findbugs.sourceforge.net/bugDescriptions.html#SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD</a>
219 </li>
220 <li><a
221 href="http://findbugs.sourceforge.net/bugDescriptions.html#URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD</a>
222 </li>
223 <li><a
224 href="http://findbugs.sourceforge.net/bugDescriptions.html#UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD</a>
225 </li>
226 <li><a
227 href="http://findbugs.sourceforge.net/bugDescriptions.html#UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD</a>
228 </li>
229 <li><a
230 href="http://findbugs.sourceforge.net/bugDescriptions.html#VA_FORMAT_STRING_USES_NEWLINE">VA_FORMAT_STRING_USES_NEWLINE</a>
231 </li>
232 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#VO_VOLATILE_INCREMENT">VO_VOLATILE_INCREMENT</a>
233 </li>
234 </ul>
235
236 </td>
237 </tr>
238 </table>
239
240 </body>
241 </html>