Codebase list findbugs / 1f506cd
Imported Upstream version 2.0.3+repack James Page 10 years ago
98 changed file(s) with 0 addition(s) and 26455 deletion(s). Raw diff Collapse all Expand all
+0
-1
build-lib/README.txt less more
0 This is a folder for jars required for BUILDING, not dependencies of FindBugs itself!
+0
-237
doc/AddingDetectors.txt less more
0 Adding Detectors to FindBugs
1 May 12, 2003
2 Updated June 6, 2003 (detector meta-information, cleanups)
3
4 ===============
5 1. Introduction
6 ===============
7
8 FindBugs uses a plugin-based approach to adding detectors.
9 This makes it easy for users to add their own detectors alongside
10 the ones that come built in.
11
12 Basic idea: FindBugs has some Jar files in a "plugins" directory.
13 At startup, each of those jar files is checked for a "findbugs.xml"
14 file. That XML file registers instances of Detectors, as well
15 as particular "bug patterns" that the detector reports.
16
17 Additionally to the findbugs.xml, bugrank.txt and messages.xml files are
18 required for each FindBugs detector plugin.
19
20 At startup, FindBugs loads all plugin Jar files. At analysis time,
21 all detectors named in the findbugs.xml files from those plugins
22 are instantiated and applied to analyzed class files.
23
24 In order to format reported BugInstances as text for display,
25 a messages file is loaded from the plugin. In order to support multiple
26 language translations, a locale search is performed in a manner
27 similar to the handling of resource bundles. For example, if the
28 locale is "pt_BR", then the files
29
30 messages_pt_BR.xml
31 messages_pt.xml
32 messages.xml
33
34 are tried, in that order.
35
36 The "findbugs.xml" and "messages.xml" files used by the standard FindBugs
37 bug pattern detectors (coreplugin.jar) can be found in the "etc" directory
38 of the findbugs source distribution. Both files must be UTF-8 encoded.
39
40
41 ============================
42 2. Example findbugs.xml file
43 ============================
44
45 <DetectorPlugin>
46
47 <Detector class="org.foobar.findbugs.FindUnreleasedLocks" speed="slow" />
48 <Detector class="org.foobar.findbugs.ExperimentalDetector" speed="fast" disabled="true" />
49
50 <!-- More Detector elements would go here... -->
51
52 <BugPattern type="UBL_UNRELEASED_LOCK" abbrev="UL" category="MT_CORRECTNESS" />
53
54 <!-- More BugPattern elements would go here... -->
55
56 </DetectorPlugin>
57
58
59 ======================================
60 3. Meaning of elements in findbugs.xml
61 ======================================
62
63 <DetectorPlugin> a collection of <Detector> and <BugPattern> elements.
64 Each plugin Jar file can (and usually will) provide multiple detectors
65 and define multiple bug patterns.
66
67 <Detector> specifies a class which implements the edu.umd.cs.findbugs.Detector
68 interface and has a constructor that takes a single parameter of type
69 edu.umd.cs.findbugs.BugReporter. This element has three possible attributes:
70
71 1. The required "class" attribute specifies the Detector class.
72
73 2. The optional "disabled" attribute, if set to "true", means
74 that by default, the detector will be disabled at runtime.
75 This is useful for detectors that aren't quite ready for prime time.
76
77 3. The required "speed" attribute supplies a value to be shown in the
78 "Settings->Configure Detectors" dialog. It gives the user an idea of
79 how expensive the analysis will be to perform. The value of this
80 attribute should be one of "fast", "moderate", or "slow".
81
82 <BugPattern> specifies a kind of bug that will be reported.
83 It has three required attributes:
84
85 1. "type" is a unique code identifying the bug. Only one BugPattern
86 can have a a particular type.
87
88 2. "abbrev" is a short alphanumeric code for the bug.
89 Note that multiple BugPatterns can use the same abbreviation
90 if they are related. (See the BugCode element in messages.xml).
91
92 3. "category" can be one of categories defined in the core plugin's messages.xml:
93
94 CORRECTNESS - code that was probably not what the developer intended
95 BAD_PRACTICE - violations of recommended and essential coding practice
96 STYLE - code that is confusing, anomalous, or written in a way that that leads itself to errors
97 MT_CORRECTNESS - multithreaded correctness issues
98 MALICIOUS_CODE - a potential vulnerability if exposed to malicious code
99 PERFORMANCE - a performance issue
100 I18N - internationalization and locale
101
102 or you may create your own category, in which case you should define
103 it in a <BugCategory> element in _your_ messages.xml file.
104
105 ============================
106 4. Example messages.xml file
107 ============================
108
109 <MessageCollection>
110
111 <Detector class="org.foobar.findbugs.FindUnreleasedLocks" >
112 <Details>
113 <![CDATA[
114 <p> This detector looks for JSR-166 locks that are not released on all paths
115 out of a method. Because it performs dataflow analysis, it is fairly slow.
116 ]]>
117 </Details>
118 </Detector>
119
120 <!-- More Detector nodes would go here... -->
121
122 <BugPattern type="UBL_UNRELEASED_LOCK">
123 <ShortDescription>Lock not released on all paths out of method</ShortDescription>
124
125 <LongDescription>{1} does not release lock on all paths out of method</LongDescription>
126
127 <Details>
128 <![CDATA[
129 <p> A JSR-166 lock acquired in this method is not released on all paths
130 out of the method. This could result in a deadlock if another thread
131 tries to acquire the lock. Generally, you should use a finally
132 block to ensure that acquired locks are always released.
133 ]]>
134 </Details>
135 </BugPattern>
136
137 <!-- More BugPattern nodes would go here... -->
138
139 <BugCode abbrev="UL">Unreleased locks</BugCode>
140
141 <!-- More BugCode nodes would go here... -->
142
143 </MessageCollection>
144
145
146 ======================================
147 5. Meaning of elements in messages.xml
148 ======================================
149
150 <MessageCollection> is the top level element
151
152 <BugCategory> elements optionally describe any categories you
153 may have created for your bug patterns. You can skip these if
154 you are using only the categories defined by the core plugin.
155
156 The <Description> child element has a brief (a word or three)
157 description of the category. The <Abbreviation> child element
158 is typically a single capital latter. The optional <Details>
159 child element may describe it in more detail (but no markup).
160
161 <Detector> holds meta-information about a Detector in the plugin.
162 The required "class" attribute specifies the Detector class.
163 Detector elements much have the following child elements:
164
165 The <Details> child element has a brief HTML description of the Detector.
166 It should have HTML markup that would be valid in a BODY element.
167 It should be specified in a CDATA section so that the HTML
168 tags are not misinterpreted as XML.
169
170 <BugPattern> holds all of the human-readable messages for the bug pattern
171 identified by the "type" attribute. The type corresponds to the
172 type attribute of the BugPattern elements described in findbugs.xml.
173 BugPattern elements must have the following child elements:
174
175 <ShortDescription> this is used for when "View->Full Descriptions"
176 is turned off in the GUI, and it's also used as the title for
177 descriptions in the Details window.
178
179 <LongDescription> this is used for when "View->Full Descriptions"
180 is turned on in the GUI, and for output using the command line UI.
181 The placeholders in the long description ({0}, {1}, etc.)
182 refer to BugAnnotations attached to the BugInstances reported by
183 the detector for this bug pattern. You may also use constructs
184 like {1.name} or {1.returnType}.
185
186 <Details> this is the descriptive text to be used in the Details
187 window. It consists of HTML markup to appear in the BODY element of an HTML
188 document. It should be specified in a CDATA section so that the HTML
189 tags are not misinterpreted as XML.
190
191 <BugCode> is the text which describes the common characteristic of all
192 of the BugPatterns which share an abbreviation. In the example above,
193 the abbreviation "UL" is for bugs in which a lock is not released.
194 The text of a BugCode element is shown for tree nodes in the GUI
195 which group bug instances by "bug type".
196
197 ======================================
198 6. Meaning of elements in bugrank.txt
199 ======================================
200
201 For the detailed and up to date information, please read the javadoc of the
202 edu.umd.cs.findbugs.BugRanker class.
203
204 ============================================
205 7. Using 3rd party libraries in the detector
206 ============================================
207
208 FindBugs plugins may extend the default FindBugs classpath and use custom 3rd party
209 libraries during the analysis. This libraries must be part of standard jar class path
210 specified via "ClassPath" attribute in the META-INF/MANIFEST.MF file.
211
212 ======================================
213 8. Adding detectors to Eclipse plugin
214 ======================================
215
216 Since version 2.0.0 Eclipse plugin allows to configure or contribute custom detectors.
217
218 7.1. It is possible to contribute custom detectors via standard Eclipse extensions mechanism.
219 Please check the documentation of the "findBugsEclipsePlugin/schema/detectorPlugins.exsd"
220 extension point how to update the plugin.xml. Existing FindBugs detector plugins can
221 be easily "extended" to be full featured FindBugs & Eclipse detector plugins.
222 Usually you only need to add META-INF/MANIFEST.MF and plugin.xml to the jar and
223 update your build scripts to not to override the MANIFEST.MF during the build.
224
225 7.2 It is possible to configure custom detectors via Eclipse workspace preferences.
226 Go to "Window->Preferences->Java->FindBugs->Misc. Settings->Custom Detectors"
227 and specify there locations of any additional plugin libraries.
228
229 7.3 Plugins contributed via standard Eclipse extensions mechanism (see 7.1)
230 may extend the default FindBugs classpath and use custom libraries during the analysis.
231 This libraries must be part of standard Eclipse plugin dependencies specified via
232 either "Require-Bundle" or "Bundle-ClassPath" attributes in the MANIFEST.MF file.
233 In case custom detectors need access to this custom libraries at runtime, an
234 extra line must be added to the MANIFEST.MF (without quotation marks):
235 "Eclipse-RegisterBuddy: edu.umd.cs.findbugs.plugin.eclipse".
236
+0
-2810
doc/Changes.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1 <html>
2 <head>
3 <title>FindBugs Change Log</title>
4 <link rel="stylesheet" type="text/css" href="findbugs.css">
5
6 </head>
7
8 <body>
9
10 <table width="100%">
11 <tr>
12
13
14 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
15 <table width="100%" cellspacing="0" border="0">
16 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
17
18 <tr><td>&nbsp;</td></tr>
19
20 <tr><td><b>Docs and Info</b></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
30 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
31 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
32 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
33
34 <tr><td>&nbsp;</td></tr>
35
36 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
37
38 <tr><td>&nbsp;</td></tr>
39
40 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
41
42 <tr><td>&nbsp;</td></tr>
43
44 <tr><td><b>Development</b></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
51 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
52 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
53 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
54 </table>
55 </td>
56
57 <td align="left" valign="top">
58
59
60 <h1>FindBugs Change Log, Version 2.0.3</h1>
61 <ul>
62 <li>New Bug patterns: <a
63 href="http://findbugs.sourceforge.net/bugDescriptions.html#DM_BOXED_PRIMITIVE_FOR_PARSING">DM_BOXED_PRIMITIVE_FOR_PARSING</a>,
64 <a
65 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_METHOD_RETURN_RELAXING_ANNOTATION">NP_METHOD_RETURN_RELAXING_ANNOTATION</a>,
66 and
67 <a
68 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION</a>
69 </li>
70 <li>Add the ability in the GUI to save the currently viewable/filtered bugs to HTML output.
71 <li>When dataflow does't terminate, make sure we continue with
72 analysis.
73
74 <li>Fix some problems that resulting in dataflow analysis not
75 terminating
76
77 <li>Get parameter annotations from default parameters
78 annotations applied to the method.
79 <li>Add subversion change number to eclipse plugin qualifier.
80
81 <li>Disabled detector for <a
82 href="http://findbugs.sourceforge.net/bugDescriptions.html#AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM_CREATES_EMPTY_JAR_FILE_ENTRY</a>;
83 it complaints inappropriately about code that creates directory
84 entries.
85
86 <li>Add warnings about incompatible types passed to
87 org.testng.Assert.assertEquals</li>
88 <li>Add logic that understands more of the Google Guava APIs.
89 <li>Disable type qualifier validator execution within Eclipse plugin;
90 too many problems with class loading and security manager (see #1154 Random obscure Eclipse failures)
91 <li>Consistently check both access flags and attributes to see if something is synthetic. Compiler is
92 inconsistent about where synthetic elements are marked.
93
94 <li>Fixed false positives for the following bug patterns (17
95 occurrences in findbugsTestCases):
96 <ul>
97 <li><a
98 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC">BC</a>
99 <li><a
100 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_IMPOSSIBLE_INSTANCEOF">BC_IMPOSSIBLE_INSTANCEOF</a>
101 <li><a
102 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_UNCONFIRMED_CAST">BC_UNCONFIRMED_CAST</a>
103 <li><a
104 href="http://findbugs.sourceforge.net/bugDescriptions.html#EC_UNRELATED_TYPES">EC_UNRELATED_TYPES</a>
105 <li><a
106 href="http://findbugs.sourceforge.net/bugDescriptions.html#INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE</a>
107 <li><a
108 href="http://findbugs.sourceforge.net/bugDescriptions.html#IS2_INCONSISTENT_SYNC">IS2_INCONSISTENT_SYNC</a>
109 <li><a
110 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS</a>
111 <li><a
112 href="http://findbugs.sourceforge.net/bugDescriptions.html#OBL_UNSATISFIED_OBLIGATION">OBL_UNSATISFIED_OBLIGATION</a>
113 <li><a
114 href="http://findbugs.sourceforge.net/bugDescriptions.html#RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE</a>
115 <li><a
116 href="http://findbugs.sourceforge.net/bugDescriptions.html#SA_FIELD_SELF_COMPARISON">SA_FIELD_SELF_COMPARISON</a>
117 <li><a
118 href="http://findbugs.sourceforge.net/bugDescriptions.html#TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED">TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED</a>
119 </li>
120 </ul>
121 <li>Fixed false negatives for the following bug patterns (45
122 occurrences in findbugsTestCases):
123 <ul>
124 <li><a
125 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_UNCONFIRMED_CAST">BC_UNCONFIRMED_CAST</a>
126 <li><a
127 href="http://findbugs.sourceforge.net/bugDescriptions.html#DM_NUMBER_CTOR">DM_NUMBER_CTOR</a>
128 <li><a
129 href="http://findbugs.sourceforge.net/bugDescriptions.html#EC_ARRAY_AND_NONARRAY">EC_ARRAY_AND_NONARRAY</a>
130 <li><a
131 href="http://findbugs.sourceforge.net/bugDescriptions.html#EC_INCOMPATIBLE_ARRAY_COMPARE">EC_INCOMPATIBLE_ARRAY_COMPARE</a>
132 <li><a
133 href="http://findbugs.sourceforge.net/bugDescriptions.html#EC_UNRELATED_TYPES">EC_UNRELATED_TYPES</a>
134 <li><a
135 href="http://findbugs.sourceforge.net/bugDescriptions.html#GC_UNRELATED_TYPES">GC_UNRELATED_TYPES</a>
136 <li><a
137 href="http://findbugs.sourceforge.net/bugDescriptions.html#IS_FIELD_NOT_GUARDED">IS_FIELD_NOT_GUARDED</a>
138 <li><a
139 href="http://findbugs.sourceforge.net/bugDescriptions.html#IT_NO_SUCH_ELEMENT">IT_NO_SUCH_ELEMENT</a>
140 <li><a
141 href="http://findbugs.sourceforge.net/bugDescriptions.html#JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS</a>
142 <li><a
143 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_NULL_ON_SOME_PATH">NP_NULL_ON_SOME_PATH</a>
144 <li><a
145 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_NONNULL_PARAM_VIOLATION">NP_NONNULL_PARAM_VIOLATION</a>
146 <li><a
147 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE</a>
148 <li><a
149 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE</a>
150 <li><a
151 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_STORE_INTO_NONNULL_FIELD">NP_STORE_INTO_NONNULL_FIELD</a>
152 <li><a
153 href="http://findbugs.sourceforge.net/bugDescriptions.html#RE_POSSIBLE_UNINTENDED_PATTERN">RE_POSSIBLE_UNINTENDED_PATTERN</a>
154 <li><a
155 href="http://findbugs.sourceforge.net/bugDescriptions.html#SA_FIELD_SELF_COMPARISON">SA_FIELD_SELF_COMPARISON</a>
156 </ul>
157 </ul>
158 <h1>FindBugs Change Log, Version 2.0.2</h1>
159
160 <ul>
161 <li>Fix false positions for <a
162 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR</a>
163 - fixing <a
164 href="https://sourceforge.net/tracker/?func=detail&aid=3547559&group_id=96405&atid=614693">Bug3547559</a>,
165 <a
166 href="https://sourceforge.net/tracker/?func=detail&aid=3555408&group_id=96405&atid=614693">Bug3555408</a>,
167 <a
168 href="https://sourceforge.net/tracker/?func=detail&aid=3580266&group_id=96405&atid=614693">Bug3580266</a>
169 and <a
170 href="https://sourceforge.net/tracker/?func=detail&aid=3587164&group_id=96405&atid=614693">Bug3587164</a>.
171
172
173 </li>
174 <li>Fix false positives for <a
175 href="http://findbugs.sourceforge.net/bugDescriptions.html#SF_SWITCH_NO_DEFAULT">SF_SWITCH_NO_DEFAULT</a>
176 <li>Inline access methods for private fields,
177 fixing false positive in <a
178 href="https://sourceforge.net/tracker/?func=detail&aid=3484713&group_id=96405&atid=614693">Bug3484713</a>.
179
180 <li>Type qualifier annotations, including nullness
181 annotations, are now ignored on vararg parameters (including
182 default and inherited annotations), awaiting JSR308.
183 <li>Defined new bug pattern to give better explanations of
184 issues involving strict type qualifiers <a
185 href="http://findbugs.sourceforge.net/bugDescriptions.html#TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED">TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED</a>
186 <li>Adjusted analysis of type qualifiers, now giving warnings
187 where a computed value is used in a place where a value with a
188 strict type qualifier is required.
189 <li>Complain about missing classes only if they are
190 encountered while analyzing application classes; ignore missing
191 classes that are encounted while analyzing classes loaded from the
192 auxclasspath. Fix for <a
193 href="https://sourceforge.net/tracker/?func=detail&aid=3588379&group_id=96405&atid=614693">Bug3588379</a>
194 <li>Fixed false positive null pointer warning coming from
195 synthetic bridge methods, fixing <a
196 href="https://sourceforge.net/tracker/?func=detail&aid=3589328&group_id=96405&atid=614693">Bug3589328</a>
197 <li>In general, suppress warnings in synthetic methods.
198 <li>Fix some false positives involving <a
199 href="http://findbugs.sourceforge.net/bugDescriptions.html#GC_UNRELATED_TYPES">GC_UNRELATED_TYPES</a>
200 on classes that extend generic collection classes.
201
202 </li>
203 <li>Combine multiple identical warnings about
204 <a
205 href="http://findbugs.sourceforge.net/bugDescriptions.html#DM_DEFAULT_ENCODING">DM_DEFAULT_ENCODING</a>
206 that occur in the same method,
207 simplifying issue triage.
208
209 <li>Changes by Andrey Loskutov
210 <ul>
211 <li>fixed job scheduling errors in 3.8/4.2 Eclipse <a
212 href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=393748">bug
213 report</a>
214 <li>more realistic progress bar updates for jobs
215 <li>added nullness annotations for some common Eclipse API
216 methods known to usually return null values
217 <li>Added support for org.eclipse.jdt.annotation.Nullable,
218 NonNull and NonNullByDefault annotations (introduced with
219 Eclipse 3.8/4.2)</li>
220 </ul>
221 <li>Documentation improvements
222 <li><a href="http://code.google.com/p/findbugs/source/list">lots
223 of other small changes</a>
224 </ul>
225 <h1>FindBugs Change Log, Version 2.0.1</h1>
226
227 <ul>
228 <li>New bug patterns; in some cases, bugs previous reported as
229 other bug patterns are reported as instances of these new bug
230 patterns in order to make it easier for developers to understand
231 the bug reports
232 <ul>
233 <li><a
234 href="http://findbugs.sourceforge.net/bugDescriptions.html#PT_ABSOLUTE_PATH_TRAVERSAL">PT_ABSOLUTE_PATH_TRAVERSAL</a></li>
235 <li><a
236 href="http://findbugs.sourceforge.net/bugDescriptions.html#PT_RELATIVE_PATH_TRAVERSAL">PT_RELATIVE_PATH_TRAVERSAL</a></li>
237 <li><a
238 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR</a></li>
239 <li><a
240 href="http://findbugs.sourceforge.net/bugDescriptions.html#MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS_SHOULD_BE_REFACTORED_TO_BE_FINAL</a></li>
241 <li><a
242 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC_UNCONFIRMED_CAST_OF_RETURN_VALUE</a></li>
243 <li><a
244 href="http://findbugs.sourceforge.net/bugDescriptions.html#PT_ABSOLUTE_PATH_TRAVERSAL">PT_ABSOLUTE_PATH_TRAVERSAL</a></li>
245 <li><a
246 href="http://findbugs.sourceforge.net/bugDescriptions.html#TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS">TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS</a></li>
247 </ul>
248 </li>
249
250 <li>Changes to fix false negatives for the following bug
251 patterns: <a
252 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_UNCONFIRMED_CAST">BC_UNCONFIRMED_CAST</a>,
253 <a
254 href="http://findbugs.sourceforge.net/bugDescriptions.html#EC_BAD_ARRAY_COMPARE">EC_BAD_ARRAY_COMPARE</a>,
255 <a
256 href="http://findbugs.sourceforge.net/bugDescriptions.html#EQ_UNUSUAL">EQ_UNUSUAL</a>,
257 <a
258 href="http://findbugs.sourceforge.net/bugDescriptions.html#GC_UNRELATED_TYPES">GC_UNRELATED_TYPES</a>,
259 and <a
260 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE</a>.
261 </li>
262
263 <li>Changes to fix false positions for the following bug
264 patterns: <a
265 href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_DOH">DMI_DOH</a>,
266 <a
267 href="http://findbugs.sourceforge.net/bugDescriptions.html#EC_UNRELATED_TYPES">EC_UNRELATED_TYPES</a>,
268 and <a
269 href="http://findbugs.sourceforge.net/bugDescriptions.html#SE_BAD_FIELD">SE_BAD_FIELD</a>.
270 </li>
271 </ul>
272
273 <h1>FindBugs Change Log, Version 2.0.0</h1>
274
275 <h2>Changes since version 1.3.8</h2>
276 <ul>
277 <li>New bug patterns; in some cases, bugs previous reported as
278 other bug patterns are reported as instances of these new bug
279 patterns in order to make it easier for developers to understand
280 the bug reports
281 <ul>
282 <li><a
283 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_IMPOSSIBLE_DOWNCAST ">BC_IMPOSSIBLE_DOWNCAST
284 </a></li>
285 <li><a
286 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY ">BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY
287 </a></li>
288 <li><a
289 href="http://findbugs.sourceforge.net/bugDescriptions.html#EC_INCOMPATIBLE_ARRAY_COMPARE ">EC_INCOMPATIBLE_ARRAY_COMPARE
290 </a></li>
291 <li><a
292 href="http://findbugs.sourceforge.net/bugDescriptions.html#JLM_JSR166_UTILCONCURRENT_MONITORENTER ">JLM_JSR166_UTILCONCURRENT_MONITORENTER
293 </a></li>
294 <li><a
295 href="http://findbugs.sourceforge.net/bugDescriptions.html#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE ">LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE
296 </a></li>
297 <li><a
298 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_CLOSING_NULL ">NP_CLOSING_NULL
299 </a></li>
300 <li><a
301 href="http://findbugs.sourceforge.net/bugDescriptions.html#RC_REF_COMPARISON_BAD_PRACTICE ">RC_REF_COMPARISON_BAD_PRACTICE
302 </a></li>
303 <li><a
304 href="http://findbugs.sourceforge.net/bugDescriptions.html#RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN ">RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN
305 </a></li>
306 <li><a
307 href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED ">RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED
308 </a></li>
309 <li><a
310 href="http://findbugs.sourceforge.net/bugDescriptions.html#SIC_THREADLOCAL_DEADLY_EMBRACE ">SIC_THREADLOCAL_DEADLY_EMBRACE
311 </a></li>
312 <li><a
313 href="http://findbugs.sourceforge.net/bugDescriptions.html#UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR ">UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR
314 </a></li>
315 <li><a
316 href="http://findbugs.sourceforge.net/bugDescriptions.html#VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED ">VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED
317 </a></li>
318 </ul>
319 </li>
320 <li>Providing a bug rank (1-20), and the ability to filter by
321 bug rank. Eventually, it will be possible to specify your own
322 rules for ranking bugs, but the procedure for doing so hasn't been
323 specified yet.</li>
324 <li>Fixed about <a
325 href="https://sourceforge.net/search/index.php?group_id=96405&search_summary=1&search_details=1&type_of_search=artifact&group_artifact_id%5B%5D=614693&open_date_start=2009-03-16&open_date_end=2009-08-20&form_submit=Search">45
326 bugs filed</a> through SourceForge
327 </li>
328 <li>Various reclassifications and priority tweaks</li>
329 <li>Added more bug annotations to a variety of bug reports.
330 This provides more context for understanding bug reports (e.g., if
331 the value in question was is the return value of a method, the
332 method is described as the source of the value in a bug
333 annotation). This also provide more accurate tracking of issues
334 across versions of the code being analyzed, but has the downside
335 that when comparing results from FindBugs 1.3.8 and FindBugs 1.3.9
336 on the same version of code being analyzed, FindBugs may think
337 that mistakenly believe that the issue reported by 1.3.8 was fixed
338 and a new issue was introduced that was reported by FindBugs
339 1.3.9. While annoying, it would be unusual for more than a dozen
340 issues per million lines of codes to be mistracked.</li>
341 <li>Lots of internal changes moving towards FindBugs 2.0, but
342 these features are undocumented, not yet officially supported, and
343 subject to radical changes before FindBugs 2.0 is released.</li>
344 </ul>
345
346 <p>Changes since version 1.3.8</p>
347 <ul>
348 <li>New bug patterns; in some cases, bugs previous reported as
349 other bug patterns are reported as instances of these new bug
350 patterns in order to make it easier for developers to understand
351 the bug reports
352 <ul>
353 <li><a
354 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_IMPOSSIBLE_DOWNCAST ">BC_IMPOSSIBLE_DOWNCAST
355 </a>
356 <li><a
357 href="http://findbugs.sourceforge.net/bugDescriptions.html#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY ">BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY
358 </a>
359 <li><a
360 href="http://findbugs.sourceforge.net/bugDescriptions.html#EC_INCOMPATIBLE_ARRAY_COMPARE ">EC_INCOMPATIBLE_ARRAY_COMPARE
361 </a>
362 <li><a
363 href="http://findbugs.sourceforge.net/bugDescriptions.html#JLM_JSR166_UTILCONCURRENT_MONITORENTER ">JLM_JSR166_UTILCONCURRENT_MONITORENTER
364 </a>
365 <li><a
366 href="http://findbugs.sourceforge.net/bugDescriptions.html#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE ">LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE
367 </a>
368 <li><a
369 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_CLOSING_NULL ">NP_CLOSING_NULL
370 </a>
371 <li><a
372 href="http://findbugs.sourceforge.net/bugDescriptions.html#RC_REF_COMPARISON_BAD_PRACTICE ">RC_REF_COMPARISON_BAD_PRACTICE
373 </a>
374 <li><a
375 href="http://findbugs.sourceforge.net/bugDescriptions.html#RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN ">RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN
376 </a>
377 <li><a
378 href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED ">RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED
379 </a>
380 <li><a
381 href="http://findbugs.sourceforge.net/bugDescriptions.html#SIC_THREADLOCAL_DEADLY_EMBRACE ">SIC_THREADLOCAL_DEADLY_EMBRACE
382 </a>
383 <li><a
384 href="http://findbugs.sourceforge.net/bugDescriptions.html#UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR ">UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR
385 </a>
386 <li><a
387 href="http://findbugs.sourceforge.net/bugDescriptions.html#VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED ">VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED
388 </a>
389 </ul>
390 </li>
391 <li>Providing a bug rank (1-20), and the ability to filter by
392 bug rank. Eventually, it will be possible to specify your own
393 rules for ranking bugs, but the procedure for doing so hasn't been
394 specified yet.</li>
395 <li>Fixed about <a
396 href="https://sourceforge.net/search/index.php?group_id=96405&search_summary=1&search_details=1&type_of_search=artifact&group_artifact_id%5B%5D=614693&open_date_start=2009-03-16&open_date_end=2009-08-20&form_submit=Search">45
397 bugs filed</a> through SourceForge
398 </li>
399 <li>Various reclassifications and priority tweaks</li>
400 <li>Added more bug annotations to a variety of bug reports.
401 This provides more context for understanding bug reports (e.g., if
402 the value in question was is the return value of a method, the
403 method is described as the source of the value in a bug
404 annotation). This also provide more accurate tracking of issues
405 across versions of the code being analyzed, but has the downside
406 that when comparing results from FindBugs 1.3.8 and FindBugs 1.3.9
407 on the same version of code being analyzed, FindBugs may think
408 that mistakenly believe that the issue reported by 1.3.8 was fixed
409 and a new issue was introduced that was reported by FindBugs
410 1.3.9. While annoying, it would be unusual for more than a dozen
411 issues per million lines of codes to be mistracked.</li>
412 <li>Lots of internal changes moving towards FindBugs 2.0, but
413 these features are undocumented, not yet officially supported, and
414 subject to radical changes before FindBugs 2.0 is released.</li>
415 </ul>
416
417 <p>Changes since version 1.3.7</p>
418 <ul>
419 <li>Primarily another small bugfix release.</li>
420 <li>FindBugs base:
421 <ul>
422 <li>New Reports:
423 <ul>
424 <li>SF_SWITCH_NO_DEFAULT: missing default case in switch
425 statement.</li>
426 <li>SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW:
427 value ignored when switch fallthrough leads to thrown
428 exception.</li>
429 <li>INT_VACUOUS_BIT_OPERATION: bit operations that don't
430 do any meaningful work.</li>
431 <li>FB_UNEXPECTED_WARNING: warning generated that
432 conflicts with @NoWarning FindBugs annotation.</li>
433 <li>FB_MISSING_EXPECTED_WARNING: warning not generated
434 despite presence of @ExpectedWarning FindBugs annotation.</li>
435 <li>NOISE category: intended for use in data mining
436 experiments.
437 <ul>
438 <li>NOISE_NULL_DEREFERENCE: fake null point dereference
439 warning.</li>
440 <li>NOISE_METHOD_CALL: fake method call warning.</li>
441 <li>NOISE_FIELD_REFERENCE: fake field dereference
442 warning.</li>
443 <li>NOISE_OPERATION: fake operation warning.</li>
444 </ul>
445 </li>
446 </ul>
447 </li>
448 <li>Other:
449 <ul>
450 <li>Garvin Leclaire has created a new Apache Maven
451 repository for FindBugs at <a
452 href="http://code.google.com/p/findbugs/">the Google Code
453 FindBugs SVN repository</a>. (Thanks Garvin!)
454 </li>
455 </ul>
456 </li>
457 <li>Fixes:
458 <ul>
459 <li>[ 2317842 ] Highlighting broken in Windows</li>
460 <li>[ 2515908 ] check for oddness should track sign of
461 argument</li>
462 <li>[ 2487936 ] &quot;L B GC&quot; false pos cast from
463 Map.Entry.getKey() to Map.get()</li>
464 <li>[ 2528264 ] Ant tasks not compatible with Ant 1.7.1</li>
465 <li>[ 2539590 ] SF_SWITCH_FALLTHROUGH wrong message
466 reported</li>
467 <li>[ 2020066 ] Bug history displayed in fancy-hist.xsl is
468 incorrect</li>
469 <li>[ 2545098 ] Invalid character in analysis results file</li>
470 <li>[ 2492673 ] Plugin sites should specify &quot;requires
471 Eclipse 3.3 or newer&quot;</li>
472 <li>[ 2588044 ] a tiny typing error</li>
473 <li>[ 2589048 ] Documentation for convertXmlToText
474 insufficient</li>
475 <li>[ 2638739 ] NullPointerException when building</li>
476 </ul>
477 </li>
478 <li>Patches:
479 <ul>
480 <li>[ 2538184 ] Make BugCollection implement
481 Iterable&lt;BugInstance&gt; (thanks to Tomas Pollak)</li>
482 <li>[ 2249771 ] Add Maven2 Findbugs plugin link to the
483 Links page (thanks to Garvin Leclaire)</li>
484 <li>[ 2609526 ] Japanese manual update (thanks to K.
485 Hashimoto)</li>
486 <li>[ 2119482 ] CheckBcel checks for nonexistent classes
487 (thanks to Jerry James)</li>
488 </ul>
489 </li>
490 </ul>
491 </li>
492 <li>FindBugs Eclipse plugin:
493 <ul>
494 <li>Major feature enhancements (thanks to Andrey Loskutov).
495 See <a href="http://andrei.gmxhome.de/findbugs/index.html">this
496 overview</a> for more information.
497 </li>
498 <li>Major test improvements (thanks to Tomas Pollak).</li>
499 <li>Fixes:
500 <ul>
501 <li>[ 2532365 ] Compiler warning</li>
502 <li>[ 2522989 ] Fix filter files selection</li>
503 <li>[ 2504068 ] NullPointerException</li>
504 <li>[ 2640849 ] NPE in Eclipse plugin 1.3.7 and Eclipse
505 3.5 M5</li>
506 </ul>
507 </li>
508 <li>Patches:
509 <ul>
510 <li>[ 2143140 ] Unchecked conversion fixes for Eclipse
511 plugin (thanks to Jerry James)
512 </ul>
513 </li>
514 </ul>
515 </li>
516 </ul>
517
518 <p>Changes since version 1.3.6</p>
519 <ul>
520 <li>Overall, a small bugfix release.
521 <li>New detection of accidental vacuous/useless calls to
522 EasyMock methods, and of generic signatures that proclaim the use
523 of unhashable classes in ways that require that they be hashed.
524 <li>Eliminate some false positives where we were warning about
525 a useless call (e.g., comparing two incompatible types for
526 equality), but the only thing the code was doing with the result
527 was passing it to assertFalse.
528 <li>Japanese localization and manual by K.Hashimoto. (Thanks!)
529
530 <li>Added -exclude and -outputDir command line options to
531 rejarForAnalysis
532 <li>Extended -adjustPriorities option to FindBugs analysis
533 textui so that you can modify the priorities of individual bug
534 patterns as well as visitors, and also completely suppress
535 individual bug patterns or visitors.
536 <ul>
537 <li>e.g., -adjustPriority
538 MS_SHOULD_BE_FINAL=suppress,MS_PKGPROTECT=suppress,EI_EXPOSE_REP=suppress,EI_EXPOSE_REP2=suppress,PZLA_PREFER_ZERO_LENGTH_ARRAYS=raise
539
540 </ul>
541 </ul>
542
543
544 <p>Changes since version 1.3.5</p>
545 <ul>
546 <li>Added fairly exhaustive static analysis of uses of format
547 strings, checking for missing or extra arguements, invalid format
548 specifiers, or mismatched format specifiers and arguments (e.g,
549 passing a String value for a %d format specifier). The logic for
550 doing so is derived from Sun's java.util.Formatter class, and
551 available separately from FindBugs as part of the <a
552 href="https://jformatstring.dev.java.net/">jFormatString</a>
553 project.
554 <li>More tuning of the unsatisfied obligation detector. Since
555 this detector is still rather noisy and an unfinished research
556 project, I've moved the generated issues to a new category:
557 EXPERIMENTAL.
558 <li>Added check for <a
559 href="http://findbugs.sourceforge.net/bugDescriptions.html#BIT_ADD_OF_SIGNED_BYTE">BIT_ADD_OF_SIGNED_BYTE</a>;
560 similar to <a
561 href="http://findbugs.sourceforge.net/bugDescriptions.html#BIT_IOR_OF_SIGNED_BYTE">BIT_IOR_OF_SIGNED_BYTE</a>,
562 except that addition is being used to combine shifted signed
563 bytes.
564 <li>Changed detection of EI_EXPOSE_REP2, so we only report it
565 if the value stored is guaranteed to be the same value that was
566 passed in as a parameter.
567 <li>Added <a
568 href="http://findbugs.sourceforge.net/bugDescriptions.html#EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS">EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS</a>,
569 a warning when an equals method checks to see if an operand is an
570 instance of a class not compatible with itself. For example, if
571 the Foo class checks to see if the argument is an instance of
572 String. This is either a questionable design decision or a coding
573 mistake.
574 <li>Added <a
575 href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_INVOKING_HASHCODE_ON_ARRAY">DMI_INVOKING_HASHCODE_ON_ARRAY</a>,
576 which checks for invoking <code>hashCode()</code> on an array,
577 which returns a hash code that ignores the contents of the array.
578
579 <li>Added checks for using <code>x.removeAll(x)</code> to
580 rather than <code>x.clear()</code> to clear an array.
581 <li>Add checks for calls such as <code>x.contains(x)</code>, <code>x.remove(x)</code>
582 and <code>x.containsAll(x)</code>.
583 <li>Improvements to Eclipse plugin (thanks to Andrey
584 Loskutov):
585 <ul>
586 <li>Report separate markers for each occurrence of an issue
587 that appears multiple times in a method
588 <li>fine tuning for reported markers: add only one marker
589 for fields, add marker on right position
590 <li>link bugs selected in bug explorer view to the opened
591 editor and vice versa
592 <li>select bugs selected in editor ruler in the opened bug
593 explorer view
594 <li>consistent abbreviations used in both bug explorer and
595 bug details view
596 <li>added "Expand All" button to the bug explorer view
597 <li>added "Go Into/Go Up" buttons to the bug explorer view
598 <li>added "Copy to clipboard" menu/functionality to the
599 details view list widget
600 <li>fix for CNF exception if loading the backup solution for
601 broken browser widget
602 </ul>
603 </ul>
604
605
606
607 <p>Changes since version 1.3.4</p>
608 <ul>
609 <li>Analysis about 15% faster
610 <li><a
611 href="http://sourceforge.net/tracker/?atid=614693&group_id=96405&func=browse&status=closed">38
612 bugs closed</a></li>
613 <li>New defect warnings:
614 <ul>
615 <li>calls to methods that always throw
616 UnsupportedOperationException (DMI_UNSUPPORTED_METHOD)
617 <li>repeated conditional tests (e.g., <code>if (x
618 &lt; 0 || x &lt; 0) ...</code>) (RpC_REPEATED_CONDITIONAL_TEST)
619 <li>Complete rewrite of detector for format string problems.
620 More accurate, finds more problems, generates more descriptive
621 reports, several different bug pattern
622 (VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED,
623 VA_FORMAT_STRING_ILLEGAL, VA_FORMAT_STRING_MISSING_ARGUMENT,
624 VA_FORMAT_STRING_BAD_ARGUMENT,
625 VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT)
626 <li>Fairly complete implementation of JSR-305 custom type
627 qualifier analysis (no support for custom validators yet).
628 (TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK
629 TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK
630 TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK)
631 <li>New detector for unsatisfied obligations such forgetting
632 to close a file (OBL_UNSATISFIED_OBLIGATION).
633 <li>Warning when a parameter is marked as nullable, but is
634 always dereferenced.
635 (NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE)
636 <lI>Separate warning for dereference the result of readLine
637 (NP_DEREFERENCE_OF_READLINE_VALUE)
638 </ul>
639 <li>When XML is generated with messages, the project stats now
640 include &lt;FileStat&gt; elements. For each source file, this
641 gives the path for the file, the total number of warnings for that
642 file, and a bugHash for the file. While the instanceHash for a bug
643 is intended to be version invariant (ignoring line numbers, etc),
644 the bugHash for a file is intended to reflect all the information
645 about the warnings in that file. The intended use case is that if
646 the bugHash for a file is the same in two analysis runs, then <em>nothing</em>
647 has changed about any of the warnings reported for that file
648 between the two analysis runs.
649 <li>More merging of similar issues within a method. For
650 example, if the result of readLine() is dereferences multiple
651 times within a method, it will be reported as a single warning
652 with occurrences at multiple source lines.
653 </ul>
654 <p>Changes since version 1.3.3</p>
655
656 <ul>
657 <li>FindBugs base
658 <ul>
659 <li>New Reports:
660 <ul>
661 <li>EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC: equals method
662 overrides equals in superclass and may not be symmetric</li>
663 <li>EQ_ALWAYS_TRUE: equals method always returns true</li>
664 <li>EQ_ALWAYS_FALSE: equals method always returns false</li>
665 <li>EQ_COMPARING_CLASS_NAMES: equals method compares class
666 names rather than class objects</li>
667 <li>EQ_UNUSUAL: Unusual equals method</li>
668 <li>EQ_GETCLASS_AND_CLASS_CONSTANT: equals method fails
669 for subtypes</li>
670 <li>SE_READ_RESOLVE_IS_STATIC: The readResolve method must
671 not be declared as a static method.</li>
672 <li>SE_PRIVATE_READ_RESOLVE_NOT_INHERITED: private
673 readResolve method not inherited by subclasses</li>
674 <li>MSF_MUTABLE_SERVLET_FIELD: Mutable servlet field</li>
675 <li>XSS_REQUEST_PARAMETER_TO_SEND_ERROR: Servlet reflected
676 cross site scripting vulnerability</li>
677 <li>SKIPPED_CLASS_TOO_BIG: Class too big for analysis</li>
678 </ul>
679 </li>
680 <li>Other:
681 <ul>
682 <li>Value-number analysis now more space-efficient</li>
683 <li>Enhancements to reduce memory overhead when analyzing
684 very large classes</li>
685 <li>Now skips very large classes that would otherwise take
686 too much time and memory to analyze</li>
687 <li>Infrastructure for tracking effectively-constant/
688 effectively-final fields</li>
689 <li>Added more cweids</li>
690 <li>Enhanced taint tracking for taint-based detectors</li>
691 <li>Ignore doomed calls to equals if result is used as an
692 argument to assertFalse</li>
693 <li>EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC handles compareTo</li>
694 <li>Priority tweak for ICAST_INTEGER_MULTIPLY_CAST_TO_LONG
695 (only low priority if multiplying by 1000)</li>
696 <li>Improved tracking of fields across method calls</li>
697 </ul>
698 </li>
699 <li>Fixes:
700 <ul>
701 <li>[ 1941450 ] DLS_DEAD_LOCAL_STORE not reported</li>
702 <li>[ 1953323 ] Omitted break statement in
703 SynchronizeAndNullCheckField</li>
704 <li>[ 1942620 ] Source Directories selection dialog
705 interface confusion (partial)</li>
706 <li>[ 1948275 ] Unhelpful "Load of known null"</li>
707 <li>[ 1933922 ] MWM error in findbugs</li>
708 <li>[ 1934772 ] 1.3.3 appears to rely on JDK 1.6, JNLP
709 still specifies 1.5</li>
710 <li>[ 1933945 ] -loadbugs doesn't work</li>
711 <li>Fixed problems for class names starting with '$'</li>
712 <li>Fixed bugs and incomplete handling of annotations in
713 VersionInsensitiveBugComparator</li>
714 </ul>
715 </li>
716 <li>Patches:
717 <ul>
718 <li>[ 1955106 ] Javadoc fixes</li>
719 <li>[ 1951930 ] Superfluous import statements (thanks to
720 Jerry James)</li>
721 <li>[ 1951907 ] Missing @Deprecated annotations (thanks to
722 Jerry James)</li>
723 <li>[ 1951876 ] Infonode Docking Windows compile fix
724 (thanks to Jerry James)</li>
725 <li>[ 1936055 ] bugfix for findbugs.de.comment not working
726 (thanks to Peter Fokkinga)
727 </ul>
728 </li>
729 </ul>
730 <li>FindBugs BlueJ plugin
731 <ul>
732 <li>Updated to use FindBugs 1.3.4 (first new release since
733 1.1.3)</li>
734 </ul>
735 </li>
736 </ul>
737
738 <p>Changes since version 1.3.2</p>
739
740 <ul>
741 <li>FindBugs base
742 <ul>
743 <li>New Detectors:
744 <ul>
745 <li>FieldItemSummary: Produces summary information for
746 what is stored into fields</li>
747 <li>SynchronizeOnClassLiteralNotGetClass: Look for code
748 that synchronizes on the results of getClass rather than on
749 class literals</li>
750 <li>SynchronizingOnContentsOfFieldToProtectField: This
751 detector looks for code that seems to be synchronizing on a
752 field in order to guard updates of that field</li>
753 </ul>
754 </li>
755 <li>New BugCode:
756 <ul>
757 <li>HRS: HTTP Response splitting vulnerability</li>
758 <li>WL: Possible locking on wrong object</li>
759 </ul>
760 </li>
761 <li>New Reports:
762 <ul>
763 <li>DMI_CONSTANT_DB_PASSWORD: This code creates a database
764 connect using a hard coded, constant password</li>
765 <li>HRS_REQUEST_PARAMETER_TO_COOKIE: HTTP cookie formed
766 from untrusted input</li>
767 <li>HRS_REQUEST_PARAMETER_TO_HTTP_HEADER: HTTP parameter
768 directly written to HTTP header output</li>
769 <li>CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE: Class defines
770 clone() but doesn't implement Cloneable</li>
771 <li>DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE: Synchronization
772 on boxed primitive could lead to deadlock</li>
773 <li>DL_SYNCHRONIZATION_ON_BOOLEAN: Synchronization on
774 Boolean could lead to deadlock</li>
775 <li>ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD:
776 Synchronization on field in futile attempt to guard that field
777 </li>
778 <li>DLS_DEAD_LOCAL_STORE_IN_RETURN: Useless assignment in
779 return statement</li>
780 <li>WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL:
781 Synchronization on getClass rather than class literal</li>
782 </ul>
783 </li>
784 <li>Other:
785 <ul>
786 <li>Many enhancements to cross-site scripting detector and
787 its documentation</li>
788 <li>Enhanced switch fall through handling</li>
789 <li>Enhanced unread field handling (look for IF_ACMPEQ and
790 IF_ACMPNE)</li>
791 <li>Clarified documentation for @Nullable in manual</li>
792 <li>Fewer DeadLocalStore false positives</li>
793 <li>Fewer UnreadField false positives</li>
794 <li>Fewer StaticCalendarDetector false positives</li>
795 <li>Performance fix for slow file system IO e.g. Clearcase
796 repositories (thanks, Andrei!)</li>
797 <li>Other, general performance enhancements (thanks,
798 Andrei!)</li>
799 <li>Enhancements for using FindBugs scripts with MKS on
800 Windows (thanks, Kelly O'Hair!)</li>
801 <li>Noted in the manual that jsr305.jar must be present
802 for annotations to compile</li>
803 <li>Added and fine-tuned default-nullness annotations</li>
804 <li>More CWE IDs added</li>
805 <li>Check and warning for unexpected BCEL version in
806 classpath</li>
807 </ul>
808 </li>
809 <li>Fixes:
810 <ul>
811 <li>Bug fix to handling of local variable tables in BCEL</li>
812 <li>Refined documentation for
813 MTIA_SUSPECT_STRUTS_INSTANCE_FIELD</li>
814 <li>[ 1927295 ] NPE when called on project root</li>
815 <li>[ 1926405 ] Incorrect dead store warning</li>
816 <li>[ 1926409 ] Incorrect redundant nullcheck warning</li>
817 <li>[ 1926389 ] Wrong line number printed/highlighted in
818 bug</li>
819 <li>[ 1927040 ] typo in bug description</li>
820 <li>[ 1926263 ] Minor glitch in HTML output</li>
821 <li>[ 1926240 ] Minor error in standard options in manual</li>
822 <li>[ 1926236 ] Minor bug in installation section of
823 manual</li>
824 <li>[ 1925539 ] ZIP is default file system code base</li>
825 <li>[ 1894701 ] Livelock / memory leak in
826 ObjectTypeFactory (thanks, Andrei!)</li>
827 <li>[ 1867491 ] Doesn't reload annotations after code
828 changes in IDE (thanks, Andrei!)</li>
829 <li>[ 1921399 ] -project option not supported</li>
830 <li>[ 1913834 ] "Dead" store to variable with method call</li>
831 <li>[ 1917352 ] H B se:...field in serializable class</li>
832 <li>[ 1911617 ] CloneIdiom relies on
833 getNameConstantOperand for INSTANCEOF</li>
834 <li>[ 1911620 ] False +: DLS predecrement before return</li>
835 <li>[ 1871376 ] False negative: non-serializable Map field</li>
836 <li>[ 1871051 ] non standard clone() method</li>
837 <li>[ 1908854 ] Error in TestASM</li>
838 <li>[ 1907539 ] 22 minor errors in bug checker
839 documentation</li>
840 <li>[ 1897323 ] EJB implementation class false positives</li>
841 <li>[ 1899648 ] Crash on startup on Vista with Java
842 1.6.0_04</li>
843 </ul>
844 </li>
845 </ul>
846 </li>
847 <li>FindBugs Eclipse plugin (change log by Andrey Loskutov)
848 <ul>
849 <li>new feature: export basic FindBugs numbers for projects
850 via File-&gt;Export-&gt;Java-&gt;BugCounts (Andrey Loskutov)</li>
851 <li>new feature: jobs for different projects will be run in
852 parallel per default if running on a multi-core PC
853 ("fb.allowParallelBuild" system property not used anymore)
854 (Andrey Loskutov)</li>
855 <li>fixed performance slowdown in the multi-threaded build,
856 caused by workspace operation locks during assigning marker
857 attributes (Andrey Loskutov)</li>
858 </ul>
859 </li>
860 </ul>
861
862 <p>Changes since version 1.3.1</p>
863
864 <ul>
865 <li>FindBugs base
866 <ul>
867 <li>New Bug Category:
868 <ul>
869 <li>SECURITY (Abbrev: S), A use of untrusted input in a
870 way that could create a remotely exploitable security
871 vulnerability</li>
872 </ul>
873 </li>
874 <li>New Detectors:
875 <ul>
876 <li>CrossSiteScripting: This detector looks for
877 obvious/blatant cases of cross site scripting vulnerabilities</li>
878 </ul>
879 </li>
880 <li>New BugCode:
881 <ul>
882 <li>XSS: Cross site scripting</li>
883 </ul>
884 </li>
885 <li>New Reports:
886 <ul>
887 <li>XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER: HTTP
888 parameter directly written to Servlet output, giving XSS
889 vulnerability</li>
890 <li>XSS_REQUEST_PARAMETER_TO_JSP_WRITER: HTTP parameter
891 directly written to JSP output, giving XSS vulnerability</li>
892 <li>EQ_OTHER_USE_OBJECT: equals() method defined that
893 doesn't override Object.equals(Object)</li>
894 <li>EQ_OTHER_NO_OBJECT: equals() method inherits rather
895 than overrides equals(Object)</li>
896 <li>NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE: Possible
897 null pointer dereference on path that might be infeasible</li>
898 </ul>
899 </li>
900 <li>Other:
901 <ul>
902 <li>Added -noClassOk command-line parameter to
903 command-line and ant interfaces; when -noClassOk is specified
904 and no classfiles are given, FindBugs will print a warning
905 message and output a well- formed file with no warnings</li>
906 <li>Fewer false positives for null pointer bugs</li>
907 <li>Suppress dead-local-store false positives in .jsp code</li>
908 <li>Type fixes in warning messages</li>
909 <li>Better warning message for NP_NULL_ON_SOME_PATH</li>
910 <li>"WMI" bug code description renamed from "Wrong Map
911 Iterator" to "Inefficient Map Iterator"</li>
912 </ul>
913 </li>
914 <li>Fixes:
915 <ul>
916 <li>[ 1893048 ] FindBugs confused by a findbugs.xml file</li>
917 <li>[ 1878528 ] XSL xforms don't support history features</li>
918 <li>[ 1876584 ] two default.xsl flaws</li>
919 <li>[ 1874856 ] Format string bug detector doesn't handle
920 special operators</li>
921 <li>[ 1872645 ] computeBugHistory -
922 java.lang.IllegalArgumentException</li>
923 <li>[ 1872237 ] Ant task fails when no .class files</li>
924 <li>[ 1868670 ] Filters: include AND exclude don't allowed</li>
925 <li>[ 1868666 ] check-for-oddness reported, but array
926 length can never be negative</li>
927 <li>[ 1866108 ] SetBugDatabaseInfoTask strips dir from
928 output filename</li>
929 <li>[ 1866021 ] MineBugHistoryTask strips dir of output
930 filename</li>
931 <li>[ 1865265 ] code doesn't handle
932 StringBuffer.append([CII) right</li>
933 <li>[ 1864793 ] Warning when casting a null reference
934 compared to a String</li>
935 <li>[ 1863376 ] Typo in manual chap 8: Filter Files</li>
936 <li>[ 1862705 ] Transient fields that default to null</li>
937 <li>[ 1842545 ] DLS on catch variable (with priority
938 tweaking)</li>
939 <li>[ 1816258 ] false positive BC_IMPOSSIBLE_CAST</li>
940 <li>[ 1551732 ] Get erroneous DLS with while loop</li>
941 </ul>
942 </li>
943 </ul>
944 </li>
945 <li>FindBugs Eclipse plugin (change log by Andrey Loskutov)
946 <ul>
947 <li>new feature: added Bug explorer view (replacing Bug tree
948 view), based on Common Navigator framework (Andrey Loskutov)</li>
949 <li>bug 1873860 fixed: empty projects are no longer shown in
950 Bug tree view (Andrey Loskutov)</li>
951 <li>new feature: bug counts decorators for projects, folders
952 and files (has to be activated via Preferences -&gt; general
953 -&gt; appearance -&gt; label decorations)(Andrey Loskutov)</li>
954 <li>patch 1746499: better icons (Alessandro Nistico)</li>
955 <li>patch 1893685: Find bug actions on change sets bug
956 (Alessandro Nistico)</li>
957 <li>fixed bug 1855384: Bug configuration is broken in
958 Eclipse (Andrey Loskutov)</li>
959 <li>refactored FindBugs properties page (Andrey Loskutov)</li>
960 <li>refactored FindBugs worker/builder/run action (Andrey
961 Loskutov)</li>
962 <li>FB detects now only bugs from classes on project's
963 classpath (no double work on duplicated class files) (Andrey
964 Loskutov)</li>
965 <li>fixed bug introduced by the bad patch for 1867951: FB
966 cannot be executed incrementally on a folder of file (Andrey
967 Loskutov)</li>
968 <li>fixed job rule: now jobs for different projects may run
969 in parallel if running on a multi-core PC and
970 "fb.allowParallelBuild" system property is set to true (Andrey
971 Loskutov)</li>
972 <li>fixed FB auto-build not started if .fbprefs or
973 .classpath was changed (Andrey Loskutov)</li>
974 <li>fixed not reporting bugs on secondary types (classes
975 defined in java files with different name) (Andrey Loskutov)</li>
976 </ul>
977 </li>
978 </ul>
979
980 <p>Changes since version 1.3.0</p>
981 <ul>
982 <li>New Reports
983 <ul>
984 <li>VA_FORMAT_STRING_ARG_MISMATCH: A format-string method
985 with a variable number of arguments is called, but the number of
986 arguments passed does not match with the number of %
987 placeholders in the format string. This is probably not what the
988 author intended.
989 <li>IO_APPENDING_TO_OBJECT_OUTPUT_STREAM: This code opens a
990 file in append mode and that wraps the result in an object
991 output stream. This won't allow you to append to an existing
992 object output stream stored in a file. If you want to be able to
993 append to an object output stream, you need to keep the object
994 output stream open. The only situation in which opening a file
995 in append mode and the writing an object output stream could
996 work is if on reading the file you plan to open it in random
997 access mode and seek to the byte offset where the append
998 started.
999 <li>NP_BOOLEAN_RETURN_NULL: A method that returns either
1000 Boolean.TRUE, Boolean.FALSE or null is an accident waiting to
1001 happen. This method can be invoked as though it returned a value
1002 of type boolean, and the compiler will insert automatic unboxing
1003 of the Boolean value. If a null value is returned, this will
1004 result in a NullPointerException.
1005 </ul>
1006 </li>
1007 <li>Changes to Existing Reports
1008 <ul>
1009 <li>RV_DONT_JUST_NULL_CHECK_READLINE: CORRECTNESS -&gt;
1010 STYLE</li>
1011 <li>DMI_INVOKING_TOSTRING_ON_ARRAY: Long description
1012 mentions array name whenever possible</li>
1013 </ul>
1014 </li>
1015 <li>Fixes:
1016 <ul>
1017 <li>Updated manual to mention that Java 1.5 is now a
1018 requirement for running FindBugs
1019 <li>Applied patch 1840206 fixing issue "Ant task does not
1020 work when presetdef is used" - thanks to phejl
1021 <li>Applied patch 1778690 fixing issue "Ant task: tolerate
1022 but complain about invalid auxClasspath" - thanks to David
1023 Schmidt
1024 <li>Applied patch 1852125 adding a Chinese-language GUI
1025 bundle props file - thanks to fifi
1026 <li>Applied patch 1845903 adding ability to load XML results
1027 with the Eclipse plugin - thanks to Alex Mont
1028 <li>Fixed issue 1844671 - "FP for "reversed" null check in
1029 catch for stream close"
1030 <li>Fixed issue 1836050 - "-onlyAnalyze broken"
1031 <li>Fixed issue 1853011 - "Typo: Field names should start
1032 with aN lower case letter"
1033 <li>Fixed issue 1844181 - "JNLP file does not contain all
1034 necessary JARs"
1035 <li>Fixed issue 1840245 - "xxxException class does not
1036 derive from Exception"
1037 <li>Fixed issue 1840277 - "[M D EC] Typo in bug
1038 documentation"
1039 <li>Fixed issue 1782447 - "OutOfMemoryError if i activate
1040 Findbugs on my project"
1041 <li>Fixed issue 1830576 - "[regression] keySet/entrySet
1042 false positive"
1043 </ul>
1044 </li>
1045 <li>Other:
1046 <ul>
1047 <li>New bug code: "IO" (for
1048 IO_APPENDING_TO_OBJECT_OUTPUT_STREAM)</li>
1049 <li>Added "-onlyMostRecent" option for computeBugHistory
1050 script/ant task
1051 <li>More explicit language in
1052 RV_RETURN_VALUE_IGNORED_BAD_PRACTICE messages
1053 <li>Modified ResourceValueAnalysis to correctly identify
1054 null == X or null != X as a null check (for issue 1844671)
1055 <li>Modified DMI_HARDCODED_ABSOLUTE_FILENAME logic in
1056 DumbMethodInvocations to ignore files from /etc or /dev and
1057 increase priority of files from /home
1058 <li>Better bug details for infinite loop warnings
1059 <li>Modified unread-fields detector to reduce false
1060 positives from reflective fields
1061 <li>build.xml "classes" target now builds all sources in one
1062 step
1063 </ul>
1064 </li>
1065 </ul>
1066
1067 <p>Changes since version 1.2.1</p>
1068 <ul>
1069 <li>New Detectors and Reports
1070 <ul>
1071 <li>SynchronizationOnSharedBuiltinConstant
1072 <ul>
1073 <li>DL_SYNCHRONIZATION_ON_SHARED_CONSTANT: The code
1074 synchronizes on a shared primitive constant, such as an
1075 interned String. Such constants are interned and shared across
1076 all other classes loaded by the JVM. Thus, this could be
1077 locking on something that other code might also be locking.
1078 This could result in very strange and hard to diagnose
1079 blocking and deadlock behavior. See <a
1080 href="http://www.javalobby.org/java/forums/t96352.html">http://www.javalobby.org/java/forums/t96352.html</a>
1081 and <a href="http://jira.codehaus.org/browse/JETTY-352">http://jira.codehaus.org/browse/JETTY-352</a>.
1082
1083 </ul>
1084 </li>
1085 <li>OverridingEqualsNotSymmetrical
1086 <ul>
1087 <li>EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC: Looks for equals
1088 methods that override equals methods in a superclass where the
1089 equivalence relationship might not be symmetrical.
1090 </ul>
1091 </li>
1092 <li>CheckTypeQualifiers
1093 <ul>
1094 <li>TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED: A value
1095 specified as carrying a type qualifier annotation is consumed
1096 in a location or locations requiring that the value not carry
1097 that annotation. More precisely, a value annotated with a type
1098 qualifier specifying when=ALWAYS is guaranteed to reach a use
1099 or uses where the same type qualifier specifies when=NEVER.</li>
1100 <li>TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED: A value
1101 specified as not carrying a type qualifier annotation is
1102 guaranteed to be consumed in a location or locations requiring
1103 that the value does carry that annotation. More precisely, a
1104 value annotated with a type qualifier specifying when=NEVER is
1105 guaranteed to reach a use or uses where the same type
1106 qualifier specifies when=ALWAYS.</li>
1107 <li>TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK: A value
1108 that might not carry a type qualifier annotation reaches a use
1109 which requires that annotation.</li>
1110 <li>TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK: A value
1111 which might carry a type qualifier annotation reaches a use
1112 which forbids values carrying that annotation.</li>
1113 </ul>
1114 </li>
1115 </ul>
1116 </li>
1117 <li>New Reports (existing detectors)
1118 <ul>
1119 <li>FindHEmismatch
1120 <ul>
1121 <li>EQ_DOESNT_OVERRIDE_EQUALS: This class extends a class
1122 that defines an equals method and adds fields, but doesn't
1123 define an equals method itself. Thus, equality on instances of
1124 this class will ignore the identity of the subclass and the
1125 added fields. Be sure this is what is intended, and that you
1126 don't need to override the equals method. Even if you don't
1127 need to override the equals method, consider overriding it
1128 anyway to document the fact that the equals method for the
1129 subclass just return the result of invoking super.equals(o).</li>
1130 </ul>
1131 </li>
1132 <li>Naming
1133 <ul>
1134 <li>NM_WRONG_PACKAGE, NM_WRONG_PACKAGE_INTENTIONAL: The
1135 method in the subclass doesn't override a similar method in a
1136 superclass because the type of a parameter doesn't exactly
1137 match the type of the corresponding parameter in the
1138 superclass.</li>
1139 <li>NM_SAME_SIMPLE_NAME_AS_SUPERCLASS: This class has a
1140 simple name that is identical to that of its superclass,
1141 except that its superclass is in a different package (e.g., <code>alpha.Foo</code>
1142 extends <code>beta.Foo</code>). This can be exceptionally
1143 confusing, create lots of situations in which you have to look
1144 at import statements to resolve references and creates many
1145 opportunities to accidently define methods that do not
1146 override methods in their superclasses.
1147 </li>
1148 <li>NM_SAME_SIMPLE_NAME_AS_INTERFACE: This class/interface
1149 has a simple name that is identical to that of an
1150 implemented/extended interface, except that the interface is
1151 in a different package (e.g., <code>alpha.Foo</code> extends <code>beta.Foo</code>).
1152 This can be exceptionally confusing, create lots of situations
1153 in which you have to look at import statements to resolve
1154 references and creates many opportunities to accidently define
1155 methods that do not override methods in their superclasses.
1156 </li>
1157 </ul>
1158 <li>FindRefComparison
1159 <ul>
1160 <li>EC_UNRELATED_TYPES_USING_POINTER_EQUALITY: This method
1161 uses using pointer equality to compare two references that
1162 seem to be of different types. The result of this comparison
1163 will always be false at runtime.</li>
1164 </ul>
1165 </li>
1166 <li>IncompatMask
1167 <ul>
1168 <li>BIT_SIGNED_CHECK, BIT_SIGNED_CHECK_HIGH_BIT: This
1169 method compares an expression such as <tt>((event.detail
1170 &amp; SWT.SELECTED) &gt; 0)</tt>. Using bit arithmetic and then
1171 comparing with the greater than operator can lead to
1172 unexpected results (of course depending on the value of
1173 SWT.SELECTED). If SWT.SELECTED is a negative number, this is a
1174 candidate for a bug. Even when SWT.SELECTED is not negative,
1175 it seems good practice to use '!= 0' instead of '&gt; 0'.
1176 </li>
1177 </ul>
1178 </li>
1179 <li>LazyInit
1180 <ul>
1181 <li>LI_LAZY_INIT_UPDATE_STATIC: This method contains an
1182 unsynchronized lazy initialization of a static field. After
1183 the field is set, the object stored into that location is
1184 further accessed. The setting of the field is visible to other
1185 threads as soon as it is set. If the further accesses in the
1186 method that set the field serve to initialize the object, then
1187 you have a <em>very serious</em> multithreading bug, unless
1188 something else prevents any other thread from accessing the
1189 stored object until it is fully initialized.
1190 </li>
1191 </ul>
1192 </li>
1193 <li>FindDeadLocalStores
1194 <ul>
1195 <li>DLS_DEAD_STORE_OF_CLASS_LITERAL: This instruction
1196 assigns a class literal to a variable and then never uses it.
1197 <a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">The
1198 behavior of this differs in Java 1.4 and in Java 5.</a> In Java
1199 1.4 and earlier, a reference to <code>Foo.class</code> would
1200 force the static initializer for <code>Foo</code> to be
1201 executed, if it has not been executed already. In Java 5 and
1202 later, it does not. See Sun's <a
1203 href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">article
1204 on Java SE compatibility</a> for more details and examples, and
1205 suggestions on how to force class initialization in Java 5.
1206 </li>
1207 </ul>
1208 </li>
1209 <li>MethodReturnCheck
1210 <ul>
1211 <li>RV_RETURN_VALUE_IGNORED_BAD_PRACTICE: This method
1212 returns a value that is not checked. The return value should
1213 be checked since it can indication an unusual or unexpected
1214 function execution. For example, the <code>File.delete()</code>
1215 method returns false if the file could not be successfully
1216 deleted (rather than throwing an Exception). If you don't
1217 check the result, you won't notice if the method invocation
1218 signals unexpected behavior by returning an atypical return
1219 value.
1220 </li>
1221 <li>RV_EXCEPTION_NOT_THROWN: This code creates an
1222 exception (or error) object, but doesn't do anything with it.
1223 </li>
1224 </ul>
1225 </li>
1226 </ul>
1227 </li>
1228 <li>Changes to Existing Reports
1229 <ul>
1230 <li>NS_NON_SHORT_CIRCUIT: BAD_PRACTICE -&gt; STYLE</li>
1231 <li>NS_DANGEROUS_NON_SHORT_CIRCUIT: CORRECTNESS -&gt; STYLE</li>
1232 <li>RC_REF_COMPARISON: CORRECTNESS -&gt; BAD_PRACTICE</li>
1233 </ul>
1234 </li>
1235 <li>GUI Changes
1236 <ul>
1237 <li>Added importing and exporting of bug filters</li>
1238 <li>Better handling of failed analysis runs</li>
1239 <li>Added "-look" parameter for selecting look-and-feel</li>
1240 <li>Fixed incorrect package filtering</li>
1241 <li>Fixed issue where "synchronized" was not
1242 syntax-highlighted</li>
1243 </ul>
1244 </li>
1245 <li>Ant-task Changes
1246 <ul>
1247 <li>Refactored common ant-task code to AbstractFindBugsTask</li>
1248 <li>Added tasks for computeBugHistory, convertXmlToText,
1249 filterBugs, mineBugHistory, setBugDatabaseInfo</li>
1250 </ul>
1251 </li>
1252 <li>Manual
1253 <ul>
1254 <li>Updates to GUI section, including new screenshots</li>
1255 <li>Added description of rejarForAnalysis</li>
1256 <li>Revamp of data-mining section</li>
1257 </ul>
1258 </li>
1259 <li>Other Major
1260 <ul>
1261 <li>Internal restructuring for lower memory overhead</li>
1262 </ul>
1263 </li>
1264 <li>Other Minor
1265 <ul>
1266 <li>Fixed typo: was STCAL_STATIC_SIMPLE_DATA_FORMAT_INSTANCE
1267 now STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE</li>
1268 <li>-outputFile parameter became -output</li>
1269 <li>More sensitivity and specificity inLazyInit detector</li>
1270 <li>More sensitivity and specificity in Naming detector</li>
1271 <li>More sensitivity and specificity in UnreadFields
1272 detector</li>
1273 <li>More sensitivity in FindNullDeref detector</li>
1274 <li>More sensitivity in FindBadCast2 detector</li>
1275 <li>More specificity in FindReturnRef detector</li>
1276 <li>Many other tweaks and bug fixes</li>
1277 </ul>
1278 </li>
1279 </ul>
1280
1281 <p>Changes since version 1.2.0</p>
1282 <ul>
1283 <li>Bug fixes:
1284 <ul>
1285 <li><a
1286 href="http://fisheye2.cenqua.com/changelog/findbugs/?cs=8219">Fix</a>
1287 <a
1288 href="http://sourceforge.net/tracker/index.php?func=detail&aid=1726946&group_id=96405&atid=614693">bug</a>
1289 with detectors that were requested to be disabled but were
1290 enabled due to requirements of other detectors.</li>
1291 <li>Fix bugs in incremental analysis within Eclipse plugin</li>
1292 <li>Fix some analysis errors</li>
1293 <li>Fix some threading bugs in GUI2</li>
1294 <li>Report version as version when it was compiled, not when
1295 it was run</li>
1296 <li>Copy analysis time stamp when filtering or transforming
1297 analysis files.</li>
1298 </ul>
1299 <li>Enabled StaticCalendarDetector</li>
1300 <li>Reworked GUI2 to use standard FindBugs filters
1301 <ul>
1302 <li>Allow a suppression filter to be stored in a project and
1303 persisted to the XML representation of a project.</li>
1304 </ul>
1305 </li>
1306
1307 <li>Move away from old GUI2 save format (a directory
1308 containing an xml file and another file containing serialized
1309 filters).</li>
1310 <li>Support/recommend use of two new file extensions/formats:
1311 <dl>
1312 <dt>.fba - FindBugs Analysis File</dt>
1313 <dd>Exactly the same as an existing bug collection file
1314 stored in XML format, but using a distinct file extension to
1315 make it easier to figure out which xml files contain FindBugs
1316 results.</dd>
1317 <dt>.fbp - FindBugs Project File</dt>
1318 <dd>Contains just the information needed to run FindBugs and
1319 display the results (e.g., the files to be analyzed, the
1320 auxiliary class path and the location of source files)
1321 </dl>
1322 </li>
1323 </ul>
1324 <p>Changes since version 1.1.3</p>
1325 <ul>
1326 <li>Added -xml:withAbridgedMessages option to generate xml
1327 containing shorter messages. The messages will be shorted by doing
1328 things like eliding package names, and leaving off the source line
1329 from the LongMessage. These messages are appropriate if being used
1330 in a context where the non-message components of the bug
1331 annotations will be used to provide more information (e.g.,
1332 clicking on the message for a MethodAnnotation will display the
1333 source for the method).
1334 <ul>
1335 <li>FindBugsDisplayFeatures.setAbridgedMessages(true) can be
1336 used to generate abridged messages when FindBugs is being
1337 accessed directly (not via generated XML) from a GUI or IDE.</li>
1338 </ul>
1339 <li>In null pointer analysis, try to be better about always
1340 showing two locations: where it is known null and where it is
1341 dereferenced.
1342 <li>Interprocedural analysis of which methods return nonnull
1343 values
1344 <li>Use method calls to select order in which classes are
1345 analyzed, and order in which methods are analyzed, to improve
1346 interprocedural analysis results.
1347 <li>Significant improvements in memory footprint, memory
1348 allocation and CPU utilization (20-30% reduction in all three)
1349 <li>Added a project name, to provide better descriptions in
1350 the HTML output.
1351 <li>Added new bug pattern: Casting to char, or bit masking
1352 with nonnegative value, and then checking to see if the result is
1353 negative.
1354 <li>Stopped reporting transient fields of classes not marked
1355 as serializable. Transient is used by other persistence
1356 frameworks.
1357 <li>Improvements to detector for SQL injection (Thanks to <a
1358 href="http://www.clock.org/~matt">Matt Hargett</a> for his
1359 contributions
1360 <li>Changed open/save options in GUI2 to not distinguish
1361 between FindBugs projects and saved FindBugs analysis results.
1362 <li>Improvements to detection of serious non-short-circuit
1363 evaluation.
1364 <li>Updated Japanese localization (thanks to Ruimo Uno)
1365 <li>Eclipse plugin changes:
1366 <ul>
1367 <li>Created Bug User Annotations and Bug Tree Views
1368 <li>Use different icons for different bug priorities
1369 <li>Provide more information in Bug Details view
1370 </ul>
1371 </ul>
1372
1373 <p>Changes since version 1.1.2:</p>
1374 <ul>
1375 <li>Fixed broken Ant task
1376 <li>Added running ant task to smoke test
1377 <li>Added validating xml and html output to smoke test
1378 <li>Fixed some (but not all) issues with html output
1379 validation
1380 <li>Added check for x.equals(x) and x.compareTo(x)
1381 <li>Various bug fixes
1382 </ul>
1383 <p>Changes since version 1.1.1:</p>
1384 <ul>
1385 <li>Added check for infinite iterative loops</li>
1386 <li>Added check for use of incompatible types in a collection
1387 (e.g., checking to see if a Set&lt;String&gt; contains a
1388 StringBuffer).</li>
1389 <li>Added check for invocations of equals or hashCode on a
1390 URL, which, <a
1391 href="http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html">surprising
1392 many people</a>, requires DNS resolution.
1393 </li>
1394 <li>Added check for classes that define compareTo but not
1395 equals; such classes can exhibit some anomalous behavior (e.g.,
1396 they are treated differently by PriorityQueues in Java 5 and Java
1397 6).</li>
1398 <li>Added a check for useless self operations (e.g., x &lt; x
1399 or x ^ x).</li>
1400 <li>Fixed a data race that could cause the GUI to fail on
1401 startup</li>
1402 <li>Partial internationalization of the new GUI</li>
1403 <li>Fix bug in "Redo analysis" option of new GUI</li>
1404 <li>Tuning to reduce false positives</li>
1405 <li>Fixed a bug in null pointer analysis that was generating
1406 false positive null pointer warnings on exception paths. Fixing
1407 this bug eliminates about 1/4 of the warnings on null pointer
1408 exceptions on exception paths.</li>
1409 <li>Fixed a bug in the processing of phi nodes for fields in
1410 the null pointer analysis</li>
1411 <li>Applied contributed patch that provides more quick fixes
1412 in Eclipse plugin.</li>
1413 <li>Fixed a number of bugs in the Eclipse auto update sites,
1414 and in the way date qualifiers were being used in the Eclipse
1415 plugin. You may need to manually disable your existing version of
1416 the plugin and download the 1.1.2 from the update site to get the
1417 automatic update function working correctly. The Eclipse update
1418 sites are described at <a
1419 href="http://findbugs.cs.umd.edu/eclipse/">http://findbugs.cs.umd.edu/eclipse/</a>.
1420
1421 </li>
1422 <li>Fixed progress bar in Eclipse plugin</li>
1423 <li>A number of other bug fixes.</li>
1424 </ul>
1425
1426 <p>Changes since version 1.1.0:</p>
1427 <ul>
1428 <li>less scanning of classes not on the analysis path (This
1429 was causing some performance problems.)</li>
1430 <li>no unread field warnings for fields annotated with
1431 javax.persistent or javax.ejb3</li>
1432 <li>Eclipse plugin
1433 <ul>
1434 <li>bug annotation info displayed in Bug Details tab</li>
1435 <li>.fbwarnings data file now stored in .metadata (not in
1436 the project itself)</li>
1437 </ul>
1438 </li>
1439 <li>new SE_BAD_FIELD_INNER_CLASS pattern</li>
1440 <li>updates to Japanese translation (ruimo)</li>
1441 <li>fix some internal slashed/dotted path confusion</li>
1442 <li>other minor improvements</li>
1443 </ul>
1444
1445 <p>Changes since version 1.0.0:</p>
1446
1447 <ul>
1448 <li>Overall, the change from FindBugs 1.0.0 to FindBugs 1.1.0
1449 has been a big change. We've done a lot of work in a lot of areas,
1450 and aren't even going to try to enumerate all the changes.</li>
1451 <li>We spent a lot of time reviewing the results generated by
1452 FindBugs for open source and commercial code bases, and made a
1453 number of changes, small and large, to minimize the number of
1454 false positives. Our primary focus for this was warnings reported
1455 as high and medium priority correctness warnings. Our internal
1456 evaluation is that we produce very few high/medium priority
1457 correctness warnings where the analysis is actually wrong, and
1458 that more than 75% of the high/medium priority correctness
1459 warnings correspond to real coding defects that need addressing in
1460 the source code. The remaining 25% are largely cases such as a
1461 branch or statement that if taken would lead to an error, but in
1462 fact is a dead branch or statement that can never be taken. Such
1463 coding is confusing and hard to maintain, so it should arguably be
1464 fixed, but it is unlikely to actually result in an error during
1465 execution. Thus, some might classify those warnings as false
1466 positives.</li>
1467 <li>We've substantially improved the analysis for errors that
1468 could result in null pointer dereferences. Overall, our experience
1469 has been that these changes have roughly doubled the number of
1470 null pointer errors we detect, without increasing the number of
1471 false positives (in fact, our false positive rate has gone down).
1472 The improvements are due to four factors:
1473 <ul>
1474 <li>By default, we now do some interprocedural analysis to
1475 determine methods that unconditionally dereference their
1476 parameters.</li>
1477 <li>FindBugs also comes with a model of which JDK methods
1478 unconditionally dereference their parameters.</li>
1479 <li>We do limited tracking of fields, so that we can detect
1480 null values stored in fields that lead to exceptions.</li>
1481 <li>We implemented a new analysis technique to find
1482 guaranteed dereferences. Consider the following example: <pre>public int f(Object x, boolean b) {
1483 int result = 0;
1484 if (x == null) result++;
1485 else result--;
1486 // at this point, we know x is null on a simple path
1487 if (b) {
1488 // at this point, x is only null on a complex path
1489 // we don't know if the path in which x is null and b is true is feasible
1490 return result + x.hashCode();
1491 }
1492 else {
1493 // at this point, x is only null on a complex path
1494 // we don't know if the path in which x is null and b is false is feasible
1495 return result - x.hashCode();
1496 }
1497 </pre>
1498
1499 <p>
1500 FindBugs 1.0 used forward dataflow analysis to determine
1501 whether each value is definitely null, null on a simple path,
1502 possible null on a complex path, or definitely nonnull. Thus,
1503 at the statement where
1504 <code> result </code>
1505 is decremented, we know that
1506 <code> x </code>
1507 is definitely null, and at the point before
1508 <code> if (b) </code>
1509 , we know that
1510 <code> x </code>
1511 is null on a simple path. If
1512 <code> x </code>
1513 were to be dereferenced here, we would generate a warning,
1514 because if the else branch of the
1515 <code> if (x == null) </code>
1516 were ever taken, a null pointer exception would result.
1517 </p>
1518
1519 <p>
1520 However, in both the then and else branches of the
1521 <code> if (b) </code>
1522 statement,
1523 <code> x </code>
1524 is only null on a complex path that may be infeasible. It might
1525 be that the program logic is such that if
1526 <code> x </code>
1527 is null, then
1528 <code> b </code>
1529 is never true, so generating a warning about the dereference in
1530 the then clause might be a false positive. We could try to
1531 analyze the program to determine whether it is possible for
1532 <code> x </code>
1533 to be null and
1534 <code> b </code>
1535 to be true, but that can be a hard analysis problem.
1536 </p>
1537
1538 <p>
1539 However,
1540 <code> x </code>
1541 is dereferenced in both the then <em>and</em> else branches of
1542 the
1543 <code> if (b) </code>
1544 statement. So at the point immediately before
1545 <code> if (b) </code>
1546 , we know that
1547 <code> x </code>
1548 is null on a simple path <em>and</em> that
1549 <code> x </code>
1550 is guaranteed to be dereferenced on all paths from this point
1551 forward. FindBugs 1.1 performs a backwards data flow analysis
1552 to determine the values that are guaranteed to be dereferenced,
1553 and will generate a warning in this case.
1554 </p>
1555 </li>
1556 </ul>
1557 <p>
1558 The following screen shot of our new GUI shows an example of this
1559 analysis, as well as showing off our new GUI and points out a
1560 limitation of our current plugins for Eclipse and NetBeans. The
1561 screen shot shows a null pointer bug in HelpDisplay.java. The
1562 test for
1563 <code> href!=null </code>
1564 on line 78 suggests that
1565 <code> href </code>
1566 could be null. If it is, then
1567 <code> href </code>
1568 will be dereferenced on either line 87 or on line 90, generating
1569 a NPE. Note that our analysis here also understands that passing
1570 <code> href </code>
1571 to
1572 <code> URLEncoder.encode </code>
1573 will deference it, and thus treats line 87 as a dereference, even
1574 though
1575 <code> href </code>
1576 is not actually dereferenced at that line. Within our new GUI,
1577 all of these locations are highlighted and listed in the summary
1578 panel. In the original GUI (and in HTML output) we list all of
1579 the locations, but only the primary location is highlighted by
1580 the original GUI. In the Eclipse and NetBeans plugins, only the
1581 primary location is displayed; fixing this is on our todo list
1582 (contributions welcome).
1583 </p>
1584 <p>
1585 <img src="guaranteedDereference.png" alt="">
1586
1587
1588 </p>
1589
1590 </li>
1591 <li>Preliminary support for detectors using the frameworks
1592 other than BCEL, such as the <a href="http://asm.objectweb.org/">ASM</a>
1593 bytecode framework. You may experiment with writing ASM-based
1594 detectors, but beware the API may still change (which could
1595 possibly also affect BCEL-based detectors). In general, we've
1596 started trying to move away from a deep dependence on BCEL, but
1597 that change is only partially complete. Probably best to just
1598 avoid this until we complete more work on this. This change is
1599 only visible to FindBugs plugin developers, and shouldn't be
1600 visible to FindBugs users.
1601 </li>
1602 <li>
1603 <p>Bug categories (CORRECTNESS, MT_CORRECTNESS, etc.) are no
1604 longer hard-coded, but rather defined in xml files associated
1605 with plugins, including the core plugin which defines the
1606 standard categories. Third-party plugins can define their own
1607 categories.</p>
1608 </li>
1609 <li>
1610 <p>Several bug patterns have been moved from CORRECTNESS and
1611 STYLE into a new category, BAD_PRACTICE. The English localization
1612 of STYLE has changed from "Style" to "Dodgy."</p>
1613 <p>In general, we've worked very hard to limit CORRECTNESS
1614 bugs to be real programming errors and sins of commission. We
1615 have reclassified as BAD_PRACTICE a number of bad design
1616 practices that result in overly fragile code, such as defining an
1617 equals method that doesn't accept null or defining class with a
1618 equals method that inherits hashCode from class Object.</p>
1619 <p>In general, our guidelines for deciding whether a bug
1620 should be classified as CORRECTNESS, BAD_PRACTICE or STYLE are:</p>
1621 <dl>
1622 <dt>CORRECTNESS</dt>
1623 <dd>A problem that we can recognize with high confidence and
1624 is an issue that we believe almost all developers would want to
1625 examine and address. We recommend that software teams review all
1626 high and medium priority warnings in their entire code base.</dd>
1627 <dt>BAD_PRACTICE</dt>
1628 <dd>A problem that we can recognize with high confidence and
1629 represents a clear violation of recommended and standard coding
1630 practice. We believe each software team should decide which bad
1631 practices identified by FindBugs it wants to prohibit in the
1632 team's coding standard, and take action to remedy violations of
1633 those coding standards.</dd>
1634 <dt>STYLE</dt>
1635 <dd>These are places where something strange or dodgy is
1636 going on, such as a dead store to a local variable. Typically,
1637 less than half of these represent actionable programming
1638 defects. Reviewing these warnings in any code under active
1639 development is probably a good idea, but reviewing all such
1640 warnings in your entire code base might be appropriate only in
1641 some situations. Individual or team programming styles can
1642 substantially influence the effectiveness of each of these
1643 warnings (e.g., you might have a coding practice or style in
1644 your group that confuses one of the detectors into generating a
1645 lot of STYLE warnings); you will likely want to selectively
1646 suppress or report the STYLE warnings that are effective for
1647 your group.</dd>
1648 </dl>
1649 </li>
1650 <li>Released a preliminary version of a new GUI (known
1651 internally as GUI2 -- not very creative, huh?)</li>
1652 <li>Provided standard ways to mark user designations of bug
1653 warnings (e.g., as NOT_A_BUG or SHOULD_FIX). The internal logic
1654 now records this, it is represented in the XML file, and GUI2
1655 allows the designations to be applied (along with free-form user
1656 annotations about each warning). The user designations and
1657 annotations are not yet supported by the Eclipse plugin, but we
1658 clearly want to support it in Eclipse shortly.</li>
1659 <li>Added a check for a bad comparison with a signed byte with
1660 a value not in the range -128..127. For example: <pre>boolean find200(byte b[]) {
1661 for(int i = 0; i &lt; b.length; i++) if (b[i] == 200) return i;
1662 return -1;
1663 }
1664 </pre>
1665 </li>
1666 <li>Added a checking for testing if a value is equal to
1667 Double.NaN (no value is equal to NaN, not even NaN).</li>
1668 <li>Added a check for using a class with an equals method but
1669 no hashCode method in a hashed data structure.</li>
1670 <li>Added check for uncallable method of an anonymous inner
1671 class. For example, in the following code, it is impossible to
1672 invoke the initalValue method (because the name is misspelled and
1673 as a result is doesn't override a method in ThreadLocal). <pre>private static ThreadLocal serialNum = new ThreadLocal() {
1674 protected synchronized Object initalValue() {
1675 return new Integer(nextSerialNum++);
1676 }
1677 };
1678 </pre>
1679 </li>
1680 <li>Added check for a dead local store caused by a switch
1681 statement fall through</li>
1682 <li>Added check for computing the absolute value of a random
1683 32 bit integer or of a hashcode. This is broken because <code>
1684 Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE </code> , and thus
1685 result of calling Math.abs, which is expected to be nonnegative,
1686 will in fact be negative one time out of 2 <sup> 32 </sup> , which
1687 will invariably be the time your boss is demoing the software to
1688 your customers.
1689
1690 </li>
1691 <li>More careful resolution of inherited methods and fields.
1692 Some of the shortcuts we were taking in FindBugs 1.0.0 were
1693 leading to inaccurate results, and it was fairly easy to address
1694 this by making the analysis more accurate.</li>
1695 <li>Overall, analysis times are about 1.6 times longer in
1696 FindBugs 1.1.0 than in FindBugs 1.0.0. This is because we have
1697 enabled substantial additional analysis at the default effort
1698 level (the actual analysis engine is significantly faster than in
1699 FindBugs 1.0). On a recent AMD Athlon processor, analyzing
1700 JDK1.6.0 (about 1 million lines of code) requires about 15 minutes
1701 of wall clock time.</li>
1702 <li>Provided class and script (printClass) to print classfile
1703 in the human readable format produced by BCEL</li>
1704 <li>Provided -findSource option to setBugDatabaseInfo</li>
1705 </ul>
1706
1707
1708 <p>Changes since version 0.9.7:</p>
1709
1710 <ul>
1711 <li>fix ObjectTypeFactory bug that was suppressing some bugs</li>
1712 <li>opcode stack may determine definite zeros on some paths</li>
1713 <li>opcode stack can track some constant string concatenations
1714 (dbrosius)</li>
1715 <li>default effort performs iterative opcode analysis (but min
1716 effort does not)</li>
1717 <li>default heap size upped to 384m</li>
1718 <li>schema for XML output available: bugcollection.xsd</li>
1719 <li>fixed some internal confusion between dotted and slashed
1720 class names</li>
1721 <li>New detectors
1722 <ul>
1723 <li>CheckImmutableAnnotation.java: checks JCIP annotations</li>
1724 </ul>
1725 </li>
1726 <li>Updated detectors
1727 <ul>
1728 <li>BadRegEx.java: understands Pattern.LITERAL, warns about
1729 "."</li>
1730 <li>FindUnreleasedLock.java: fewer false positives</li>
1731 <li>DumbMethods.java: check for vacuous comparisons to
1732 MAX_INTEGER or MIN_INTEGER, fix bugs detecting
1733 DM_NEXTINT_VIA_NEXTDOUBLE</li>
1734 <li>FindPuzzlers.java: detect <tt>n%2==1</tt>, detect
1735 toString() on array types
1736 </li>
1737 <li>FindInconsistentSync2.java: detects IS_FIELD_NOT_GUARDED
1738 </li>
1739 <li>MethodReturnCheck.java: add check for discarded newly
1740 constructed values, increase priority of some ignored
1741 constructed exceptions, better handling of bytecode compiled by
1742 Eclipse</li>
1743 <li>FindEmptySynchronizedBlock.java: better handling of
1744 bytecode compiled by Eclipse</li>
1745 <li>DoInsideDoPrivileged.java: warn if call to setAccessible
1746 isn't in doPriviledged, don't report private methods</li>
1747 <li>LoadOfKnownNullValue.java: fix bug that was reporting
1748 false positives on <code> finally </code> blocks
1749 </li>
1750 <li>CheckReturnAnnotationDatabase.java: better checks for
1751 unstarted threads</li>
1752 <li>ConfusionBetweenInheritedAndOuterMethod.java: fewer
1753 false positives, fixed a package-handling bug</li>
1754 <li>BadResultSetAccess.java: separate bug pattern for
1755 PreparedStatements, <code> BRZA </code> category folded into <code>
1756 SQL </code> category
1757 </li>
1758 <li>FindDeadLocalStores.java, FindBadCast2.java,
1759 DumbMethods.java, RuntimeExceptionCapture.java: coalesce similar
1760 bugs within a method into a single bug instance with multiple
1761 source lines</li>
1762 </ul>
1763 </li>
1764 <li>Eclipse plugin
1765 <ul>
1766 <li>plugin ID changed from <tt>de.tobject.findbugs</tt> to <tt>edu.umd.cs.findbugs.plugin.eclipse</tt>
1767 </li>
1768 <li>support for findbugs eclipse auto-update site</li>
1769 </ul>
1770 </li>
1771 <li>Updated test case files
1772 <ul>
1773 <li>BadRegEx.java</li>
1774 <li>JSR166.java</li>
1775 <li>ConcurrentModificationBug.java</li>
1776 <li>DeadStore.java</li>
1777 <li>InstanceOf.java</li>
1778 <li>LoadKnownNull.java</li>
1779 <li>NeedsToCheckReturnValue.java</li>
1780 <li>BadResultSetAccessTest.java</li>
1781 <li>DeadStore.java</li>
1782 <li>TestNonNull2.java</li>
1783 <li>TestImmutable.java</li>
1784 <li>TestGuardedBy.java</li>
1785 <li>BadRandomInt.java</li>
1786 <li>six test cases added to new <code> TigerTraps </code>
1787 directory
1788 </li>
1789 </ul>
1790 </li>
1791 <li>fix bug that was generating duplicate uids</li>
1792 <li>fix bug with <code> -onlyAnalyze some.package.* </code> on
1793 jdk1.4
1794 </li>
1795 <li>fix regression bug in
1796 DismantleByteCode.getRefConstantOperand()</li>
1797 <li>fix some minor bugs with the Swing GUI</li>
1798 <li>reordered some bugInstances so that source line
1799 annotations come last</li>
1800 <li>removed references to unused java system properties</li>
1801 <li>French translation updates (David Cotton)</li>
1802 <li>Japanese translation updates (Hanai Shisei)</li>
1803 <li>content cleanup for findbugs.xml and messages.xml</li>
1804 <li>references to cvs hostname updated to
1805 findbugs.cvs.sourceforge.net</li>
1806 <li>documented xdoc output options, new
1807 mineBugHistory/computeBugHistory options</li>
1808 </ul>
1809
1810 <p>Changes since version 0.9.6:</p>
1811
1812 <ul>
1813 <li>performance improvements</li>
1814 <li>ObjectType instances are cached to reduce memory footprint
1815 </li>
1816 <li>for performance and memory reasons stateless detectors are
1817 no longer cloned, must clear their own state between .class files
1818 </li>
1819 <li>fixed bug in bytecode-set lookup for methods (was causing
1820 bad results for IS2, perhaps others)</li>
1821 <li>fix some OpcodeStack bugs with integer and long
1822 operations, perform iterative analysis when effort is <tt>max</tt>
1823 </li>
1824 <li>HTML output includes LongMessage text again (regression in
1825 0.95 - 0.96)</li>
1826 <li>New detectors
1827 <ul>
1828 <li>CalledMethods.java: builds a list of invoked methods for
1829 other detectors to consult (non-reporting)</li>
1830 <li>UncallableMethodOfAnonymousClass.java: detect anonymous
1831 inner classes that define methods that are probably intended to
1832 but do not override methods in a superclass.</li>
1833 </ul>
1834 </li>
1835 <li>Updated detectors
1836 <ul>
1837 <li>FindFieldSelfAssignment.java: recognize separate fields
1838 with the same name (one from superclass)</li>
1839 <li>FindLocalSelfAssignment2.java: handles backward branches
1840 better (Dave Brosius)</li>
1841 <li>FindBadCast2.java: BC_NULL_INSTANCEOF changed to
1842 NP_NULL_INSTANCEOF</li>
1843 <li>FindPuzzlers.java: eliminate false positive on setDate()
1844 (Dave Brosius)</li>
1845 </ul>
1846 </li>
1847 <li>Eclipse plugin
1848 <ul>
1849 <li>fix serious threading bug</li>
1850 <li>preferences for Filters and effort (Peter Hendriks)</li>
1851 <li>French localization (David Cotton)</li>
1852 <li>fix bug when reporting inner classes (Peter Friese)</li>
1853 </ul>
1854 </li>
1855 <li>Updated test case files
1856 <ul>
1857 <li>Mwn.java (Carl Burke/Dave Brosius)</li>
1858 <li>DumbMethodInvocations.java (Anto paul/Dave Brosius)</li>
1859 <!--sic-->
1860 </ul>
1861 </li>
1862 <li>XML output includes garbage collection duration</li>
1863 <li>French messages updated (David Cotton)</li>
1864 <li>Swing GUI shows file name after Load Bugs command</li>
1865 <li>Ant task to launch the findbugs frame (Mark McKay)</li>
1866 <li>miscellaneous code cleanup</li>
1867 </ul>
1868
1869 <p>Changes since version 0.9.5:</p>
1870
1871 <ul>
1872 <li>Updated detectors
1873 <ul>
1874 <li>FindNullDeref.java: respect NonNull and CheckForNull
1875 field annotations</li>
1876 <li>SerializableIdiom.java: detect non-private readObject
1877 and writeObject methods</li>
1878 <li>FindRefComparison.java: smarter array comparison
1879 detection</li>
1880 <li>IsNullValueAnalysis.java: detect <tt>null
1881 instanceof</tt>
1882 </li>
1883 <li>FindLocalSelfAssignment2.java: suppress some false
1884 positives (Dave Brosius)</li>
1885 <li>FindUnreleasedLock.java: don't waste time processing
1886 classes that don't refer to java.util.concurrent.locks</li>
1887 <li>MutableStaticFields.java: report the source line (Dave
1888 Brosius)</li>
1889 <li>SwitchFallthrough.java: better handling of System.exit()
1890 (Dave Brosius)</li>
1891 <li>MultithreadedInstanceAccess.java: better handling of
1892 Servlet.init() (Dave Brosius)</li>
1893 <li>ConfusionBetweenInheritedAndOuterMethod.java: now
1894 enabled</li>
1895 </ul>
1896 </li>
1897 <li>Eclipse plugin
1898 <ul>
1899 <li>background processing (Peter Friese)</li>
1900 <li>internationalization, Japanese localization (Takashi
1901 Okamoto)</li>
1902 </ul>
1903 </li>
1904 <li>findbugs <tt>-onlyAnalyze</tt> option now works on windows
1905 platforms
1906 </li>
1907 <li>mineBugHistory <tt>-noTabs</tt> option for better
1908 alignment of output columns
1909 </li>
1910 <li>filterBugs <tt>-fixed</tt> option (also: will now
1911 recognize the most recent version string)
1912 </li>
1913 <li>XML output includes running time and memory usage data</li>
1914 <li>miscellaneous minor corrections to the manual</li>
1915 <li>better bytecode analysis of the <tt>iinc</tt> instruction
1916 </li>
1917 <li>fix bug in null pointer analysis</li>
1918 <li>improved catch block heuristics</li>
1919 <li>some type analysis tweaks</li>
1920 <li>Bug priority changes
1921 <ul>
1922 <li>DumbMethodInvocations.java: decrease priority of
1923 hard-coded <tt>/tmp</tt> filenames
1924 </li>
1925 <li>ComparatorIdiom.java: decrease priority of
1926 non-serializable anonymous comparators</li>
1927 <li>FindSqlInjection.java: decrease priority of appending a
1928 constant or a static</li>
1929 </ul>
1930 </li>
1931 <li>Updated bug explanations
1932 <ul>
1933 <li>NM_VERY_CONFUSING (Dave Brosius)</li>
1934 </ul>
1935 </li>
1936 <li>Updated test case files
1937 <ul>
1938 <li>BadStoreOfNonSerializableObject.java</li>
1939 <li>BadRandomInt.java</li>
1940 <li>TestFieldAnnotations.java</li>
1941 <li>UseInitCause.java</li>
1942 <li>SqlInjection.java</li>
1943 <li>ArrayEquality.java</li>
1944 <li>BadIntegerOperations.java</li>
1945 <li>Pilhuhn.java</li>
1946 <li>InstanceOf.java</li>
1947 <li>SwitchFallthrough.java (Dave Brosius)</li>
1948 </ul>
1949 </li>
1950 <li>fix URL decoding bug when running under Java Web Start
1951 (Dave Brosius)</li>
1952 <li>distribution includes <tt>project.xml</tt> file for
1953 NetBeans
1954 </li>
1955 </ul>
1956
1957 <p>Changes since version 0.9.4:</p>
1958 <ul>
1959 <li>New detectors
1960 <ul>
1961 <li>VarArgsProblems.java</li>
1962 <li>FindSqlInjection.java: now enabled</li>
1963 <li>ComparatorIdiom.java: comparators usually implement
1964 serializable</li>
1965 <li>Naming.java: detect methods not overridden due to
1966 eponymously typed args from different packages</li>
1967 </ul>
1968 </li>
1969 <li>Updated detectors
1970 <ul>
1971 <li>SwitchFallthrough.java: surpress some false positives</li>
1972 <li>DuplicateBranches.java: surpress some false positives</li>
1973 <li>IteratorIdioms.java: surpress some false positives</li>
1974 <li>FindHEmismatch.java: surpress some false positives</li>
1975 <li>QuestionableBooleanAssignment.java: finds more cases of
1976 <tt>if (b=true)</tt> ilk
1977 </li>
1978 <li>DumbMethods.java: detect int remainder by 1, delayed gc
1979 errors</li>
1980 <li>SerializableIdiom.java: detect store of nonserializable
1981 object into field of serializable class</li>
1982 <li>FindNullDeref.java: fix potential exception</li>
1983 <li>IsNullValue.java: fix potential exception</li>
1984 <li>MultithreadedInstanceAccess.java: fix potential
1985 exception</li>
1986 <li>PreferZeroLengthArrays.java: flag the method, not the
1987 line</li>
1988 </ul>
1989 </li>
1990 <li>Remove some inadvertent dependencies on JDK 1.5</li>
1991 <li>Sort order should be more consistent</li>
1992 <li>XML output changes
1993 <ul>
1994 <li>Option to sort XML bug output</li>
1995 <li>Now contains instance IDs</li>
1996 <li>uid no longer missing (was causing problems with fancy
1997 HTML output)</li>
1998 <li>Typo fixed</li>
1999 </ul>
2000 </li>
2001 <li>Internal changes to track source files, <tt>-sourceInfo</tt>
2002 option
2003 </li>
2004 <li>Bug matching: first try exact bug pattern matching, option
2005 to compare priorities, option to disable package moves</li>
2006 <li>Architecture documentation in <tt>design/architecture</tt>
2007 </li>
2008 <li>Test cases move into their own CVS project</li>
2009 <li>Don't report warnings that occur outside the analyzed
2010 classes</li>
2011 <li>Fixes to the build.xml files</li>
2012 <li>Better handling of @CheckReturnValue and @CheckForNull
2013 annotations (also, some additional methods searched for check
2014 return value and check for null)</li>
2015 <li>Fixed some stream-closing bugs (one by <tt>z-fb-user</tt>/Dave
2016 Brosius)
2017 </li>
2018 <li>Bug priority changes
2019 <ul>
2020 <li>increase priority of ignoring return value of
2021 java.sql.Connection methods</li>
2022 <li>increase priority of comparing classes like Integer
2023 using <tt>==</tt>
2024 </li>
2025 <li>decrease priority of IT_NO_SUCH_ELEMENT if we see any
2026 call to <tt>next()</tt>
2027 </li>
2028 <li>tweak priority of NM_METHOD_CONSTRUCTOR_CONFUSION</li>
2029 <li>decrease priority of RV_RETURN_VALUE_IGNORED for an
2030 inherited annotation that doesn't return same type as class</li>
2031 </ul>
2032 </li>
2033 <li>Updated bug explanations
2034 <ul>
2035 <li>RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE</li>
2036 <li>DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED</li>
2037 <li>IMA_INEFFICIENT_MEMBER_ACCESS (Dave Brosius)</li>
2038 <li>some Japanese improvements to messages_ja.xml ( <tt>ruimo</tt>)
2039 </li>
2040 <li>some German improvements to findbugs_de.properties (Dave
2041 Brosius, <tt>dvholten</tt>)
2042 </li>
2043 </ul>
2044 </li>
2045 <li>Updated test case files
2046 <ul>
2047 <li>BadIntegerOperations.java</li>
2048 <li>SecondKaboom.java</li>
2049 <li>OpenDatabase.java (Dave Brosius)</li>
2050 <li>FindOpenStream.java (Dave Brosius)</li>
2051 <li>BadRandomInt.java</li>
2052 </ul>
2053 </li>
2054 <li>Source-lines info maintained for methods (handy for
2055 abstract and native methods)</li>
2056 <li>Remove surrounding opcodes from source line annotations</li>
2057 <li>Better error when can't read file</li>
2058 <li>Swing GUI: removed console pane from FindBugsFrame, fix
2059 missing classes bug</li>
2060 <li>Fixes to OpcodeStack.java</li>
2061 <li>Detectors may attach a custom value to an OpcodeStack.Item
2062 (Dave Brosius)</li>
2063 <li>Filter.java: ability to add text messages to XML output,
2064 fix bug with <tt>-withMessages</tt>
2065 </li>
2066 <li>SourceInfoMap supports ranges of source lines</li>
2067 <li>Ant task supports the <tt>timestampNow</tt> attribute
2068 </li>
2069 </ul>
2070
2071 <p>Changes since version 0.9.3:</p>
2072 <ul>
2073 <li>Substantial rework of datamining code</li>
2074 <li>Removed bogus warnings about await on things other than
2075 Condition not being in a loop</li>
2076 <li>Fixed bug in OpcodeStack handling of dup2 of long/double
2077 values</li>
2078 <li>Don't report array types as missing classes</li>
2079 <li>Adjustment of some warnings on ignored return values</li>
2080 <li>Added thread safety annotations from Java Concurrency in
2081 Practice (no detectors written for these yet)</li>
2082 <li>Added annotation for methods that, if overridden, should
2083 be invoked by overriding methods via a call to super</li>
2084 <li>Updated -html:fancy.xsl (Etienne Giraudy)</li>
2085 </ul>
2086
2087 <p>Note: there was no version 0.9.2</p>
2088
2089 <p>Changes since version 0.9.1:</p>
2090 <ul>
2091 <!-- New detectors -->
2092 <li>Embellish USM to find abstract methods that implement an
2093 interface method (Dave Brosius)</li>
2094 <li>New detector to find stores of literal booleans inside if
2095 or while expressions (Dave Brosius)</li>
2096 <li>New style detector to find final classes that declare
2097 protected fields (Dave Brosius)</li>
2098 <li>New detector to find subclass methods that simply forward,
2099 verbatim, to the super class (Dave Brosius)</li>
2100 <li>Detector to find instances where code is attempting to
2101 write an object out via an implementation of DataOutput, but the
2102 object is not guaranteed to be Serializable (Jon Christiansen,
2103 Bill Pugh)</li>
2104
2105 <!-- Feature enhancements -->
2106 <li>Large (35%) analysis speedup (Bill Pugh)</li>
2107 <li>Add line numbers to Swing GUI code panel (Dave Brosius)</li>
2108 <li>Added effort options to Swing GUI (Dave Brosius)</li>
2109 <li>Add ability to specify bugs file to open from command line
2110 for GUI version, through -loadbugs (Phillip Martin)</li>
2111 <li>New stylesheet for generating HTML: use option <tt>-html:plain.xsl</tt>
2112 (Chris Nappin)
2113 </li>
2114 <li>New stylesheet for generating HTML: use option <tt>-html:fancy.xsl</tt>
2115 (Etienne Giraudy)
2116 </li>
2117 <li>Updated Japanese bug message translations (Shisei Hanai)</li>
2118
2119 <!-- Bug fixes -->
2120 <li>XHTML compliance fixes for bug details (Etienne Giraudy)</li>
2121 <li>Various detector fixes (Shisei Hanai)</li>
2122 <li>Fixed bugs in the project preferences dialog int the
2123 Eclipse plugin (Takashi Okamoto, Thomas Einwaller)</li>
2124 <li>Lowered priority of analysis thread in Swing GUI (David
2125 Hovemeyer, suggested by Shisei Hanai and Jeffrey W. Badorek)</li>
2126 <li>Fixed EclipsePlugin to correctly pick up auxclasspath
2127 entries (Jon Christiansen)</li>
2128 </ul>
2129
2130 <p>Changes since version 0.9.0:</p>
2131 <ul>
2132 <li>Fixed dependence on JRE 1.5: all features should work on
2133 JRE 1.4 again</li>
2134 <li>Fixed -effort command line option handling for Swing GUI</li>
2135 <li>Fixed conserveSpace and workHard attributes int Ant task</li>
2136 <li>Added support for effort attribute in Ant task</li>
2137 </ul>
2138
2139 <p>Changes since version 0.8.8:</p>
2140 <ul>
2141 <!-- New detectors and bug patterns -->
2142 <li>XMLFactoryBypass detector to find direct allocation of xml
2143 class implementations (Dave Brosius)</li>
2144 <li>InefficientMemberAccess detector to find accesses to
2145 owning class private members (Dave Brosius)</li>
2146 <li>DuplicateBranches detector checks switch statements too
2147 (Dave Brosius)</li>
2148
2149 <!-- Feature enhancements -->
2150 <li>FindBugs available from findbugs.sourceforge.net as Java
2151 Web Start application (Dave Brosius)</li>
2152 <li>Updated Japanese bug message translations (Shisei Hanai)</li>
2153 <li>Improved bug detail message for covariant equals() (Shisei
2154 Hanai)</li>
2155 <li>Modeling of instanceof checks is now enabled by default,
2156 making the bad cast detector much more useful (Bill Pugh, David
2157 Hovemeyer)</li>
2158 <li>Support for detector ordering constraints in plugin
2159 descriptor (David Hovemeyer)</li>
2160 <li>Simpler option to control analysis effort: -effort: <i>value</i>,
2161 where <i>value</i> is one of <code> min </code> , <code>
2162 default </code> , or <code> max </code> (David Hovemeyer)
2163 </li>
2164 <li>Using -effort:max, FindNullDeref checks for null arguments
2165 passed to methods which dereference them unconditionally (David
2166 Hovemeyer)</li>
2167 <li>FindNullDeref checks @Null and @NonNull annotations for
2168 parameters and return values (David Hovemeyer)</li>
2169
2170 <!-- Bug fixes -->
2171 </ul>
2172
2173 <p>Changes since version 0.8.7:</p>
2174
2175 <ul>
2176 <!-- New detectors and bug patterns -->
2177 <li>New detector to find duplicate code in if/else statements
2178 (Dave Brosius)</li>
2179 <li>Look for calls to wait() on Condition objects (David
2180 Hovemeyer)</li>
2181 <li>Look for java.util.concurrent.Lock objects not released on
2182 every path out of method (David Hovemeyer)</li>
2183 <li>Look for calls to Thread.sleep() with a lock held (David
2184 Hovemeyer)</li>
2185 <li>More accurate detection of impossible casts (Bill Pugh,
2186 David Hovemeyer)</li>
2187
2188 <!-- Feature enhancements -->
2189 <li>Saved XML now contains project statistics (Jay Dunning)</li>
2190 <li>Filter files can select by bug pattern type and warning
2191 priority (David Hovemeyer)</li>
2192
2193 <!-- Bug fixes -->
2194 <li>Restored some files inadvertently omitted from previous
2195 release (Rohan Lloyd, David Hovemeyer)</li>
2196 <li>Make sure detectors requiring JDK 1.5 runtime classes are
2197 only executed if those classes are available (David Hovemeyer)</li>
2198 <li>Don't display analysis error dialog unless there is really
2199 an error (David Hovemeyer)</li>
2200 <li>Updated and expanded French translations of bug patterns
2201 and Swing GUI (Olivier Parent)</li>
2202 <li>Fixed invalid character encoding in German Swing GUI
2203 translation (Olivier Parent)</li>
2204 <li>Fix locale used for date format in project stats (K.
2205 Hashimoto)</li>
2206 <li>Fixed LongDescription elements in xml:withMessages output
2207 format (K. Hashimoto)</li>
2208 </ul>
2209
2210 <p>Changes since version 0.8.6:</p>
2211
2212 <ul>
2213 <!-- new detectors -->
2214 <li>Extend Naming detector to look for classes that are named
2215 XXXException but that are not Exceptions (Dave Brosius)</li>
2216 <li>New detector to find classes that expose semaphores in the
2217 public implementation through the 'this' reference. (Dave Brosius)
2218 </li>
2219 <li>New Style detector to find Struts Action/Servlet derived
2220 classes that reference instance member variable not in
2221 synchronized blocks. (Dave Brosius)</li>
2222 <li>New Style detector to find classes that declare
2223 implementation of interfaces that are already implemented by super
2224 classes (Dave Brosius)</li>
2225 <li>New Style detector to find circular dependencies between
2226 classes (Dave Brosius)</li>
2227 <li>New Style detector to find unnecessary math on constants
2228 (Dave Brosius)</li>
2229 <li>New detector to find equality comparisons using floating
2230 point math (Jay Dunning)</li>
2231 <li>New faster detector to find local self assignments (Bill
2232 Pugh)</li>
2233 <li>New detector to find infinite recursive loops (Bill Pugh)
2234 </li>
2235 <li>New detector to find for loops with an incorrect increment
2236 (Bill Pugh)</li>
2237 <li>New detector to find suspicious uses of
2238 BufferedReader.readLine() and String.indexOf() (Bill Pugh)</li>
2239 <li>New detector to find suspicious integer to double casts
2240 (David Hovemeyer, Bill Pugh)</li>
2241 <li>New detector to find invalid regular expression patterns
2242 (Bill Pugh)</li>
2243 <li>New detector to find Bloch/Gafter Java puzzlers (Bill
2244 Pugh)</li>
2245
2246 <!-- feature enhancements -->
2247 <li>New system property to suppress reporting of DLS based on
2248 local variable name (Glenn Boysko)</li>
2249 <li>Enhancements to configuration dialog in Eclipse plugin,
2250 allow for saving enabled detectors in Eclipse projects (Phil
2251 Crosby)</li>
2252 <li>Sortable columns in detector dialog (Dave Brosius)</li>
2253 <li>New tab in gui for showing bugs grouped by category (Dave
2254 Brosius)</li>
2255 <li>Improved German translation of Swing GUI (Thomas Kuehne)</li>
2256 <li>Improved source file reporting in Emacs output format (Len
2257 Trigg)</li>
2258 <li>Improvements to redundant null comparison detector (Bill
2259 Pugh)</li>
2260 <li>Localization of run analysis and analysis error dialogs in
2261 Swing GUI (K. Hashimoto)</li>
2262
2263 <!-- Bug fixes -->
2264 <li>Don't scan equals methods in FindHEMismatch if code is
2265 native (Greg Bentz)</li>
2266 <li>French translation fixes (David Cotton)</li>
2267 <li>Internationalization report fixes (K. Hashimoto)</li>
2268 <li>Japanese translations updates (SHISEI Hanai)</li>
2269 </ul>
2270
2271 <p>Changes since version 0.8.5:</p>
2272 <ul>
2273 <!-- new detectors -->
2274 <li>New detector to find catch blocks that may inadvertently
2275 catch runtime exceptions (Brian Goetz)</li>
2276 <li>New detector to find objects that are instantiated based
2277 on classes that only have static methods and fields, using the
2278 synthesized constructor (Dave Brosius)</li>
2279 <li>New detector to find calls to Thread.interrupted() in a
2280 non static context, and especially with non currentThread()
2281 threads (Dave Brosius)</li>
2282 <li>New detector to find calls to equals() methods that use
2283 Object's version. (Dave Brosius)</li>
2284 <li>New detector to find Applets that call methods in the
2285 constructor refering to the AppletStub (Dave Brosius)</li>
2286 <li>New detector to find some cases of infinite recursion
2287 (Bill Pugh)</li>
2288 <li>New detector to find dead stores to local variables (David
2289 Hovemeyer, Bill Pugh)</li>
2290 <li>Extend Dumb Method detector for toUpperCase(),
2291 toLowerCase() without a locale, new Integer(1).toString(), new
2292 XXX().getClass(), and new Thread() without a run implementation
2293 (Dave Brosius) <!-- feature enhancements -->
2294 </li>
2295 <li>Ant task supports "errorProperty" attribute, which sets an
2296 Ant property to "true" if an error occurs running FindBugs
2297 (Michael Tamm)</li>
2298 <li>Eclipse plugin allows filtering of warnings by bug
2299 category, priority (David Hovemeyer)</li>
2300 <li>Swing GUI allows filtering of warnings by bug category
2301 (David Hovemeyer)</li>
2302 <li>Ability to annotate methods using Java 1.5 annotations
2303 that suppress FindBugs warnings (Bill Pugh)</li>
2304 <li>New -adjustExperimental for lowering priority of
2305 BugPatterns that are experimental (Dave Brosius)</li>
2306 <li>Allow for command line options 'files' using the @ symbol
2307 (David Hovemeyer)</li>
2308 <li>New -adjustPriority command line option to for adjusting
2309 bug priorites (David Hovemeyer)</li>
2310 <li>Added an Edit menu (cut/copy/paste) to Swing GUI (Dave
2311 Brosius)</li>
2312 <li>French translation supplied (David Cotton) <!-- Bug fixes -->
2313 </li>
2314 </ul>
2315
2316 <p>Changes since version 0.8.4:</p>
2317 <ul>
2318 <!-- new detectors -->
2319 <li>New detector for volatile references to arrays (Bill Pugh)
2320 </li>
2321 <li>New detector to find instanceof usage where inheritance
2322 can be determined statically (Dave Brosius)</li>
2323 <li>New detector to find ResultSet.getXXX updateXXX calls
2324 using index 0 (Dave Brosius)</li>
2325 <li>New detector to find empty zip or jar entries (Bill Pugh)
2326
2327 <!-- feature enhancements -->
2328 </li>
2329 <li>HTML output generation using built-in XSLT stylesheet or
2330 user-defined stylesheet (David Hovemeyer)</li>
2331 <li>Allow URLs to be specified to analyze zip/jar files, local
2332 directories, and single classfiles (David Hovemeyer)</li>
2333 <li>New command line option -onlyAnalyze restricts analysis to
2334 selected classes and packages without reducing accuracy (David
2335 Hovemeyer)</li>
2336 <li>Allow Swing GUI to show source code in jar files on
2337 Windows systems (Dave Brosius) <!-- Bug fixes -->
2338 </li>
2339 <li>Fix the Switch Fall Thru detector (Dave Brosius, David
2340 Hovemeyer, Bill Pugh)</li>
2341 <li>MacOS GUI fixes (Rohan Lloyd)</li>
2342 <li>Fix false positive in BOA in case where method is
2343 correctly and 'incorrectly' overridden (Dave Brosius)</li>
2344 <li>Fixed memory blowup when analyzing methods which access a
2345 large number of fields (David Hovemeyer)</li>
2346 </ul>
2347
2348 <p>Changes since version 0.8.3:</p>
2349 <ul>
2350 <li>Initial and preliminary localization of the Swing
2351 GUI.&nbsp; Translations by:
2352 <ul>
2353 <li>German - Peter D. Stout, Holger Stenzhorn</li>
2354 <li>Finnish - Juha Knuutila</li>
2355 <li>Estonian - Tanel Lebedev</li>
2356 <li>Japanese - Hanai Shisei</li>
2357 </ul>
2358 </li>
2359 <li>Eliminated debug print statements inadvertently left
2360 enabled</li>
2361 <li>Reverted some changes in the open stream detector: this
2362 should fix some false positives that were introduced in the
2363 previous release</li>
2364 <li>Fixed a couple missing class reports</li>
2365 </ul>
2366
2367 <p>Changes since version 0.8.2:</p>
2368 <ul>
2369
2370 <!-- New detectors -->
2371 <li>New detector to find improperly overridden GUI Adapter
2372 classes (Dave Brosius)</li>
2373 <li>New detector to find improperly setup JUnit TestCases
2374 (Dave Brosius)</li>
2375 <li>New detector to find variables that mask class level
2376 fields (Dave Brosius)</li>
2377 <li>New detector to find comparisons of values computed with
2378 bitwise operators that always yield the same result (Tom Truscott)
2379 </li>
2380 <li>New detector to find unsafe getClass().getResource() calls
2381 (Bill Pugh)</li>
2382 <li>New detector to find GUI changes not in GUI thread but in
2383 static main (Bill Pugh)</li>
2384 <li>New detector to find calls to Collection.toArray() with
2385 zero-length array argument; it is more efficient to pass an array
2386 the size of the collection, which can be populated and returned as
2387 the result (Dave Brosius) <!-- Analysis improvements -->
2388 </li>
2389 <li>Better suppression of false warnings in various detectors
2390 (Bill Pugh, David Hovemeyer)</li>
2391 <li>Enhancement to ReadReturnShouldBeChecked detector for
2392 skip() (Dave Brosius)</li>
2393 <li>Enhancement to DumbMethods detector (Dave Brosius)</li>
2394 <li>Open stream detector does not report wrappers of streams
2395 passed as method parameters (David Hovemeyer) <!-- Feature enhancements -->
2396 </li>
2397 <li>Cancel confirmation dialog in Swing GUI (Pete Angstadt)</li>
2398 <li>Better relative path saving in Project file (Dave Brosius)
2399 </li>
2400 <li>Detector Priority in GUI is now saved in prefs file (Dave
2401 Brosius)</li>
2402 <li>Controls in GUI to reorder source and classpath entries,
2403 and ability to flip between Project details and bugs pages (Dave
2404 Brosius)</li>
2405 <li>In Swing GUI, analysis error dialog supports "Select All"
2406 and "Copy" operations for easy generation of error reports (Dave
2407 Brosius)</li>
2408 <li>Complete translation of bug descriptions and messages into
2409 Japanese (Hanai Shisei) <!-- Bug fixes -->
2410 </li>
2411 <li>Fixed bug in DroppedException detector (Dave Brosius) <!-- Development stuff -->
2412 </li>
2413 <li>The source distribution defaults to using JDK 1.5 javac to
2414 compile, but support for compiling with JSR-14 prototype is still
2415 supported</li>
2416 </ul>
2417
2418 <p>Changes since version 0.8.1:</p>
2419 <ul>
2420 <li>Fixed a critical ClassCastException bug (triggered if the
2421 -workHard option was used, and an exception type was merged with
2422 an array type during type inference)</li>
2423 </ul>
2424
2425 <p>Changes since version 0.8.0:</p>
2426 <ul>
2427 <li>Disabled SwitchFallthrough detector to work around
2428 NullPointerExceptions</li>
2429 <li>Added some additional false positive suppression
2430 heuristics</li>
2431 </ul>
2432
2433 <p>Also, two contributors to the 0.8.0 release were
2434 inadvertently left out of the credits:</p>
2435 <ul>
2436 <li>Pete Angstadt fixed several problems in the Swing GUI</li>
2437 <li>Francis Lalonde provided a task resource file for the
2438 FindBugs Ant task</li>
2439 </ul>
2440
2441 <p>Changes since version 0.7.4:</p>
2442 <ul>
2443 <li>New detector to look for uses of "+" operator to
2444 concatenate String objects in a loop (Dave Brosius)</li>
2445 <li>Reference comparison detector looks for places where the
2446 argument passed to the equals(Object) method isn't the same type
2447 as the receiver object</li>
2448 <li>Better suppression of false warnings in many detectors</li>
2449 <li>Many improvements to Eclipse plugin (Andrey Loskutov,
2450 Peter Friese)</li>
2451 <li>Fixed problem with building Eclipse plugin on Windows
2452 (Thomas Klaeger)</li>
2453 <li>Open stream detector looks for unclosed PreparedStatement
2454 objects (Thomas Klaeger, Rohan Lloyd)</li>
2455 <li>Fix for open stream detector: it wasn't detecting close()
2456 methods called through an invokeinterface instruction (Thomas
2457 Klaeger)</li>
2458 <li>Refactoring of visitor classes to enforce use of accessors
2459 for visited class features (Brian Goetz)</li>
2460 </ul>
2461
2462 <p>Changes since version 0.7.3:</p>
2463 <ul>
2464 <li>Experimental modification of open stream detector to look
2465 for non-escaping JDBC resources (connections and statements) that
2466 aren't closed on all paths out of method</li>
2467 <li>Eclipse plugin fixed so it compiles and runs on Eclipse
2468 2.1.x (Peter Friese)</li>
2469 <li>Option to Swing GUI and command line to generate project
2470 file using relative paths for archives, source directories, and
2471 aux classpath entries (Dave Brosius)</li>
2472 <li>Improvements to findbugs.bat script for launching FindBugs
2473 on Windows (Dave Brosius)</li>
2474 <li>Updated Japanese message translations (Hiroshi Okugawa)</li>
2475 <li>Uncalled private methods are now reported as low priority,
2476 unless they have the same name as another method in the class
2477 (which is more likely to indicate an actual bug)</li>
2478 <li>Added some missing data in the bug messages XML files</li>
2479 <li>Fixed some problems building from source on Windows
2480 systems</li>
2481 <li>Various minor bug fixes</li>
2482 </ul>
2483
2484 <p>Changes since version 0.7.2:</p>
2485 <ul>
2486 <li>Enhanced Eclipse plugin, which displays the detailed bug
2487 description in a view (Phil Crosby)</li>
2488 <li>Various tweaks to existing detectors to reduce false
2489 warnings</li>
2490 <li>New command line option <code> -workHard </code> enables
2491 pruning of infeasible or unlikely exception edges, which results
2492 in better accuracy in the open stream detector, at the expense of
2493 a 30%-100% slowdown
2494 </li>
2495 <li>New website and HTML documentation design</li>
2496 <li>Documentation includes an HTML document with descriptions
2497 of all bug patterns reported by FindBugs</li>
2498 <li>Web page has a link to a <a
2499 href="http://www.simeji.com/findbugs/doc/manual_ja/index.html">Japanese
2500 translation</a> of the FindBugs manual, contributed by Hiroshi
2501 Okugawa
2502 </li>
2503 <li>Changed the Inconsistent Synchronization detector so that
2504 fields synchronized 50% of the time (or more) are reported as
2505 medium priority bugs (previously they were reported as low)</li>
2506 <li>New detector to find code that catches
2507 IllegalMonitorStateException</li>
2508 <li>New detector to find private methods that are never called
2509 </li>
2510 <li>New detector to find suspicious uses of
2511 non-short-circuiting boolean operators ( <code> &amp; </code> and
2512 <code> | </code> , rather than <code> &amp;&amp; </code> and <code>
2513 || </code> )
2514 </li>
2515 </ul>
2516
2517 <p>Changes since version 0.7.1:</p>
2518 <ul>
2519 <li>Incorporated patched version of BCEL, which allows classes
2520 compiled with JDK 1.5.0 beta to be analyzed</li>
2521 <li>Fixed some bugs related to lookups of array classes</li>
2522 <li>Fixed bug that prevented GUI from loading XML result files
2523 when running under JDK 1.5.0 beta</li>
2524 <li>Added new experimental bug detector, LazyInit, which looks
2525 for potentially buggy lazy initializations of static fields</li>
2526 <li>Because of long filenames, switched to distributing the
2527 source archive as a zip file rather than a tar file</li>
2528 <li>The 0.7.1 source tarfile was botched - 0.7.2 has a valid
2529 source archive</li>
2530 <li>Fixed some problems in the Ant build script</li>
2531 <li>Fixed NullPointerException when checking Class-Path
2532 attribute for Jar files without manifests</li>
2533 <li>Generate version numbers for the core and UI Eclipse
2534 plugins using the Version class; all version numbers are now in a
2535 common location</li>
2536 </ul>
2537
2538 <p>Changes since version 0.7.0:</p>
2539 <ul>
2540 <li>Eclipse plugin (contributed by Peter Friese)</li>
2541 <li>Source package structure rearranged: all source (other
2542 than Eclipse plugin UI) is in the edu.umd.cs.findbugs package, or
2543 a subpackage</li>
2544 <li>Class-Path attributes of manifests of analyzed jar files
2545 are used to set the aux classpath automatically (Peter D. Stout)</li>
2546 <li>GUI starts in directory specified by user.home property
2547 (Peter D. Stout)</li>
2548 <li>Added -project option to GUI (Mikko T.)</li>
2549 <li>Added -look:{plastic,gtk,native} option to GUI, for
2550 setting look and feel (Mikko T.)</li>
2551 <li>Fixed DataflowAnalysisException in inconsistent
2552 synchronization detector</li>
2553 <li>Ant task supports failOnError parameter (Rohan Lloyd)</li>
2554 <li>Serializable class warnings are downgraded to low priority
2555 for GUI classes</li>
2556 <li>MWN detector will only report calls to wait(), notify(),
2557 and notifyAll() methods that have the correct signature</li>
2558 <li>FindBugs works with latest CVS version of BCEL</li>
2559 <li>Zip and Jar files may be added to the source path</li>
2560 <li>The GUI will automatically find source files residing in
2561 analyzed Zip or Jar files</li>
2562 </ul>
2563
2564 <p>Note that the version number jumped from 0.6.6 to 0.6.9;
2565 there were no 0.6.7 or 0.6.8 releases.</p>
2566 <p>Changes since version 0.6.9:</p>
2567 <ul>
2568 <li>Added -conserveSpace option to reduce memory use at the
2569 expense of analysis precision</li>
2570 <li>Bug fixes in findbugs.bat script: JAVA_HOME handling,
2571 autodetection of FINDBUGS_HOME, missing output with -textui</li>
2572 <li>Fixed NullPointerException when a missing class is
2573 encountered</li>
2574 </ul>
2575
2576 <p>Changes since version 0.6.6:</p>
2577 <ul>
2578 <li>The null pointer dereference detector is more powerful</li>
2579 <li>Significantly improved heuristics and bug fixes in
2580 inconsistent synchronization detector</li>
2581 <li>Improved heuristics in open stream and dropped exception
2582 detectors; fewer false positives should be reported</li>
2583 <li>Save HTML summary in XML results files, rather than
2584 recomputing; this makes loading results in GUI much faster</li>
2585 <li>Report at most one String comparison using == or != per
2586 method</li>
2587 <li>The findbugs.bat script on Windows autodetects
2588 FINDBUGS_HOME, and doesn't open a DOS window when launching the
2589 GUI (contributed by TJSB)</li>
2590 <li>Emacs reporting format (contributed by David Li)</li>
2591 <li>Various bug fixes</li>
2592 </ul>
2593
2594 <p>Changes since 0.6.5:</p>
2595 <ul>
2596 <li>Rewritten inconsistent synchronization detector; accuracy
2597 is significantly improved, and bug reports are prioritized</li>
2598 <li>New detector to find self assignment (x=x) of local
2599 variables (suggested by Jeff Martin)</li>
2600 <li>New detector to find calls to wait(), notify(), and
2601 notifyAll() on an object which is not obviously locked</li>
2602 <li>Open stream detector now reports Readers and Writers</li>
2603 <li>Fixed bug in finalizer idioms detector which caused
2604 spurious warnings about failure to call super.finalize() (reported
2605 by Jim Menard)</li>
2606 <li>Fixed bug where output stream was not closed using non-XML
2607 output (reported by Sigiswald Madou)</li>
2608 <li>Fixed corrupted HTML bug detail message (reported by
2609 Trevor Harmon)</li>
2610 </ul>
2611
2612 <p>Changes since version 0.6.4:</p>
2613 <ul>
2614 <li>For redundant comparison of reference values, fixed false
2615 positives resulting from duplication of code in finally blocks</li>
2616 <li>Fixed false positives resulting from wrapped byte array
2617 streams left open</li>
2618 <li>Fixed bug in Ant task preventing output file from working
2619 properly if a relative path was used</li>
2620 </ul>
2621
2622 <p>Changes since version 0.6.3:</p>
2623 <ul>
2624 <li>Fixed bug in Ant task where output would be corrupted, and
2625 added a <code> timeout </code> attribute
2626 </li>
2627 <li>Added -outputFile option to text UI, for explicitly
2628 specifying an output file</li>
2629 <li>GUI has a summary window, for statistics about overall bug
2630 densities (contributed by Mike Fagan)</li>
2631 <li>Find redundant comparisons of reference values</li>
2632 <li>More accurate detection of Strings compared with == and !=
2633 operators</li>
2634 <li>Detection of other reference types which should generally
2635 not be compared with == and != operators; Boolean, Integer, etc.</li>
2636 <li>Find non-transient non-serializable instance fields in
2637 Serializable classes</li>
2638 <li>Source code may be compiled with latest early access
2639 generics-enabled javac (version 2.2)</li>
2640 </ul>
2641
2642 <p>Changes since version 0.6.2:</p>
2643 <ul>
2644 <li>GUI supports filtering bugs by priority</li>
2645 <li>Ant task rewritten; supports all functionality offered by
2646 Text UI (contributed by Mike Fagan)</li>
2647 <li>Ant task is fully documented in the manual</li>
2648 <li>Classes in nested archives are analyzed; this allows full
2649 support for analyzing .ear and .war files (contributed by Mike
2650 Fagan)</li>
2651 <li>DepthFirstSearch changed to use non-recursive
2652 implementation; this should fix the StackOverflowErrors that
2653 several users reported</li>
2654 <li>Various minor bugfixes and improvements</li>
2655 </ul>
2656
2657 <p>Changes since version 0.6.1:</p>
2658 <ul>
2659 <li>New detector to look for useless control flow (suggested
2660 by Richard P. King and Mike Fagan)</li>
2661 <li>Look for places where return value of
2662 java.io.File.createNewFile() is ignored (suggested by Richard P.
2663 King)</li>
2664 <li>Fixed bug in resolution of source files (only the first
2665 source directory was searched)</li>
2666 <li>Fixed a NullPointerException in the bytecode pattern
2667 matching code</li>
2668 <li>Ant task supports project files (contributed by Mike
2669 Fagan)</li>
2670 <li>Unix findbugs script honors the <code> JAVA_HOME </code>
2671 environment variable (contributed by Pedro Morais)
2672 </li>
2673 <li>Allow .war and .ear files to be analyzed</li>
2674 </ul>
2675
2676 <p>Changes since version 0.6.0:</p>
2677 <ul>
2678 <li>New bug pattern detector which looks for places where a
2679 null pointer might be dereferenced</li>
2680 <li>New bug pattern detector which looks for IO streams that
2681 are opened, do not escape the method, and are not closed on all
2682 paths out of the method</li>
2683 <li>New bug pattern detector to find methods that can return
2684 null instead of a zero-length array</li>
2685 <li>New bug pattern detector to find places where the == or !=
2686 operators are used to compare String objects</li>
2687 <li>Command line interface can save bugs as XML</li>
2688 <li>GUI can save bugs to and load bugs from XML</li>
2689 <li>An "Annotations" window in the GUI allows the user to add
2690 textual annotations to bug reports; these annotations are
2691 preserved when bugs are saved as XML</li>
2692 <li>In this release, the Japanese bug summary translations by
2693 Germano Leichsenring are really included (they were inadvertently
2694 omitted in the previous release)</li>
2695 <li>Completely rewrote the control flow graph builder,
2696 hopefully for the last time</li>
2697 <li>Simplified implementation of control flow graphs, which
2698 should reduce memory use and possibly improve performance</li>
2699 <li>Improvements to command line interface (list bug
2700 priorities, filter by priority, specify aux classpath, specify
2701 project to analyze)</li>
2702 <li>Various bug fixes and enhancements</li>
2703 </ul>
2704
2705 <p>Changes since version 0.5.4</p>
2706 <ul>
2707 <li>Added an <a href="http://ant.apache.org/">Ant</a> task for
2708 FindBugs, contributed by Mike Fagan.
2709 </li>
2710 <li>Added a GUI dialog which allows individual bug pattern
2711 detectors to be enabled or disabled.&nbsp; Disabling certain slow
2712 detectors can greatly speed up analysis of large programs, at the
2713 expense of reducing the number of potential bugs found.</li>
2714 <li>Added a new detector for finding improperly ignored return
2715 values for methods such as <code> String.trim() </code> .&nbsp;
2716 Suggested by Andreas Mandel.
2717 </li>
2718 <li>Japanese translations of the bug summaries, contributed by
2719 Germano Leichsenring.</li>
2720 <li>Filtering of results is supported in command line
2721 interface. See the <a href="manual/index.html">FindBugs manual</a>
2722 for details.
2723 </li>
2724 <li>Added "byte code patterns", a general pattern matching
2725 infrastructure for bytecode instructions.&nbsp; This feature
2726 significantly reduces the complexity of implementing new bug
2727 pattern detectors.</li>
2728 <li>Enabled a new general dataflow analysis to track values in
2729 methods.</li>
2730 <li>Switched to new control-flow graph builder implementation.
2731 </li>
2732 </ul>
2733
2734 <p>Changes since version 0.5.3</p>
2735 <ul>
2736 <li>Fixed a bug in the script used to launch FindBugs on
2737 Windows platforms.</li>
2738 <li>Fixed crashes when analyzing class files without source
2739 line information.</li>
2740 <li>All major errors are reported using an error dialog; file
2741 not found errors are more informative.</li>
2742 <li>Minor GUI improvements.</li>
2743 </ul>
2744
2745 <p>Changes since version 0.5.2</p>
2746 <ul>
2747 <li>All of the source code and related files are in a single
2748 directory tree.</li>
2749 <li>Updated some of the detectors to produce source line
2750 information.</li>
2751 <li><a href="http://ant.apache.org/">Ant</a> build script and
2752 several GUI enhancements and fixes contributed by Mike Fagan.</li>
2753 <li>Converted to use a <a href="AddingDetectors.txt">plugin
2754 architecture</a> for loading bug detectors.
2755 </li>
2756 <li>Eliminated generics-related compiler warnings.</li>
2757 <li>More complete documentation has been added.</li>
2758 </ul>
2759
2760 <p>Changes since version 0.5.1:</p>
2761 <ul>
2762 <li>Fixed a large number of bugs in the BCEL Repository and
2763 FindBugs's use of the Repository.&nbsp; With these changes,
2764 FindBugs should <em>never</em> crash or otherwise misbehave
2765 because of Repository lookup failures.&nbsp; Because of these
2766 changes, you must use a modified version of <code> bcel.jar
2767 </code> with FindBugs.&nbsp; This jar file is included in the FindBugs
2768 0.5.2 binary release.&nbsp; A complete patch containing the <a
2769 href="http://faculty.ycp.edu/~dhovemey/bcel-30-April-2003.patch">modifications
2770 against the BCEL CVS main branch as of April 30, 2003</a> is also
2771 available.
2772 </li>
2773 <li>Implemented the "auxiliary classpath entry list".&nbsp;
2774 Aux classpath entries can be added to a project to provide classes
2775 that are referenced by the analyzed application, but should not
2776 themselves be analyzed.&nbsp; Having all referenced classes
2777 available allows FindBugs to produce more accurate results.</li>
2778 </ul>
2779
2780 <p>Changes since version 0.5.0:</p>
2781 <ul>
2782 <li>Many user interface bugs have been fixed.</li>
2783 <li>Upgraded to a recent CVS version of BCEL, with some bug
2784 fixes.&nbsp; This should prevent FindBugs from crashing when there
2785 is a failure to find a class on the classpath.</li>
2786 <li>Added support for Plastic look and feel from <a
2787 href="http://www.jgoodies.com/">jgoodies.com</a>.
2788 </li>
2789 <li>Major overhaul of infrastructure for doing dataflow
2790 analysis.</li>
2791 </ul>
2792 <hr> <p>
2793 <script language="JavaScript" type="text/javascript">
2794 <!---//hide script from old browsers
2795 document.write( "Last updated "+ document.lastModified + "." );
2796 //end hiding contents --->
2797 </script>
2798 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
2799 <p>
2800 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
2801
2802 </td>
2803
2804 </tr>
2805 </table>
2806
2807 </body>
2808
2809 </html>
+0
-261
doc/FAQ.html less more
0 <html>
1 <head>
2 <title>FindBugs FAQ</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6
7 <body>
8
9 <table width="100%"><tr>
10
11
12 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
13 <table width="100%" cellspacing="0" border="0">
14 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
15
16 <tr><td>&nbsp;</td></tr>
17
18 <tr><td><b>Docs and Info</b></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
30 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
31
32 <tr><td>&nbsp;</td></tr>
33
34 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
35
36 <tr><td>&nbsp;</td></tr>
37
38 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
39
40 <tr><td>&nbsp;</td></tr>
41
42 <tr><td><b>Development</b></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
51 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
52 </table>
53 </td>
54
55 <td>
56 <h1>FindBugs FAQ</h1>
57
58 <p> This document contains answers to frequently asked questions about
59 <a href="index.html">FindBugs</a>.&nbsp; If you just want general
60 information about FindBugs, have a look at the
61 <a href="factSheet.html">fact sheet</a> and the
62 <a href="manual/index.html">manual</a>.
63
64 <h2>Contents</h2>
65 <ol>
66 <li> <a href="#q1">I'm getting java.lang.UnsupportedClassVersionError when I try to run FindBugs</a>
67 <li> <a href="#q2">When I click the "Find Bugs!" button, I get a NoSuchMethodError or VerifyError</a>
68 <li> <a href="#q3">FindBugs is running out of memory, or is taking a long time to finish</a>
69 <li> <a href="#q4">What is the "auxiliary classpath"? Why should I specify it?</a>
70 <li> <a href="#q5">The Eclipse plugin doesn't load</a>
71 <li> <a href="#q6">I'm getting a lot of false "OS" and "ODR" warnings</a>
72 <li> <a href="#q7">The Eclipse plugin loads, but doesn't work correctly</a>
73 <li> <a href="#q8">Where is the Maven plugin for FindBugs?</a>
74 <li> <a href="#q9">Where is the NetBeans plugin for FindBugs?</a>
75 </ol>
76
77 <h2><a name="q1">Q1: I'm getting java.lang.UnsupportedClassVersionError when I try to run FindBugs</a></h2>
78
79 <p> FindBugs requires JRE 1.5.0 or later to run.&nbsp; If you use an earlier version,
80 you will see an exception error message similar to the following:
81 <pre>
82 Exception in thread "main" java.lang.UnsupportedClassVersionError:
83 edu/umd/cs/findbugs/gui/FindBugsFrame (Unsupported major.minor version 48.0)
84 </pre>
85 The solution is to upgrade to JRE 1.5.0 or later.
86
87 <h2><a name="q2">Q2: When I click the "Find Bugs!" button, I get a NoSuchMethodError or VerifyError</a></h2>
88
89 <p> The symptom of this bug is that when you start the FindBugs analysis,
90 you see an exception similar to the following:
91 <pre>
92 java.lang.NoSuchMethodError: org.apache.bcel.Repository.setRepository(Lorg/apache/bcel/util/Repository;)V
93 at edu.umd.cs.findbugs.FindBugs.clearRepository(FindBugs.java:483)
94 ...
95 </pre>
96
97 or
98
99 <pre>
100 java.lang.VerifyError: Cannot inherit from final class
101 at java.lang.ClassLoader.defineClass0(Native Method)
102 at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
103 ...
104 </pre>
105
106 <p> The problem here is that the wrong version of the
107 <a href="http://jakarta.apache.org/bcel/">Apache BCEL</a>
108 library is being found.&nbsp; FindBugs requires its own
109 version of BCEL, which normally will be used automatically
110 when you invoke the <code>findbugs</code> or <code>findbugs.bat</code>
111 scripts used to launch FindBugs.&nbsp; If an old version of BCEL is installed
112 in a location, such as "lib/endorsed" in the JRE installation,
113 where it overrides classes on the application classpath,
114 FindBugs will not execute properly.&nbsp;
115 We know of several reasons this could happen
116
117 <ul>
118 <li> If you install the
119 <a href="http://java.sun.com/webservices/downloads/webservicespack.html">Java(TM) Web Services
120 Developer Pack 1.2</a>
121 in the <code>lib/endorsed</code> directory of your Java Runtime Environment (JRE).&nbsp;
122 The file <code>xsltc.jar</code> contains an old version of BCEL that is incompatible with
123 FindBugs.&nbsp;
124
125 <li> Another possibility is that you are using the IBM JDK.&nbsp;
126 Some versions include a version of BCEL which conflicts with the
127 one required by FindBugs.&nbsp; This problem is fixed in version 1.4.1 SP1,
128 so upgrading your JDK should allow FindBugs to run correctly.
129
130 <li> Some versions of the Apache Xalan XSLT processor include
131 an old version of BCEL in <code>xalan.jar</code>.
132
133 </ul>
134
135 <p> In all of these cases, you should be able to run FindBugs
136 by either removing the offending version of BCEL from your JRE,
137 or installing a clean JRE or JDK and using that to run FindBugs.
138
139 <p> Many thanks to Peter Meulmeester, Michael Levi, and Thomas Klaeger
140 for providing information on this problem.
141
142 <h2><a name="q3">Q3: FindBugs is running out of memory, or is taking a long time to finish</a></h2>
143
144 <p> In general, FindBugs requires lots of memory and a relatively
145 fast CPU. For large applications, 512M or more of heap space may be
146 required. By default, FindBugs allocates 256M of heap space.
147 You can increase this using the <code>-maxHeap <i>n</i></code> option,
148 where <i>n</i> is the number of megabytes of heap space to allocate.
149
150
151 <h2><a name="q4">Q4: What is the "auxiliary classpath"? Why should I specify it?</a></h2>
152
153 <p> Many important facts about a Java class require information about
154 the classes that it references.&nbsp; For example:
155 <ul>
156 <li> What other classes and interfaces the class inherits from
157 <li> What exceptions can be thrown by methods in external classes
158 and interfaces
159 </ul>
160
161 <p> The "auxiliary classpath" is a list of Jar files, directories, and
162 class files containing classes that are <em>used</em> by the code you
163 want FindBugs to analyze, but should not themselves be analyzed
164 by FindBugs.
165
166 <p> If FindBugs doesn't have complete information about referenced classes,
167 it will not be able to produce results that are as accurate as possible.&nbsp;
168 For example, having a complete repository of referenced classes allows
169 FindBugs to prune control flow information so it can concentrate on
170 paths through methods that are most likely to be feasible at runtime.&nbsp;
171 Also, some bug detectors (such as the suspicious reference comparison detector)
172 rely on being able to perform type inference, which requires complete
173 type hierarchy information.
174
175 <p> For these reasons, we strongly recommend that you completely specify
176 the auxiliary classpath when you run FindBugs.&nbsp; You can do this
177 by using the <code>-auxclasspath</code> command line option, or the
178 "Classpath entries" list in the GUI project editor dialog.
179
180 <p> If FindBugs cannot find a class referenced by your application, it
181 will print out a message when the analysis completes, specifying the
182 classes that were missing.&nbsp; You should modify the auxiliary classpath
183 to specify how to find the missing classes, and then run FindBugs again.
184
185 <h2><a name="q5">Q5: The Eclipse plugin doesn't load</a></h2>
186
187 <p> The symptom of this problem is that Eclipse fails to load
188 the FindBugs UI plugin with the message:
189 <blockquote>
190 Plug-in "edu.umd.cs.findbugs.plugin.eclipse" was disabled due to missing or disabled
191 prerequisite plug-in "org.eclipse.ui.ide"
192 </blockquote>
193
194 <p> The reason for this problem is that the Eclipse
195 plugin distributed with FindBugs
196 does not work with older 3.x versions of Eclipse.
197 Please use Eclipse version 3.6 (June 2010) or newer.
198
199 <h2><a name="q6">Q6: I'm getting a lot of false "OS" and "ODR" warnings</a></h2>
200
201 <p> By default, FindBugs assumes that any method invocation can
202 throw an unchecked runtime exception.&nbsp; As a result,
203 it may assume that an unchecked exception thrown out of the
204 method could bypass a call to a <code>close()</code> method
205 for a stream or database resource.
206
207 <p> You can use the <code>-workHard</code> command line argument
208 or the <code>findbugs.workHard</code> boolean analysis property
209 to make FindBugs work harder to prune unlikely exception
210 edges.&nbsp; This generally reduces the number of
211 false warnings, at the expense of slowing down the
212 analysis.
213
214 <h2><a name="q7">Q7: The Eclipse plugin loads, but doesn't work correctly</a></h2>
215
216 <p> Make sure the Java code you trying to analyze is built properly and has no
217 classpath or compile errors.
218
219 <p> Make sure the project and workspace FindBugs settings are valid - in doubt, revert them to defaults.
220
221 <p> Make sure the Error log view does not show errors.
222
223 <h2><a name="q8">Q8: Where is the Maven plugin for FindBugs?</a></h2>
224
225 <p>
226 The <a href="http://maven.apache.org/">Maven</a> Plugin for FindBugs
227 may be found <a href="http://mojo.codehaus.org/findbugs-maven-plugin/">here</a>.&nbsp;
228 Please note that the Maven plugin is not maintained by the FindBugs developers,
229 so we can't answer questions about it.
230 </p>
231
232 <h2><a name="q9">Q9: Where is the NetBeans plugin for FindBugs?</a></h2>
233
234 <p>We recommend <a href="http://kenai.com/projects/sqe/pages/Home">SQE: Software Quality Environment</a>
235 which bundles FindBugs, PMD and CheckStyle. Use the following
236 update site:
237 <a href="http://deadlock.netbeans.org/hudson/job/sqe/lastStableBuild/artifact/build/full-sqe-updatecenter/updates.xml
238 ">http://deadlock.netbeans.org/hudson/job/sqe/lastStableBuild/artifact/build/full-sqe-updatecenter/updates.xml</a>
239 <p>Pease note that the SQE plugin is not maintained by the FindBugs developers,
240 so we can't answer questions about it.
241 </p>
242
243
244 <hr> <p>
245 <script language="JavaScript" type="text/javascript">
246 <!---//hide script from old browsers
247 document.write( "Last updated "+ document.lastModified + "." );
248 //end hiding contents --->
249 </script>
250 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
251 <p>
252 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
253
254 </td>
255
256 </table>
257
258 </body>
259
260 </html>
+0
-125
doc/FilterFile.txt less more
0 =============
1 How it works:
2 =============
3
4 A filter file is an XML file with a top-level "FindBugsFilter" element
5 which has some number of "Match" elements as children. Each Match
6 element represents a predicate which is applied to generated bug instances.
7 Usually, a filter will be used to exclude bug instances. For example:
8
9 findbugs -textui -exclude myExcludeFilter.xml myApp.jar
10
11 However, a filter could also be used to select bug instances to specifically
12 report:
13
14 findbugs -textui -include myIncludeFilter.xml myApp.jar
15
16 Match has "class" and "classregex" attributes specifying what class or classes
17 the predicate applies to.
18
19 Match contains children, which are conjuncts of the predicate.
20 (I.e., each of the children must be true for the predicate to be true.)
21
22 =======================
23 Types of Match clauses:
24 =======================
25
26 <BugCode> specifies abbreviations of bugs.
27 The "name" attribute is a comma-seperated list of abbreviations.
28
29 <Method> specifies a method. The "name" attribute is the name
30 of the method. The "params" attribute is a comma separated list
31 of the types of the method's parameters. The "returns" attribute is
32 the method's return type. In "params" and "returns", class names
33 must be fully qualified. (E.g., "java.lang.String" instead of just
34 "String".) Note that "params" and "returns" are optional; you can
35 just specify "name", and the clause will match all methods with
36 that name. However, if you specify either "params" or "returns",
37 you must specify both of them.
38
39 <Or> combines Match clauses as disjuncts. I.e., you can put two
40 "Method" elements in an Or clause in order match either method.
41
42 ========
43 Caveats:
44 ========
45
46 Match clauses can only match information that is actually contained in the
47 bug instances. Every bug instance has a class, so in general, excluding
48 bugs by class will work.
49
50 Some bug instances have two classes. For example, the DE (dropped exception)
51 bugs report both the class containing the method where the dropped exception
52 happens, and the class which represents the type of the dropped exception.
53 Only the FIRST (primary) class is matched against Match clauses.
54 So, for example, if you want to suppress IC (initialization circularity)
55 reports for classes "com.foobar.A" and "com.foobar.B", you would use
56 two Match clauses:
57
58 <Match class="com.foobar.A">
59 <BugCode name="IC" />
60 </Match>
61
62 <Match class="com.foobar.B">
63 <BugCode name="IC" />
64 </Match>
65
66 Many kinds of bugs report what method they occur in. For those bug instances,
67 you can put Method clauses in the Match element and they should work
68 as expected.
69
70 =========
71 Examples:
72 =========
73
74 1. Match all bug reports for a class.
75
76 <Match class="com.foobar.MyClass" />
77
78 2. Match certain tests from a class.
79 <Match class="com.foobar.MyClass">
80 <BugCode name="DE,UrF,SIC" />
81 </Match>
82
83 3. Match certain tests from all classes.
84
85 <Match classregex=".*" >
86 <BugCode name="DE,UrF,SIC" />
87 </Match>
88
89 4. Match bug types from specified methods of a class.
90
91 <Match class="com.foobar.MyClass">
92 <Or>
93 <Method name="frob" params="int,java.lang.String" returns="void" />
94 <Method name="blat" params="" returns="boolean" />
95 </Or>
96 <BugCode name="DC" />
97 </Match>
98
99 =================
100 Complete Example:
101 =================
102
103 <FindBugsFilter>
104 <Match class="com.foobar.ClassNotToBeAnalyzed" />
105
106 <Match class="com.foobar.ClassWithSomeBugsMatched">
107 <BugCode name="DE,UrF,SIC" />
108 </Match>
109
110 <!-- Match all XYZ violations. -->
111 <Match classregex=".*" >
112 <BugCode name="XYZ" />
113 </Match>
114
115 <!-- Match all doublecheck violations in these methods of "AnotherClass". -->
116 <Match class="com.foobar.AnotherClass">
117 <Or>
118 <Method name="nonOverloadedMethod" />
119 <Method name="frob" params="int,java.lang.String" returns="void" />
120 <Method name="blat" params="" returns="boolean" />
121 </Or>
122 <BugCode name="DC" />
123 </Match>
124 </FindBugsFilter>
+0
-5500
doc/allBugDescriptions.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1 <html><head><title>FindBugs Bug Descriptions (Unabridged)</title>
2 <link rel="stylesheet" type="text/css" href="findbugs.css"/>
3 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
4 </head><body>
5
6 <table width="100%"><tr>
7
8 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
9 <table width="100%" cellspacing="0" border="0">
10 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
11
12 <tr><td>&nbsp;</td></tr>
13
14 <tr><td><b>Docs and Info</b></td></tr>
15 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
16 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
17 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
27
28 <tr><td>&nbsp;</td></tr>
29
30 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
31
32 <tr><td>&nbsp;</td></tr>
33
34 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
35
36 <tr><td>&nbsp;</td></tr>
37
38 <tr><td><b>Development</b></td></tr>
39 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
40 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
41 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
48 </table>
49 </td>
50 <td align="left" valign="top">
51 <h1>FindBugs Bug Descriptions (Unabridged)</h1>
52 <p>This document lists all of the bug patterns reported by the
53 latest development version of
54 <a href="http://findbugs.sourceforge.net">FindBugs</a>.&nbsp; Note that this may include
55 bug patterns not available in any released version of FindBugs,
56 as well as bug patterns that are not enabled by default.
57 <h2>Summary</h2>
58 <table width="100%">
59 <tr bgcolor="#b9b9fe"><th>Description</th><th>Category</th></tr>
60 <tr bgcolor="#eeeeee"><td><a href="#AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates an empty jar file entry</a></td><td>Bad practice</td></tr>
61 <tr bgcolor="#ffffff"><td><a href="#AM_CREATES_EMPTY_ZIP_FILE_ENTRY">AM: Creates an empty zip file entry</a></td><td>Bad practice</td></tr>
62 <tr bgcolor="#eeeeee"><td><a href="#BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS">BC: Equals method should not assume anything about the type of its argument</a></td><td>Bad practice</td></tr>
63 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK">BIT: Check for sign of bitwise operation</a></td><td>Bad practice</td></tr>
64 <tr bgcolor="#eeeeee"><td><a href="#CN_IDIOM">CN: Class implements Cloneable but does not define or use clone method</a></td><td>Bad practice</td></tr>
65 <tr bgcolor="#ffffff"><td><a href="#CN_IDIOM_NO_SUPER_CALL">CN: clone method does not call super.clone()</a></td><td>Bad practice</td></tr>
66 <tr bgcolor="#eeeeee"><td><a href="#CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: Class defines clone() but doesn't implement Cloneable</a></td><td>Bad practice</td></tr>
67 <tr bgcolor="#ffffff"><td><a href="#CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo() method</a></td><td>Bad practice</td></tr>
68 <tr bgcolor="#eeeeee"><td><a href="#CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined</a></td><td>Bad practice</td></tr>
69 <tr bgcolor="#ffffff"><td><a href="#DE_MIGHT_DROP">DE: Method might drop exception</a></td><td>Bad practice</td></tr>
70 <tr bgcolor="#eeeeee"><td><a href="#DE_MIGHT_IGNORE">DE: Method might ignore exception</a></td><td>Bad practice</td></tr>
71 <tr bgcolor="#ffffff"><td><a href="#DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI: Adding elements of an entry set may fail due to reuse of Entry objects</a></td><td>Bad practice</td></tr>
72 <tr bgcolor="#eeeeee"><td><a href="#DMI_RANDOM_USED_ONLY_ONCE">DMI: Random object created and used only once</a></td><td>Bad practice</td></tr>
73 <tr bgcolor="#ffffff"><td><a href="#DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">DMI: Don't use removeAll to clear a collection</a></td><td>Bad practice</td></tr>
74 <tr bgcolor="#eeeeee"><td><a href="#DM_EXIT">Dm: Method invokes System.exit(...)</a></td><td>Bad practice</td></tr>
75 <tr bgcolor="#ffffff"><td><a href="#DM_RUN_FINALIZERS_ON_EXIT">Dm: Method invokes dangerous method runFinalizersOnExit</a></td><td>Bad practice</td></tr>
76 <tr bgcolor="#eeeeee"><td><a href="#ES_COMPARING_PARAMETER_STRING_WITH_EQ">ES: Comparison of String parameter using == or !=</a></td><td>Bad practice</td></tr>
77 <tr bgcolor="#ffffff"><td><a href="#ES_COMPARING_STRINGS_WITH_EQ">ES: Comparison of String objects using == or !=</a></td><td>Bad practice</td></tr>
78 <tr bgcolor="#eeeeee"><td><a href="#EQ_ABSTRACT_SELF">Eq: Abstract class defines covariant equals() method</a></td><td>Bad practice</td></tr>
79 <tr bgcolor="#ffffff"><td><a href="#EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS">Eq: Equals checks for incompatible operand</a></td><td>Bad practice</td></tr>
80 <tr bgcolor="#eeeeee"><td><a href="#EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) and uses Object.equals()</a></td><td>Bad practice</td></tr>
81 <tr bgcolor="#ffffff"><td><a href="#EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtypes</a></td><td>Bad practice</td></tr>
82 <tr bgcolor="#eeeeee"><td><a href="#EQ_SELF_NO_OBJECT">Eq: Covariant equals() method defined</a></td><td>Bad practice</td></tr>
83 <tr bgcolor="#ffffff"><td><a href="#FI_EMPTY">FI: Empty finalizer should be deleted</a></td><td>Bad practice</td></tr>
84 <tr bgcolor="#eeeeee"><td><a href="#FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer</a></td><td>Bad practice</td></tr>
85 <tr bgcolor="#ffffff"><td><a href="#FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields</a></td><td>Bad practice</td></tr>
86 <tr bgcolor="#eeeeee"><td><a href="#FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields</a></td><td>Bad practice</td></tr>
87 <tr bgcolor="#ffffff"><td><a href="#FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass finalizer</a></td><td>Bad practice</td></tr>
88 <tr bgcolor="#eeeeee"><td><a href="#FI_NULLIFY_SUPER">FI: Finalizer nullifies superclass finalizer</a></td><td>Bad practice</td></tr>
89 <tr bgcolor="#ffffff"><td><a href="#FI_USELESS">FI: Finalizer does nothing but call superclass finalizer</a></td><td>Bad practice</td></tr>
90 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_USES_NEWLINE">FS: Format string should use %n rather than \n</a></td><td>Bad practice</td></tr>
91 <tr bgcolor="#ffffff"><td><a href="#GC_UNCHECKED_TYPE_IN_GENERIC_CALL">GC: Unchecked type in generic call</a></td><td>Bad practice</td></tr>
92 <tr bgcolor="#eeeeee"><td><a href="#HE_EQUALS_NO_HASHCODE">HE: Class defines equals() but not hashCode()</a></td><td>Bad practice</td></tr>
93 <tr bgcolor="#ffffff"><td><a href="#HE_EQUALS_USE_HASHCODE">HE: Class defines equals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr>
94 <tr bgcolor="#eeeeee"><td><a href="#HE_HASHCODE_NO_EQUALS">HE: Class defines hashCode() but not equals()</a></td><td>Bad practice</td></tr>
95 <tr bgcolor="#ffffff"><td><a href="#HE_HASHCODE_USE_OBJECT_EQUALS">HE: Class defines hashCode() and uses Object.equals()</a></td><td>Bad practice</td></tr>
96 <tr bgcolor="#eeeeee"><td><a href="#HE_INHERITS_EQUALS_USE_HASHCODE">HE: Class inherits equals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr>
97 <tr bgcolor="#ffffff"><td><a href="#IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION">IC: Superclass uses subclass during initialization</a></td><td>Bad practice</td></tr>
98 <tr bgcolor="#eeeeee"><td><a href="#IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching of IllegalMonitorStateException</a></td><td>Bad practice</td></tr>
99 <tr bgcolor="#ffffff"><td><a href="#ISC_INSTANTIATE_STATIC_CLASS">ISC: Needless instantiation of class that only supplies static methods</a></td><td>Bad practice</td></tr>
100 <tr bgcolor="#eeeeee"><td><a href="#IT_NO_SUCH_ELEMENT">It: Iterator next() method can't throw NoSuchElementException</a></td><td>Bad practice</td></tr>
101 <tr bgcolor="#ffffff"><td><a href="#J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION">J2EE: Store of non serializable object into HttpSession</a></td><td>Bad practice</td></tr>
102 <tr bgcolor="#eeeeee"><td><a href="#JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP: Fields of immutable classes should be final</a></td><td>Bad practice</td></tr>
103 <tr bgcolor="#ffffff"><td><a href="#NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns explicit null</a></td><td>Bad practice</td></tr>
104 <tr bgcolor="#eeeeee"><td><a href="#NP_CLONE_COULD_RETURN_NULL">NP: Clone method may return null</a></td><td>Bad practice</td></tr>
105 <tr bgcolor="#ffffff"><td><a href="#NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT">NP: equals() method does not check for null argument</a></td><td>Bad practice</td></tr>
106 <tr bgcolor="#eeeeee"><td><a href="#NP_TOSTRING_COULD_RETURN_NULL">NP: toString method may return null</a></td><td>Bad practice</td></tr>
107 <tr bgcolor="#ffffff"><td><a href="#NM_CLASS_NAMING_CONVENTION">Nm: Class names should start with an upper case letter</a></td><td>Bad practice</td></tr>
108 <tr bgcolor="#eeeeee"><td><a href="#NM_CLASS_NOT_EXCEPTION">Nm: Class is not derived from an Exception, even though it is named as such</a></td><td>Bad practice</td></tr>
109 <tr bgcolor="#ffffff"><td><a href="#NM_CONFUSING">Nm: Confusing method names</a></td><td>Bad practice</td></tr>
110 <tr bgcolor="#eeeeee"><td><a href="#NM_FIELD_NAMING_CONVENTION">Nm: Field names should start with a lower case letter</a></td><td>Bad practice</td></tr>
111 <tr bgcolor="#ffffff"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER">Nm: Use of identifier that is a keyword in later versions of Java</a></td><td>Bad practice</td></tr>
112 <tr bgcolor="#eeeeee"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER">Nm: Use of identifier that is a keyword in later versions of Java</a></td><td>Bad practice</td></tr>
113 <tr bgcolor="#ffffff"><td><a href="#NM_METHOD_NAMING_CONVENTION">Nm: Method names should start with a lower case letter</a></td><td>Bad practice</td></tr>
114 <tr bgcolor="#eeeeee"><td><a href="#NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class names shouldn't shadow simple name of implemented interface</a></td><td>Bad practice</td></tr>
115 <tr bgcolor="#ffffff"><td><a href="#NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class names shouldn't shadow simple name of superclass</a></td><td>Bad practice</td></tr>
116 <tr bgcolor="#eeeeee"><td><a href="#NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but perhaps intentional)</a></td><td>Bad practice</td></tr>
117 <tr bgcolor="#ffffff"><td><a href="#NM_WRONG_PACKAGE_INTENTIONAL">Nm: Method doesn't override method in superclass due to wrong package for parameter</a></td><td>Bad practice</td></tr>
118 <tr bgcolor="#eeeeee"><td><a href="#ODR_OPEN_DATABASE_RESOURCE">ODR: Method may fail to close database resource</a></td><td>Bad practice</td></tr>
119 <tr bgcolor="#ffffff"><td><a href="#ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH">ODR: Method may fail to close database resource on exception</a></td><td>Bad practice</td></tr>
120 <tr bgcolor="#eeeeee"><td><a href="#OS_OPEN_STREAM">OS: Method may fail to close stream</a></td><td>Bad practice</td></tr>
121 <tr bgcolor="#ffffff"><td><a href="#OS_OPEN_STREAM_EXCEPTION_PATH">OS: Method may fail to close stream on exception</a></td><td>Bad practice</td></tr>
122 <tr bgcolor="#eeeeee"><td><a href="#PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">PZ: Don't reuse entry objects in iterators</a></td><td>Bad practice</td></tr>
123 <tr bgcolor="#ffffff"><td><a href="#RC_REF_COMPARISON_BAD_PRACTICE">RC: Suspicious reference comparison to constant</a></td><td>Bad practice</td></tr>
124 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN">RC: Suspicious reference comparison of Boolean values</a></td><td>Bad practice</td></tr>
125 <tr bgcolor="#ffffff"><td><a href="#RR_NOT_CHECKED">RR: Method ignores results of InputStream.read()</a></td><td>Bad practice</td></tr>
126 <tr bgcolor="#eeeeee"><td><a href="#SR_NOT_CHECKED">RR: Method ignores results of InputStream.skip()</a></td><td>Bad practice</td></tr>
127 <tr bgcolor="#ffffff"><td><a href="#RV_NEGATING_RESULT_OF_COMPARETO">RV: Negating the result of compareTo()/compare()</a></td><td>Bad practice</td></tr>
128 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_BAD_PRACTICE">RV: Method ignores exceptional return value</a></td><td>Bad practice</td></tr>
129 <tr bgcolor="#ffffff"><td><a href="#SI_INSTANCE_BEFORE_FINALS_ASSIGNED">SI: Static initializer creates instance before all static final fields assigned</a></td><td>Bad practice</td></tr>
130 <tr bgcolor="#eeeeee"><td><a href="#SW_SWING_METHODS_INVOKED_IN_SWING_THREAD">SW: Certain swing methods needs to be invoked in Swing thread</a></td><td>Bad practice</td></tr>
131 <tr bgcolor="#ffffff"><td><a href="#SE_BAD_FIELD">Se: Non-transient non-serializable instance field in serializable class</a></td><td>Bad practice</td></tr>
132 <tr bgcolor="#eeeeee"><td><a href="#SE_BAD_FIELD_INNER_CLASS">Se: Non-serializable class has a serializable inner class</a></td><td>Bad practice</td></tr>
133 <tr bgcolor="#ffffff"><td><a href="#SE_BAD_FIELD_STORE">Se: Non-serializable value stored into instance field of a serializable class</a></td><td>Bad practice</td></tr>
134 <tr bgcolor="#eeeeee"><td><a href="#SE_COMPARATOR_SHOULD_BE_SERIALIZABLE">Se: Comparator doesn't implement Serializable</a></td><td>Bad practice</td></tr>
135 <tr bgcolor="#ffffff"><td><a href="#SE_INNER_CLASS">Se: Serializable inner class</a></td><td>Bad practice</td></tr>
136 <tr bgcolor="#eeeeee"><td><a href="#SE_NONFINAL_SERIALVERSIONID">Se: serialVersionUID isn't final</a></td><td>Bad practice</td></tr>
137 <tr bgcolor="#ffffff"><td><a href="#SE_NONLONG_SERIALVERSIONID">Se: serialVersionUID isn't long</a></td><td>Bad practice</td></tr>
138 <tr bgcolor="#eeeeee"><td><a href="#SE_NONSTATIC_SERIALVERSIONID">Se: serialVersionUID isn't static</a></td><td>Bad practice</td></tr>
139 <tr bgcolor="#ffffff"><td><a href="#SE_NO_SUITABLE_CONSTRUCTOR">Se: Class is Serializable but its superclass doesn't define a void constructor</a></td><td>Bad practice</td></tr>
140 <tr bgcolor="#eeeeee"><td><a href="#SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION">Se: Class is Externalizable but doesn't define a void constructor</a></td><td>Bad practice</td></tr>
141 <tr bgcolor="#ffffff"><td><a href="#SE_READ_RESOLVE_MUST_RETURN_OBJECT">Se: The readResolve method must be declared with a return type of Object. </a></td><td>Bad practice</td></tr>
142 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_NOT_RESTORED">Se: Transient field that isn't set by deserialization. </a></td><td>Bad practice</td></tr>
143 <tr bgcolor="#ffffff"><td><a href="#SE_NO_SERIALVERSIONID">SnVI: Class is Serializable, but doesn't define serialVersionUID</a></td><td>Bad practice</td></tr>
144 <tr bgcolor="#eeeeee"><td><a href="#UI_INHERITANCE_UNSAFE_GETRESOURCE">UI: Usage of GetResource may be unsafe if class is extended</a></td><td>Bad practice</td></tr>
145 <tr bgcolor="#ffffff"><td><a href="#BAC_BAD_APPLET_CONSTRUCTOR">BAC: Bad Applet Constructor relies on uninitialized AppletStub</a></td><td>Correctness</td></tr>
146 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_CAST">BC: Impossible cast</a></td><td>Correctness</td></tr>
147 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downcast</a></td><td>Correctness</td></tr>
148 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impossible downcast of toArray() result</a></td><td>Correctness</td></tr>
149 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof will always return false</a></td><td>Correctness</td></tr>
150 <tr bgcolor="#eeeeee"><td><a href="#BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of signed byte value</a></td><td>Correctness</td></tr>
151 <tr bgcolor="#ffffff"><td><a href="#BIT_AND">BIT: Incompatible bit masks</a></td><td>Correctness</td></tr>
152 <tr bgcolor="#eeeeee"><td><a href="#BIT_AND_ZZ">BIT: Check to see if ((...) & 0) == 0</a></td><td>Correctness</td></tr>
153 <tr bgcolor="#ffffff"><td><a href="#BIT_IOR">BIT: Incompatible bit masks</a></td><td>Correctness</td></tr>
154 <tr bgcolor="#eeeeee"><td><a href="#BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of signed byte value</a></td><td>Correctness</td></tr>
155 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for sign of bitwise operation</a></td><td>Correctness</td></tr>
156 <tr bgcolor="#eeeeee"><td><a href="#BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class overrides a method implemented in super class Adapter wrongly</a></td><td>Correctness</td></tr>
157 <tr bgcolor="#ffffff"><td><a href="#ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int shifted by an amount not in the range -31..31</a></td><td>Correctness</td></tr>
158 <tr bgcolor="#eeeeee"><td><a href="#BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">Bx: Primitive value is unboxed and coerced for ternary operator</a></td><td>Correctness</td></tr>
159 <tr bgcolor="#ffffff"><td><a href="#CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns Integer.MIN_VALUE</a></td><td>Correctness</td></tr>
160 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in return statement</a></td><td>Correctness</td></tr>
161 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead store of class literal</a></td><td>Correctness</td></tr>
162 <tr bgcolor="#eeeeee"><td><a href="#DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten increment</a></td><td>Correctness</td></tr>
163 <tr bgcolor="#ffffff"><td><a href="#DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed method arguments</a></td><td>Correctness</td></tr>
164 <tr bgcolor="#eeeeee"><td><a href="#DMI_BAD_MONTH">DMI: Bad constant value for month</a></td><td>Correctness</td></tr>
165 <tr bgcolor="#ffffff"><td><a href="#DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI: BigDecimal constructed from double that isn't represented precisely</a></td><td>Correctness</td></tr>
166 <tr bgcolor="#eeeeee"><td><a href="#DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext method invokes next</a></td><td>Correctness</td></tr>
167 <tr bgcolor="#ffffff"><td><a href="#DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES">DMI: Collections should not contain themselves</a></td><td>Correctness</td></tr>
168 <tr bgcolor="#eeeeee"><td><a href="#DMI_DOH">DMI: D'oh! A nonsensical method invocation</a></td><td>Correctness</td></tr>
169 <tr bgcolor="#ffffff"><td><a href="#DMI_INVOKING_HASHCODE_ON_ARRAY">DMI: Invocation of hashCode on an array</a></td><td>Correctness</td></tr>
170 <tr bgcolor="#eeeeee"><td><a href="#DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">DMI: Double.longBitsToDouble invoked on an int</a></td><td>Correctness</td></tr>
171 <tr bgcolor="#ffffff"><td><a href="#DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuous call to collections</a></td><td>Correctness</td></tr>
172 <tr bgcolor="#eeeeee"><td><a href="#DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION">Dm: Can't use reflection to check for presence of annotation without runtime retention</a></td><td>Correctness</td></tr>
173 <tr bgcolor="#ffffff"><td><a href="#DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR">Dm: Futile attempt to change max pool size of ScheduledThreadPoolExecutor</a></td><td>Correctness</td></tr>
174 <tr bgcolor="#eeeeee"><td><a href="#DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS">Dm: Creation of ScheduledThreadPoolExecutor with zero core threads</a></td><td>Correctness</td></tr>
175 <tr bgcolor="#ffffff"><td><a href="#DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Useless/vacuous call to EasyMock method</a></td><td>Correctness</td></tr>
176 <tr bgcolor="#eeeeee"><td><a href="#EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonarray</a></td><td>Correctness</td></tr>
177 <tr bgcolor="#ffffff"><td><a href="#EC_BAD_ARRAY_COMPARE">EC: Invocation of equals() on an array, which is equivalent to ==</a></td><td>Correctness</td></tr>
178 <tr bgcolor="#eeeeee"><td><a href="#EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(...) used to compare incompatible arrays</a></td><td>Correctness</td></tr>
179 <tr bgcolor="#ffffff"><td><a href="#EC_NULL_ARG">EC: Call to equals(null)</a></td><td>Correctness</td></tr>
180 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_CLASS_AND_INTERFACE">EC: Call to equals() comparing unrelated class and interface</a></td><td>Correctness</td></tr>
181 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_INTERFACES">EC: Call to equals() comparing different interface types</a></td><td>Correctness</td></tr>
182 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_TYPES">EC: Call to equals() comparing different types</a></td><td>Correctness</td></tr>
183 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">EC: Using pointer equality to compare different types</a></td><td>Correctness</td></tr>
184 <tr bgcolor="#eeeeee"><td><a href="#EQ_ALWAYS_FALSE">Eq: equals method always returns false</a></td><td>Correctness</td></tr>
185 <tr bgcolor="#ffffff"><td><a href="#EQ_ALWAYS_TRUE">Eq: equals method always returns true</a></td><td>Correctness</td></tr>
186 <tr bgcolor="#eeeeee"><td><a href="#EQ_COMPARING_CLASS_NAMES">Eq: equals method compares class names rather than class objects</a></td><td>Correctness</td></tr>
187 <tr bgcolor="#ffffff"><td><a href="#EQ_DONT_DEFINE_EQUALS_FOR_ENUM">Eq: Covariant equals() method defined for enum</a></td><td>Correctness</td></tr>
188 <tr bgcolor="#eeeeee"><td><a href="#EQ_OTHER_NO_OBJECT">Eq: equals() method defined that doesn't override equals(Object)</a></td><td>Correctness</td></tr>
189 <tr bgcolor="#ffffff"><td><a href="#EQ_OTHER_USE_OBJECT">Eq: equals() method defined that doesn't override Object.equals(Object)</a></td><td>Correctness</td></tr>
190 <tr bgcolor="#eeeeee"><td><a href="#EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC">Eq: equals method overrides equals in superclass and may not be symmetric</a></td><td>Correctness</td></tr>
191 <tr bgcolor="#ffffff"><td><a href="#EQ_SELF_USE_OBJECT">Eq: Covariant equals() method defined, Object.equals(Object) inherited</a></td><td>Correctness</td></tr>
192 <tr bgcolor="#eeeeee"><td><a href="#FB_MISSING_EXPECTED_WARNING">FB: Missing expected or desired warning from FindBugs</a></td><td>Correctness</td></tr>
193 <tr bgcolor="#ffffff"><td><a href="#FB_UNEXPECTED_WARNING">FB: Unexpected/undesired warning from FindBugs</a></td><td>Correctness</td></tr>
194 <tr bgcolor="#eeeeee"><td><a href="#FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER">FE: Doomed test for equality to NaN</a></td><td>Correctness</td></tr>
195 <tr bgcolor="#ffffff"><td><a href="#FL_MATH_USING_FLOAT_PRECISION">FL: Method performs math using floating point precision</a></td><td>Correctness</td></tr>
196 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_ARGUMENT">FS: Format string placeholder incompatible with passed argument</a></td><td>Correctness</td></tr>
197 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION">FS: The type of a supplied argument doesn't match format specifier</a></td><td>Correctness</td></tr>
198 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED">FS: MessageFormat supplied where printf style format expected</a></td><td>Correctness</td></tr>
199 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED">FS: More arguments are passed than are actually used in the format string</a></td><td>Correctness</td></tr>
200 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_ILLEGAL">FS: Illegal format string</a></td><td>Correctness</td></tr>
201 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_MISSING_ARGUMENT">FS: Format string references missing argument</a></td><td>Correctness</td></tr>
202 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT">FS: No previous argument for format string</a></td><td>Correctness</td></tr>
203 <tr bgcolor="#ffffff"><td><a href="#GC_UNRELATED_TYPES">GC: No relationship between generic parameter and method argument</a></td><td>Correctness</td></tr>
204 <tr bgcolor="#eeeeee"><td><a href="#HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS">HE: Signature declares use of unhashable class in hashed construct</a></td><td>Correctness</td></tr>
205 <tr bgcolor="#ffffff"><td><a href="#HE_USE_OF_UNHASHABLE_CLASS">HE: Use of class without a hashCode() method in a hashed data structure</a></td><td>Correctness</td></tr>
206 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INT_2_LONG_AS_INSTANT">ICAST: int value converted to long and used as absolute time</a></td><td>Correctness</td></tr>
207 <tr bgcolor="#ffffff"><td><a href="#ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL">ICAST: Integral value cast to double and then passed to Math.ceil</a></td><td>Correctness</td></tr>
208 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND">ICAST: int value cast to float and then passed to Math.round</a></td><td>Correctness</td></tr>
209 <tr bgcolor="#ffffff"><td><a href="#IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD">IJU: JUnit assertion in run method will not be noticed by JUnit</a></td><td>Correctness</td></tr>
210 <tr bgcolor="#eeeeee"><td><a href="#IJU_BAD_SUITE_METHOD">IJU: TestCase declares a bad suite method </a></td><td>Correctness</td></tr>
211 <tr bgcolor="#ffffff"><td><a href="#IJU_NO_TESTS">IJU: TestCase has no tests</a></td><td>Correctness</td></tr>
212 <tr bgcolor="#eeeeee"><td><a href="#IJU_SETUP_NO_SUPER">IJU: TestCase defines setUp that doesn't call super.setUp()</a></td><td>Correctness</td></tr>
213 <tr bgcolor="#ffffff"><td><a href="#IJU_SUITE_NOT_STATIC">IJU: TestCase implements a non-static suite method </a></td><td>Correctness</td></tr>
214 <tr bgcolor="#eeeeee"><td><a href="#IJU_TEARDOWN_NO_SUPER">IJU: TestCase defines tearDown that doesn't call super.tearDown()</a></td><td>Correctness</td></tr>
215 <tr bgcolor="#ffffff"><td><a href="#IL_CONTAINER_ADDED_TO_ITSELF">IL: A collection is added to itself</a></td><td>Correctness</td></tr>
216 <tr bgcolor="#eeeeee"><td><a href="#IL_INFINITE_LOOP">IL: An apparent infinite loop</a></td><td>Correctness</td></tr>
217 <tr bgcolor="#ffffff"><td><a href="#IL_INFINITE_RECURSIVE_LOOP">IL: An apparent infinite recursive loop</a></td><td>Correctness</td></tr>
218 <tr bgcolor="#eeeeee"><td><a href="#IM_MULTIPLYING_RESULT_OF_IREM">IM: Integer multiply of result of integer remainder</a></td><td>Correctness</td></tr>
219 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad comparison of int value with long constant</a></td><td>Correctness</td></tr>
220 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT: Bad comparison of nonnegative value with negative constant</a></td><td>Correctness</td></tr>
221 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed byte</a></td><td>Correctness</td></tr>
222 <tr bgcolor="#eeeeee"><td><a href="#IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">IO: Doomed attempt to append to an object output stream</a></td><td>Correctness</td></tr>
223 <tr bgcolor="#ffffff"><td><a href="#IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">IP: A parameter is dead upon entry to a method but overwritten</a></td><td>Correctness</td></tr>
224 <tr bgcolor="#eeeeee"><td><a href="#MF_CLASS_MASKS_FIELD">MF: Class defines field that masks a superclass field</a></td><td>Correctness</td></tr>
225 <tr bgcolor="#ffffff"><td><a href="#MF_METHOD_MASKS_FIELD">MF: Method defines a variable that obscures a field</a></td><td>Correctness</td></tr>
226 <tr bgcolor="#eeeeee"><td><a href="#NP_ALWAYS_NULL">NP: Null pointer dereference</a></td><td>Correctness</td></tr>
227 <tr bgcolor="#ffffff"><td><a href="#NP_ALWAYS_NULL_EXCEPTION">NP: Null pointer dereference in method on exception path</a></td><td>Correctness</td></tr>
228 <tr bgcolor="#eeeeee"><td><a href="#NP_ARGUMENT_MIGHT_BE_NULL">NP: Method does not check for null argument</a></td><td>Correctness</td></tr>
229 <tr bgcolor="#ffffff"><td><a href="#NP_CLOSING_NULL">NP: close() invoked on a value that is always null</a></td><td>Correctness</td></tr>
230 <tr bgcolor="#eeeeee"><td><a href="#NP_GUARANTEED_DEREF">NP: Null value is guaranteed to be dereferenced</a></td><td>Correctness</td></tr>
231 <tr bgcolor="#ffffff"><td><a href="#NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: Value is null and guaranteed to be dereferenced on exception path</a></td><td>Correctness</td></tr>
232 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP: Nonnull field is not initialized</a></td><td>Correctness</td></tr>
233 <tr bgcolor="#ffffff"><td><a href="#NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a nonnull parameter </a></td><td>Correctness</td></tr>
234 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is declared @NonNull</a></td><td>Correctness</td></tr>
235 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_INSTANCEOF">NP: A known null value is checked to see if it is an instance of a type</a></td><td>Correctness</td></tr>
236 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH">NP: Possible null pointer dereference</a></td><td>Correctness</td></tr>
237 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_EXCEPTION">NP: Possible null pointer dereference in method on exception path</a></td><td>Correctness</td></tr>
238 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF">NP: Method call passes null for nonnull parameter</a></td><td>Correctness</td></tr>
239 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP: Method call passes null for nonnull parameter</a></td><td>Correctness</td></tr>
240 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virtual method call passes null for nonnull parameter</a></td><td>Correctness</td></tr>
241 <tr bgcolor="#ffffff"><td><a href="#NP_STORE_INTO_NONNULL_FIELD">NP: Store of null value into field annotated NonNull</a></td><td>Correctness</td></tr>
242 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_FIELD">NP: Read of unwritten field</a></td><td>Correctness</td></tr>
243 <tr bgcolor="#ffffff"><td><a href="#NM_BAD_EQUAL">Nm: Class defines equal(Object); should it be equals(Object)?</a></td><td>Correctness</td></tr>
244 <tr bgcolor="#eeeeee"><td><a href="#NM_LCASE_HASHCODE">Nm: Class defines hashcode(); should it be hashCode()?</a></td><td>Correctness</td></tr>
245 <tr bgcolor="#ffffff"><td><a href="#NM_LCASE_TOSTRING">Nm: Class defines tostring(); should it be toString()?</a></td><td>Correctness</td></tr>
246 <tr bgcolor="#eeeeee"><td><a href="#NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor confusion</a></td><td>Correctness</td></tr>
247 <tr bgcolor="#ffffff"><td><a href="#NM_VERY_CONFUSING">Nm: Very confusing method names</a></td><td>Correctness</td></tr>
248 <tr bgcolor="#eeeeee"><td><a href="#NM_WRONG_PACKAGE">Nm: Method doesn't override method in superclass due to wrong package for parameter</a></td><td>Correctness</td></tr>
249 <tr bgcolor="#ffffff"><td><a href="#QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean literal in boolean expression</a></td><td>Correctness</td></tr>
250 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON">RC: Suspicious reference comparison</a></td><td>Correctness</td></tr>
251 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE">RCN: Nullcheck of value previously dereferenced</a></td><td>Correctness</td></tr>
252 <tr bgcolor="#eeeeee"><td><a href="#RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">RE: Invalid syntax for regular expression</a></td><td>Correctness</td></tr>
253 <tr bgcolor="#ffffff"><td><a href="#RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION">RE: File.separator used for regular expression</a></td><td>Correctness</td></tr>
254 <tr bgcolor="#eeeeee"><td><a href="#RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or "|" used for regular expression</a></td><td>Correctness</td></tr>
255 <tr bgcolor="#ffffff"><td><a href="#RV_01_TO_INT">RV: Random value from 0 to 1 is coerced to the integer 0</a></td><td>Correctness</td></tr>
256 <tr bgcolor="#eeeeee"><td><a href="#RV_ABSOLUTE_VALUE_OF_HASHCODE">RV: Bad attempt to compute absolute value of signed 32-bit hashcode </a></td><td>Correctness</td></tr>
257 <tr bgcolor="#ffffff"><td><a href="#RV_ABSOLUTE_VALUE_OF_RANDOM_INT">RV: Bad attempt to compute absolute value of signed random integer</a></td><td>Correctness</td></tr>
258 <tr bgcolor="#eeeeee"><td><a href="#RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE">RV: Code checks for specific values returned by compareTo</a></td><td>Correctness</td></tr>
259 <tr bgcolor="#ffffff"><td><a href="#RV_EXCEPTION_NOT_THROWN">RV: Exception created and dropped rather than thrown</a></td><td>Correctness</td></tr>
260 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED">RV: Method ignores return value</a></td><td>Correctness</td></tr>
261 <tr bgcolor="#ffffff"><td><a href="#RpC_REPEATED_CONDITIONAL_TEST">RpC: Repeated conditional tests</a></td><td>Correctness</td></tr>
262 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_ASSIGNMENT">SA: Self assignment of field</a></td><td>Correctness</td></tr>
263 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_SELF_COMPARISON">SA: Self comparison of field with itself</a></td><td>Correctness</td></tr>
264 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_COMPUTATION">SA: Nonsensical self computation involving a field (e.g., x & x)</a></td><td>Correctness</td></tr>
265 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">SA: Self assignment of local rather than assignment to field</a></td><td>Correctness</td></tr>
266 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_COMPARISON">SA: Self comparison of value with itself</a></td><td>Correctness</td></tr>
267 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_COMPUTATION">SA: Nonsensical self computation involving a variable (e.g., x & x)</a></td><td>Correctness</td></tr>
268 <tr bgcolor="#eeeeee"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">SF: Dead store due to switch statement fall through</a></td><td>Correctness</td></tr>
269 <tr bgcolor="#ffffff"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW">SF: Dead store due to switch statement fall through to throw</a></td><td>Correctness</td></tr>
270 <tr bgcolor="#eeeeee"><td><a href="#SIC_THREADLOCAL_DEADLY_EMBRACE">SIC: Deadly embrace of non-static inner class and thread local</a></td><td>Correctness</td></tr>
271 <tr bgcolor="#ffffff"><td><a href="#SIO_SUPERFLUOUS_INSTANCEOF">SIO: Unnecessary type check done using instanceof operator</a></td><td>Correctness</td></tr>
272 <tr bgcolor="#eeeeee"><td><a href="#SQL_BAD_PREPARED_STATEMENT_ACCESS">SQL: Method attempts to access a prepared statement parameter with index 0</a></td><td>Correctness</td></tr>
273 <tr bgcolor="#ffffff"><td><a href="#SQL_BAD_RESULTSET_ACCESS">SQL: Method attempts to access a result set field with index 0</a></td><td>Correctness</td></tr>
274 <tr bgcolor="#eeeeee"><td><a href="#STI_INTERRUPTED_ON_CURRENTTHREAD">STI: Unneeded use of currentThread() call, to call interrupted() </a></td><td>Correctness</td></tr>
275 <tr bgcolor="#ffffff"><td><a href="#STI_INTERRUPTED_ON_UNKNOWNTHREAD">STI: Static Thread.interrupted() method invoked on thread instance</a></td><td>Correctness</td></tr>
276 <tr bgcolor="#eeeeee"><td><a href="#SE_METHOD_MUST_BE_PRIVATE">Se: Method must be private in order for serialization to work</a></td><td>Correctness</td></tr>
277 <tr bgcolor="#ffffff"><td><a href="#SE_READ_RESOLVE_IS_STATIC">Se: The readResolve method must not be declared as a static method. </a></td><td>Correctness</td></tr>
278 <tr bgcolor="#eeeeee"><td><a href="#TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">TQ: Value annotated as carrying a type qualifier used where a value that must not carry that qualifier is required</a></td><td>Correctness</td></tr>
279 <tr bgcolor="#ffffff"><td><a href="#TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS">TQ: Comparing values with incompatible type qualifiers</a></td><td>Correctness</td></tr>
280 <tr bgcolor="#eeeeee"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">TQ: Value that might not carry a type qualifier is always used in a way requires that type qualifier</a></td><td>Correctness</td></tr>
281 <tr bgcolor="#ffffff"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value that might carry a type qualifier is always used in a way prohibits it from having that type qualifier</a></td><td>Correctness</td></tr>
282 <tr bgcolor="#eeeeee"><td><a href="#TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">TQ: Value annotated as never carrying a type qualifier used where value carrying that qualifier is required</a></td><td>Correctness</td></tr>
283 <tr bgcolor="#ffffff"><td><a href="#TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED">TQ: Value without a type qualifier used where a value is required to have that qualifier</a></td><td>Correctness</td></tr>
284 <tr bgcolor="#eeeeee"><td><a href="#UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">UMAC: Uncallable method defined in anonymous class</a></td><td>Correctness</td></tr>
285 <tr bgcolor="#ffffff"><td><a href="#UR_UNINIT_READ">UR: Uninitialized read of field in constructor</a></td><td>Correctness</td></tr>
286 <tr bgcolor="#eeeeee"><td><a href="#UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR">UR: Uninitialized read of field method called from constructor of superclass</a></td><td>Correctness</td></tr>
287 <tr bgcolor="#ffffff"><td><a href="#DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">USELESS_STRING: Invocation of toString on an unnamed array</a></td><td>Correctness</td></tr>
288 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_TOSTRING_ON_ARRAY">USELESS_STRING: Invocation of toString on an array</a></td><td>Correctness</td></tr>
289 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">USELESS_STRING: Array formatted in useless way using format string</a></td><td>Correctness</td></tr>
290 <tr bgcolor="#eeeeee"><td><a href="#UWF_NULL_FIELD">UwF: Field only ever set to null</a></td><td>Correctness</td></tr>
291 <tr bgcolor="#ffffff"><td><a href="#UWF_UNWRITTEN_FIELD">UwF: Unwritten field</a></td><td>Correctness</td></tr>
292 <tr bgcolor="#eeeeee"><td><a href="#VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">VA: Primitive array passed to function expecting a variable number of object arguments</a></td><td>Correctness</td></tr>
293 <tr bgcolor="#ffffff"><td><a href="#VR_UNRESOLVABLE_REFERENCE">VR: Class makes reference to unresolvable class or method</a></td><td>Correctness</td></tr>
294 <tr bgcolor="#eeeeee"><td><a href="#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">LG: Potential lost logger changes due to weak reference in OpenJDK</a></td><td>Experimental</td></tr>
295 <tr bgcolor="#ffffff"><td><a href="#OBL_UNSATISFIED_OBLIGATION">OBL: Method may fail to clean up stream or resource</a></td><td>Experimental</td></tr>
296 <tr bgcolor="#eeeeee"><td><a href="#OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">OBL: Method may fail to clean up stream or resource on checked exception</a></td><td>Experimental</td></tr>
297 <tr bgcolor="#ffffff"><td><a href="#TESTING">TEST: Testing</a></td><td>Experimental</td></tr>
298 <tr bgcolor="#eeeeee"><td><a href="#DM_CONVERT_CASE">Dm: Consider using Locale parameterized version of invoked method</a></td><td>Internationalization</td></tr>
299 <tr bgcolor="#ffffff"><td><a href="#DM_DEFAULT_ENCODING">Dm: Reliance on default encoding</a></td><td>Internationalization</td></tr>
300 <tr bgcolor="#eeeeee"><td><a href="#DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">DP: Classloaders should only be created inside doPrivileged block</a></td><td>Malicious code vulnerability</td></tr>
301 <tr bgcolor="#ffffff"><td><a href="#DP_DO_INSIDE_DO_PRIVILEGED">DP: Method invoked that should be only be invoked inside a doPrivileged block</a></td><td>Malicious code vulnerability</td></tr>
302 <tr bgcolor="#eeeeee"><td><a href="#EI_EXPOSE_REP">EI: May expose internal representation by returning reference to mutable object</a></td><td>Malicious code vulnerability</td></tr>
303 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_REP2">EI2: May expose internal representation by incorporating reference to mutable object</a></td><td>Malicious code vulnerability</td></tr>
304 <tr bgcolor="#eeeeee"><td><a href="#FI_PUBLIC_SHOULD_BE_PROTECTED">FI: Finalizer should be protected, not public</a></td><td>Malicious code vulnerability</td></tr>
305 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_STATIC_REP2">MS: May expose internal static state by storing a mutable object into a static field</a></td><td>Malicious code vulnerability</td></tr>
306 <tr bgcolor="#eeeeee"><td><a href="#MS_CANNOT_BE_FINAL">MS: Field isn't final and can't be protected from malicious code</a></td><td>Malicious code vulnerability</td></tr>
307 <tr bgcolor="#ffffff"><td><a href="#MS_EXPOSE_REP">MS: Public static method may expose internal representation by returning array</a></td><td>Malicious code vulnerability</td></tr>
308 <tr bgcolor="#eeeeee"><td><a href="#MS_FINAL_PKGPROTECT">MS: Field should be both final and package protected</a></td><td>Malicious code vulnerability</td></tr>
309 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_ARRAY">MS: Field is a mutable array</a></td><td>Malicious code vulnerability</td></tr>
310 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable</a></td><td>Malicious code vulnerability</td></tr>
311 <tr bgcolor="#ffffff"><td><a href="#MS_OOI_PKGPROTECT">MS: Field should be moved out of an interface and made package protected</a></td><td>Malicious code vulnerability</td></tr>
312 <tr bgcolor="#eeeeee"><td><a href="#MS_PKGPROTECT">MS: Field should be package protected</a></td><td>Malicious code vulnerability</td></tr>
313 <tr bgcolor="#ffffff"><td><a href="#MS_SHOULD_BE_FINAL">MS: Field isn't final but should be</a></td><td>Malicious code vulnerability</td></tr>
314 <tr bgcolor="#eeeeee"><td><a href="#MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS: Field isn't final but should be refactored to be so</a></td><td>Malicious code vulnerability</td></tr>
315 <tr bgcolor="#ffffff"><td><a href="#AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION">AT: Sequence of calls to concurrent abstraction may not be atomic</a></td><td>Multithreaded correctness</td></tr>
316 <tr bgcolor="#eeeeee"><td><a href="#DC_DOUBLECHECK">DC: Possible double check of field</a></td><td>Multithreaded correctness</td></tr>
317 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean</a></td><td>Multithreaded correctness</td></tr>
318 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: Synchronization on boxed primitive</a></td><td>Multithreaded correctness</td></tr>
319 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: Synchronization on interned String </a></td><td>Multithreaded correctness</td></tr>
320 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE">DL: Synchronization on boxed primitive values</a></td><td>Multithreaded correctness</td></tr>
321 <tr bgcolor="#ffffff"><td><a href="#DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wait() called on Condition</a></td><td>Multithreaded correctness</td></tr>
322 <tr bgcolor="#eeeeee"><td><a href="#DM_USELESS_THREAD">Dm: A thread was created using the default empty run method</a></td><td>Multithreaded correctness</td></tr>
323 <tr bgcolor="#ffffff"><td><a href="#ESync_EMPTY_SYNC">ESync: Empty synchronized block</a></td><td>Multithreaded correctness</td></tr>
324 <tr bgcolor="#eeeeee"><td><a href="#IS2_INCONSISTENT_SYNC">IS: Inconsistent synchronization</a></td><td>Multithreaded correctness</td></tr>
325 <tr bgcolor="#ffffff"><td><a href="#IS_FIELD_NOT_GUARDED">IS: Field not guarded against concurrent access</a></td><td>Multithreaded correctness</td></tr>
326 <tr bgcolor="#eeeeee"><td><a href="#JLM_JSR166_LOCK_MONITORENTER">JLM: Synchronization performed on Lock</a></td><td>Multithreaded correctness</td></tr>
327 <tr bgcolor="#ffffff"><td><a href="#JLM_JSR166_UTILCONCURRENT_MONITORENTER">JLM: Synchronization performed on util.concurrent instance</a></td><td>Multithreaded correctness</td></tr>
328 <tr bgcolor="#eeeeee"><td><a href="#JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">JLM: Using monitor style wait methods on util.concurrent abstraction</a></td><td>Multithreaded correctness</td></tr>
329 <tr bgcolor="#ffffff"><td><a href="#LI_LAZY_INIT_STATIC">LI: Incorrect lazy initialization of static field</a></td><td>Multithreaded correctness</td></tr>
330 <tr bgcolor="#eeeeee"><td><a href="#LI_LAZY_INIT_UPDATE_STATIC">LI: Incorrect lazy initialization and update of static field</a></td><td>Multithreaded correctness</td></tr>
331 <tr bgcolor="#ffffff"><td><a href="#ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD">ML: Synchronization on field in futile attempt to guard that field</a></td><td>Multithreaded correctness</td></tr>
332 <tr bgcolor="#eeeeee"><td><a href="#ML_SYNC_ON_UPDATED_FIELD">ML: Method synchronizes on an updated field</a></td><td>Multithreaded correctness</td></tr>
333 <tr bgcolor="#ffffff"><td><a href="#MSF_MUTABLE_SERVLET_FIELD">MSF: Mutable servlet field</a></td><td>Multithreaded correctness</td></tr>
334 <tr bgcolor="#eeeeee"><td><a href="#MWN_MISMATCHED_NOTIFY">MWN: Mismatched notify()</a></td><td>Multithreaded correctness</td></tr>
335 <tr bgcolor="#ffffff"><td><a href="#MWN_MISMATCHED_WAIT">MWN: Mismatched wait()</a></td><td>Multithreaded correctness</td></tr>
336 <tr bgcolor="#eeeeee"><td><a href="#NN_NAKED_NOTIFY">NN: Naked notify</a></td><td>Multithreaded correctness</td></tr>
337 <tr bgcolor="#ffffff"><td><a href="#NP_SYNC_AND_NULL_CHECK_FIELD">NP: Synchronize and null check on the same field.</a></td><td>Multithreaded correctness</td></tr>
338 <tr bgcolor="#eeeeee"><td><a href="#NO_NOTIFY_NOT_NOTIFYALL">No: Using notify() rather than notifyAll()</a></td><td>Multithreaded correctness</td></tr>
339 <tr bgcolor="#ffffff"><td><a href="#RS_READOBJECT_SYNC">RS: Class's readObject() method is synchronized</a></td><td>Multithreaded correctness</td></tr>
340 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED">RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused</a></td><td>Multithreaded correctness</td></tr>
341 <tr bgcolor="#ffffff"><td><a href="#RU_INVOKE_RUN">Ru: Invokes run on a thread (did you mean to start it instead?)</a></td><td>Multithreaded correctness</td></tr>
342 <tr bgcolor="#eeeeee"><td><a href="#SC_START_IN_CTOR">SC: Constructor invokes Thread.start()</a></td><td>Multithreaded correctness</td></tr>
343 <tr bgcolor="#ffffff"><td><a href="#SP_SPIN_ON_FIELD">SP: Method spins on field</a></td><td>Multithreaded correctness</td></tr>
344 <tr bgcolor="#eeeeee"><td><a href="#STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE">STCAL: Call to static Calendar</a></td><td>Multithreaded correctness</td></tr>
345 <tr bgcolor="#ffffff"><td><a href="#STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE">STCAL: Call to static DateFormat</a></td><td>Multithreaded correctness</td></tr>
346 <tr bgcolor="#eeeeee"><td><a href="#STCAL_STATIC_CALENDAR_INSTANCE">STCAL: Static Calendar field</a></td><td>Multithreaded correctness</td></tr>
347 <tr bgcolor="#ffffff"><td><a href="#STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE">STCAL: Static DateFormat</a></td><td>Multithreaded correctness</td></tr>
348 <tr bgcolor="#eeeeee"><td><a href="#SWL_SLEEP_WITH_LOCK_HELD">SWL: Method calls Thread.sleep() with a lock held</a></td><td>Multithreaded correctness</td></tr>
349 <tr bgcolor="#ffffff"><td><a href="#TLW_TWO_LOCK_WAIT">TLW: Wait with two locks held</a></td><td>Multithreaded correctness</td></tr>
350 <tr bgcolor="#eeeeee"><td><a href="#UG_SYNC_SET_UNSYNC_GET">UG: Unsynchronized get method, synchronized set method</a></td><td>Multithreaded correctness</td></tr>
351 <tr bgcolor="#ffffff"><td><a href="#UL_UNRELEASED_LOCK">UL: Method does not release lock on all paths</a></td><td>Multithreaded correctness</td></tr>
352 <tr bgcolor="#eeeeee"><td><a href="#UL_UNRELEASED_LOCK_EXCEPTION_PATH">UL: Method does not release lock on all exception paths</a></td><td>Multithreaded correctness</td></tr>
353 <tr bgcolor="#ffffff"><td><a href="#UW_UNCOND_WAIT">UW: Unconditional wait</a></td><td>Multithreaded correctness</td></tr>
354 <tr bgcolor="#eeeeee"><td><a href="#VO_VOLATILE_INCREMENT">VO: An increment to a volatile field isn't atomic</a></td><td>Multithreaded correctness</td></tr>
355 <tr bgcolor="#ffffff"><td><a href="#VO_VOLATILE_REFERENCE_TO_ARRAY">VO: A volatile reference to an array doesn't treat the array elements as volatile</a></td><td>Multithreaded correctness</td></tr>
356 <tr bgcolor="#eeeeee"><td><a href="#WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL">WL: Synchronization on getClass rather than class literal</a></td><td>Multithreaded correctness</td></tr>
357 <tr bgcolor="#ffffff"><td><a href="#WS_WRITEOBJECT_SYNC">WS: Class's writeObject() method is synchronized but nothing else is</a></td><td>Multithreaded correctness</td></tr>
358 <tr bgcolor="#eeeeee"><td><a href="#WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await() not in loop </a></td><td>Multithreaded correctness</td></tr>
359 <tr bgcolor="#ffffff"><td><a href="#WA_NOT_IN_LOOP">Wa: Wait not in loop </a></td><td>Multithreaded correctness</td></tr>
360 <tr bgcolor="#eeeeee"><td><a href="#NOISE_FIELD_REFERENCE">NOISE: Bogus warning about a field reference</a></td><td>Bogus random noise</td></tr>
361 <tr bgcolor="#ffffff"><td><a href="#NOISE_METHOD_CALL">NOISE: Bogus warning about a method call</a></td><td>Bogus random noise</td></tr>
362 <tr bgcolor="#eeeeee"><td><a href="#NOISE_NULL_DEREFERENCE">NOISE: Bogus warning about a null pointer dereference</a></td><td>Bogus random noise</td></tr>
363 <tr bgcolor="#ffffff"><td><a href="#NOISE_OPERATION">NOISE: Bogus warning about an operation</a></td><td>Bogus random noise</td></tr>
364 <tr bgcolor="#eeeeee"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive value is boxed and then immediately unboxed</a></td><td>Performance</td></tr>
365 <tr bgcolor="#ffffff"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">Bx: Primitive value is boxed then unboxed to perform primitive coercion</a></td><td>Performance</td></tr>
366 <tr bgcolor="#eeeeee"><td><a href="#BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and then immediately reboxed</a></td><td>Performance</td></tr>
367 <tr bgcolor="#ffffff"><td><a href="#DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a primitive</a></td><td>Performance</td></tr>
368 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive just to call toString</a></td><td>Performance</td></tr>
369 <tr bgcolor="#ffffff"><td><a href="#DM_FP_NUMBER_CTOR">Bx: Method invokes inefficient floating-point Number constructor; use static valueOf instead</a></td><td>Performance</td></tr>
370 <tr bgcolor="#eeeeee"><td><a href="#DM_NUMBER_CTOR">Bx: Method invokes inefficient Number constructor; use static valueOf instead</a></td><td>Performance</td></tr>
371 <tr bgcolor="#ffffff"><td><a href="#DMI_BLOCKING_METHODS_ON_URL">Dm: The equals and hashCode methods of URL are blocking</a></td><td>Performance</td></tr>
372 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTION_OF_URLS">Dm: Maps and sets of URLs can be performance hogs</a></td><td>Performance</td></tr>
373 <tr bgcolor="#ffffff"><td><a href="#DM_BOOLEAN_CTOR">Dm: Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead</a></td><td>Performance</td></tr>
374 <tr bgcolor="#eeeeee"><td><a href="#DM_GC">Dm: Explicit garbage collection; extremely dubious except in benchmarking code</a></td><td>Performance</td></tr>
375 <tr bgcolor="#ffffff"><td><a href="#DM_NEW_FOR_GETCLASS">Dm: Method allocates an object, only to get the class object</a></td><td>Performance</td></tr>
376 <tr bgcolor="#eeeeee"><td><a href="#DM_NEXTINT_VIA_NEXTDOUBLE">Dm: Use the nextInt method of Random rather than nextDouble to generate a random integer</a></td><td>Performance</td></tr>
377 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_CTOR">Dm: Method invokes inefficient new String(String) constructor</a></td><td>Performance</td></tr>
378 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_TOSTRING">Dm: Method invokes toString() method on a String</a></td><td>Performance</td></tr>
379 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_VOID_CTOR">Dm: Method invokes inefficient new String() constructor</a></td><td>Performance</td></tr>
380 <tr bgcolor="#eeeeee"><td><a href="#HSC_HUGE_SHARED_STRING_CONSTANT">HSC: Huge string constants is duplicated across multiple class files</a></td><td>Performance</td></tr>
381 <tr bgcolor="#ffffff"><td><a href="#IMA_INEFFICIENT_MEMBER_ACCESS">IMA: Method accesses a private member variable of owning class</a></td><td>Performance</td></tr>
382 <tr bgcolor="#eeeeee"><td><a href="#ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses toArray() with zero-length array argument</a></td><td>Performance</td></tr>
383 <tr bgcolor="#ffffff"><td><a href="#SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: Method concatenates strings using + in a loop</a></td><td>Performance</td></tr>
384 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a static inner class</a></td><td>Performance</td></tr>
385 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_ANON">SIC: Could be refactored into a named static inner class</a></td><td>Performance</td></tr>
386 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">SIC: Could be refactored into a static inner class</a></td><td>Performance</td></tr>
387 <tr bgcolor="#ffffff"><td><a href="#SS_SHOULD_BE_STATIC">SS: Unread field: should this field be static?</a></td><td>Performance</td></tr>
388 <tr bgcolor="#eeeeee"><td><a href="#UM_UNNECESSARY_MATH">UM: Method calls static Math class method on a constant value</a></td><td>Performance</td></tr>
389 <tr bgcolor="#ffffff"><td><a href="#UPM_UNCALLED_PRIVATE_METHOD">UPM: Private method is never called</a></td><td>Performance</td></tr>
390 <tr bgcolor="#eeeeee"><td><a href="#URF_UNREAD_FIELD">UrF: Unread field</a></td><td>Performance</td></tr>
391 <tr bgcolor="#ffffff"><td><a href="#UUF_UNUSED_FIELD">UuF: Unused field</a></td><td>Performance</td></tr>
392 <tr bgcolor="#eeeeee"><td><a href="#WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use of keySet iterator instead of entrySet iterator</a></td><td>Performance</td></tr>
393 <tr bgcolor="#ffffff"><td><a href="#DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded constant database password</a></td><td>Security</td></tr>
394 <tr bgcolor="#eeeeee"><td><a href="#DMI_EMPTY_DB_PASSWORD">Dm: Empty database password</a></td><td>Security</td></tr>
395 <tr bgcolor="#ffffff"><td><a href="#HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP cookie formed from untrusted input</a></td><td>Security</td></tr>
396 <tr bgcolor="#eeeeee"><td><a href="#HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: HTTP Response splitting vulnerability</a></td><td>Security</td></tr>
397 <tr bgcolor="#ffffff"><td><a href="#PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute path traversal in servlet</a></td><td>Security</td></tr>
398 <tr bgcolor="#eeeeee"><td><a href="#PT_RELATIVE_PATH_TRAVERSAL">PT: Relative path traversal in servlet</a></td><td>Security</td></tr>
399 <tr bgcolor="#ffffff"><td><a href="#SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQL: Nonconstant string passed to execute method on an SQL statement</a></td><td>Security</td></tr>
400 <tr bgcolor="#eeeeee"><td><a href="#SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING">SQL: A prepared statement is generated from a nonconstant String</a></td><td>Security</td></tr>
401 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JSP reflected cross site scripting vulnerability</a></td><td>Security</td></tr>
402 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_SEND_ERROR">XSS: Servlet reflected cross site scripting vulnerability in error page</a></td><td>Security</td></tr>
403 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS: Servlet reflected cross site scripting vulnerability</a></td><td>Security</td></tr>
404 <tr bgcolor="#eeeeee"><td><a href="#BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Questionable cast to abstract collection </a></td><td>Dodgy code</td></tr>
405 <tr bgcolor="#ffffff"><td><a href="#BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Questionable cast to concrete collection</a></td><td>Dodgy code</td></tr>
406 <tr bgcolor="#eeeeee"><td><a href="#BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirmed cast</a></td><td>Dodgy code</td></tr>
407 <tr bgcolor="#ffffff"><td><a href="#BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC: Unchecked/unconfirmed cast of return value from method</a></td><td>Dodgy code</td></tr>
408 <tr bgcolor="#eeeeee"><td><a href="#BC_VACUOUS_INSTANCEOF">BC: instanceof will always return true</a></td><td>Dodgy code</td></tr>
409 <tr bgcolor="#ffffff"><td><a href="#ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSHIFT: Unsigned right shift cast to short/byte</a></td><td>Dodgy code</td></tr>
410 <tr bgcolor="#eeeeee"><td><a href="#CD_CIRCULAR_DEPENDENCY">CD: Test for circular dependencies among classes</a></td><td>Dodgy code</td></tr>
411 <tr bgcolor="#ffffff"><td><a href="#CI_CONFUSED_INHERITANCE">CI: Class is final but declares protected field</a></td><td>Dodgy code</td></tr>
412 <tr bgcolor="#eeeeee"><td><a href="#DB_DUPLICATE_BRANCHES">DB: Method uses the same code for two branches</a></td><td>Dodgy code</td></tr>
413 <tr bgcolor="#ffffff"><td><a href="#DB_DUPLICATE_SWITCH_CLAUSES">DB: Method uses the same code for two switch clauses</a></td><td>Dodgy code</td></tr>
414 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE">DLS: Dead store to local variable</a></td><td>Dodgy code</td></tr>
415 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_IN_RETURN">DLS: Useless assignment in return statement</a></td><td>Dodgy code</td></tr>
416 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE_OF_NULL">DLS: Dead store of null to local variable</a></td><td>Dodgy code</td></tr>
417 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS: Dead store to local variable that shadows field</a></td><td>Dodgy code</td></tr>
418 <tr bgcolor="#eeeeee"><td><a href="#DMI_HARDCODED_ABSOLUTE_FILENAME">DMI: Code contains a hard coded reference to an absolute pathname</a></td><td>Dodgy code</td></tr>
419 <tr bgcolor="#ffffff"><td><a href="#DMI_NONSERIALIZABLE_OBJECT_WRITTEN">DMI: Non serializable object written to ObjectOutput</a></td><td>Dodgy code</td></tr>
420 <tr bgcolor="#eeeeee"><td><a href="#DMI_USELESS_SUBSTRING">DMI: Invocation of substring(0), which returns the original value</a></td><td>Dodgy code</td></tr>
421 <tr bgcolor="#ffffff"><td><a href="#DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">Dm: Thread passed where Runnable expected</a></td><td>Dodgy code</td></tr>
422 <tr bgcolor="#eeeeee"><td><a href="#DMI_UNSUPPORTED_METHOD">Dm: Call to unsupported method</a></td><td>Dodgy code</td></tr>
423 <tr bgcolor="#ffffff"><td><a href="#EQ_DOESNT_OVERRIDE_EQUALS">Eq: Class doesn't override equals in superclass</a></td><td>Dodgy code</td></tr>
424 <tr bgcolor="#eeeeee"><td><a href="#EQ_UNUSUAL">Eq: Unusual equals method </a></td><td>Dodgy code</td></tr>
425 <tr bgcolor="#ffffff"><td><a href="#FE_FLOATING_POINT_EQUALITY">FE: Test for floating point equality</a></td><td>Dodgy code</td></tr>
426 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">FS: Non-Boolean argument formatted using %b format specifier</a></td><td>Dodgy code</td></tr>
427 <tr bgcolor="#ffffff"><td><a href="#IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">IA: Potentially ambiguous invocation of either an inherited or outer method</a></td><td>Dodgy code</td></tr>
428 <tr bgcolor="#eeeeee"><td><a href="#IC_INIT_CIRCULARITY">IC: Initialization circularity</a></td><td>Dodgy code</td></tr>
429 <tr bgcolor="#ffffff"><td><a href="#ICAST_IDIV_CAST_TO_DOUBLE">ICAST: Integral division result cast to double or float</a></td><td>Dodgy code</td></tr>
430 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">ICAST: Result of integer multiplication cast to long</a></td><td>Dodgy code</td></tr>
431 <tr bgcolor="#ffffff"><td><a href="#IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">IM: Computation of average could overflow</a></td><td>Dodgy code</td></tr>
432 <tr bgcolor="#eeeeee"><td><a href="#IM_BAD_CHECK_FOR_ODD">IM: Check for oddness that won't work for negative numbers </a></td><td>Dodgy code</td></tr>
433 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_REM_BY_1">INT: Integer remainder modulo 1</a></td><td>Dodgy code</td></tr>
434 <tr bgcolor="#eeeeee"><td><a href="#INT_VACUOUS_BIT_OPERATION">INT: Vacuous bit mask operation on integer value</a></td><td>Dodgy code</td></tr>
435 <tr bgcolor="#ffffff"><td><a href="#INT_VACUOUS_COMPARISON">INT: Vacuous comparison of integer value</a></td><td>Dodgy code</td></tr>
436 <tr bgcolor="#eeeeee"><td><a href="#MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">MTIA: Class extends Servlet class and uses instance variables</a></td><td>Dodgy code</td></tr>
437 <tr bgcolor="#ffffff"><td><a href="#MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">MTIA: Class extends Struts Action class and uses instance variables</a></td><td>Dodgy code</td></tr>
438 <tr bgcolor="#eeeeee"><td><a href="#NP_DEREFERENCE_OF_READLINE_VALUE">NP: Dereference of the result of readLine() without nullcheck</a></td><td>Dodgy code</td></tr>
439 <tr bgcolor="#ffffff"><td><a href="#NP_IMMEDIATE_DEREFERENCE_OF_READLINE">NP: Immediate dereference of the result of readLine()</a></td><td>Dodgy code</td></tr>
440 <tr bgcolor="#eeeeee"><td><a href="#NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value</a></td><td>Dodgy code</td></tr>
441 <tr bgcolor="#ffffff"><td><a href="#NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullness annotation on parameter</a></td><td>Dodgy code</td></tr>
442 <tr bgcolor="#eeeeee"><td><a href="#NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Method relaxes nullness annotation on return value</a></td><td>Dodgy code</td></tr>
443 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP: Possible null pointer dereference due to return value of called method</a></td><td>Dodgy code</td></tr>
444 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP: Possible null pointer dereference on branch that might be infeasible</a></td><td>Dodgy code</td></tr>
445 <tr bgcolor="#ffffff"><td><a href="#NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP: Parameter must be nonnull but is marked as nullable</a></td><td>Dodgy code</td></tr>
446 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP: Read of unwritten public or protected field</a></td><td>Dodgy code</td></tr>
447 <tr bgcolor="#ffffff"><td><a href="#NS_DANGEROUS_NON_SHORT_CIRCUIT">NS: Potentially dangerous use of non-short-circuit logic</a></td><td>Dodgy code</td></tr>
448 <tr bgcolor="#eeeeee"><td><a href="#NS_NON_SHORT_CIRCUIT">NS: Questionable use of non-short-circuit logic</a></td><td>Dodgy code</td></tr>
449 <tr bgcolor="#ffffff"><td><a href="#PS_PUBLIC_SEMAPHORES">PS: Class exposes synchronization and semaphores in its public interface</a></td><td>Dodgy code</td></tr>
450 <tr bgcolor="#eeeeee"><td><a href="#PZLA_PREFER_ZERO_LENGTH_ARRAYS">PZLA: Consider returning a zero length array rather than null</a></td><td>Dodgy code</td></tr>
451 <tr bgcolor="#ffffff"><td><a href="#QF_QUESTIONABLE_FOR_LOOP">QF: Complicated, subtle or wrong increment in for-loop </a></td><td>Dodgy code</td></tr>
452 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE">RCN: Redundant comparison of non-null value to null</a></td><td>Dodgy code</td></tr>
453 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">RCN: Redundant comparison of two null values</a></td><td>Dodgy code</td></tr>
454 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">RCN: Redundant nullcheck of value known to be non-null</a></td><td>Dodgy code</td></tr>
455 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN: Redundant nullcheck of value known to be null</a></td><td>Dodgy code</td></tr>
456 <tr bgcolor="#eeeeee"><td><a href="#REC_CATCH_EXCEPTION">REC: Exception is caught when Exception is not thrown</a></td><td>Dodgy code</td></tr>
457 <tr bgcolor="#ffffff"><td><a href="#RI_REDUNDANT_INTERFACES">RI: Class implements same interface as superclass</a></td><td>Dodgy code</td></tr>
458 <tr bgcolor="#eeeeee"><td><a href="#RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method checks to see if result of String.indexOf is positive</a></td><td>Dodgy code</td></tr>
459 <tr bgcolor="#ffffff"><td><a href="#RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method discards result of readLine after checking if it is nonnull</a></td><td>Dodgy code</td></tr>
460 <tr bgcolor="#eeeeee"><td><a href="#RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative</a></td><td>Dodgy code</td></tr>
461 <tr bgcolor="#ffffff"><td><a href="#RV_REM_OF_RANDOM_INT">RV: Remainder of 32-bit signed random integer</a></td><td>Dodgy code</td></tr>
462 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_INFERRED">RV: Method ignores return value, is this OK?</a></td><td>Dodgy code</td></tr>
463 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field</a></td><td>Dodgy code</td></tr>
464 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assignment of local variable </a></td><td>Dodgy code</td></tr>
465 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignment of local variable</a></td><td>Dodgy code</td></tr>
466 <tr bgcolor="#eeeeee"><td><a href="#SF_SWITCH_FALLTHROUGH">SF: Switch statement found where one case falls through to the next case</a></td><td>Dodgy code</td></tr>
467 <tr bgcolor="#ffffff"><td><a href="#SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case is missing</a></td><td>Dodgy code</td></tr>
468 <tr bgcolor="#eeeeee"><td><a href="#ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST: Write to static field from instance method</a></td><td>Dodgy code</td></tr>
469 <tr bgcolor="#ffffff"><td><a href="#SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">Se: Private readResolve method not inherited by subclasses</a></td><td>Dodgy code</td></tr>
470 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS">Se: Transient field of class that isn't Serializable. </a></td><td>Dodgy code</td></tr>
471 <tr bgcolor="#ffffff"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK">TQ: Value required to have type qualifier, but marked as unknown</a></td><td>Dodgy code</td></tr>
472 <tr bgcolor="#eeeeee"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value required to not have type qualifier, but marked as unknown</a></td><td>Dodgy code</td></tr>
473 <tr bgcolor="#ffffff"><td><a href="#UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow</a></td><td>Dodgy code</td></tr>
474 <tr bgcolor="#eeeeee"><td><a href="#UCF_USELESS_CONTROL_FLOW_NEXT_LINE">UCF: Useless control flow to next line</a></td><td>Dodgy code</td></tr>
475 <tr bgcolor="#ffffff"><td><a href="#USM_USELESS_ABSTRACT_METHOD">USM: Abstract Method is already defined in implemented interface</a></td><td>Dodgy code</td></tr>
476 <tr bgcolor="#eeeeee"><td><a href="#USM_USELESS_SUBCLASS_METHOD">USM: Method superfluously delegates to parent class method</a></td><td>Dodgy code</td></tr>
477 <tr bgcolor="#ffffff"><td><a href="#URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">UrF: Unread public/protected field</a></td><td>Dodgy code</td></tr>
478 <tr bgcolor="#eeeeee"><td><a href="#UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UuF: Unused public or protected field</a></td><td>Dodgy code</td></tr>
479 <tr bgcolor="#ffffff"><td><a href="#UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">UwF: Field not initialized in constructor but dereferenced without null check</a></td><td>Dodgy code</td></tr>
480 <tr bgcolor="#eeeeee"><td><a href="#UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UwF: Unwritten public or protected field</a></td><td>Dodgy code</td></tr>
481 <tr bgcolor="#ffffff"><td><a href="#XFB_XML_FACTORY_BYPASS">XFB: Method directly allocates a specific implementation of xml interfaces</a></td><td>Dodgy code</td></tr>
482 </table>
483 <h2>Descriptions</h2>
484 <h3><a name="AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates an empty jar file entry (AM_CREATES_EMPTY_JAR_FILE_ENTRY)</a></h3>
485
486
487 <p>The code calls <code>putNextEntry()</code>, immediately
488 followed by a call to <code>closeEntry()</code>. This results
489 in an empty JarFile entry. The contents of the entry
490 should be written to the JarFile between the calls to
491 <code>putNextEntry()</code> and
492 <code>closeEntry()</code>.</p>
493
494
495 <h3><a name="AM_CREATES_EMPTY_ZIP_FILE_ENTRY">AM: Creates an empty zip file entry (AM_CREATES_EMPTY_ZIP_FILE_ENTRY)</a></h3>
496
497
498 <p>The code calls <code>putNextEntry()</code>, immediately
499 followed by a call to <code>closeEntry()</code>. This results
500 in an empty ZipFile entry. The contents of the entry
501 should be written to the ZipFile between the calls to
502 <code>putNextEntry()</code> and
503 <code>closeEntry()</code>.</p>
504
505
506 <h3><a name="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS">BC: Equals method should not assume anything about the type of its argument (BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS)</a></h3>
507
508
509 <p>
510 The <code>equals(Object o)</code> method shouldn't make any assumptions
511 about the type of <code>o</code>. It should simply return
512 false if <code>o</code> is not the same type as <code>this</code>.
513 </p>
514
515
516 <h3><a name="BIT_SIGNED_CHECK">BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK)</a></h3>
517
518
519 <p> This method compares an expression such as</p>
520 <pre>((event.detail &amp; SWT.SELECTED) &gt; 0)</pre>.
521 <p>Using bit arithmetic and then comparing with the greater than operator can
522 lead to unexpected results (of course depending on the value of
523 SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate
524 for a bug. Even when SWT.SELECTED is not negative, it seems good practice
525 to use '!= 0' instead of '&gt; 0'.
526 </p>
527 <p>
528 <em>Boris Bokowski</em>
529 </p>
530
531
532 <h3><a name="CN_IDIOM">CN: Class implements Cloneable but does not define or use clone method (CN_IDIOM)</a></h3>
533
534
535 <p>
536 Class implements Cloneable but does not define or
537 use the clone method.</p>
538
539
540 <h3><a name="CN_IDIOM_NO_SUPER_CALL">CN: clone method does not call super.clone() (CN_IDIOM_NO_SUPER_CALL)</a></h3>
541
542
543 <p> This non-final class defines a clone() method that does not call super.clone().
544 If this class ("<i>A</i>") is extended by a subclass ("<i>B</i>"),
545 and the subclass <i>B</i> calls super.clone(), then it is likely that
546 <i>B</i>'s clone() method will return an object of type <i>A</i>,
547 which violates the standard contract for clone().</p>
548
549 <p> If all clone() methods call super.clone(), then they are guaranteed
550 to use Object.clone(), which always returns an object of the correct type.</p>
551
552
553 <h3><a name="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: Class defines clone() but doesn't implement Cloneable (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE)</a></h3>
554
555
556 <p> This class defines a clone() method but the class doesn't implement Cloneable.
557 There are some situations in which this is OK (e.g., you want to control how subclasses
558 can clone themselves), but just make sure that this is what you intended.
559 </p>
560
561
562 <h3><a name="CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo() method (CO_ABSTRACT_SELF)</a></h3>
563
564
565 <p> This class defines a covariant version of <code>compareTo()</code>.&nbsp;
566 To correctly override the <code>compareTo()</code> method in the
567 <code>Comparable</code> interface, the parameter of <code>compareTo()</code>
568 must have type <code>java.lang.Object</code>.</p>
569
570
571 <h3><a name="CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined (CO_SELF_NO_OBJECT)</a></h3>
572
573
574 <p> This class defines a covariant version of <code>compareTo()</code>.&nbsp;
575 To correctly override the <code>compareTo()</code> method in the
576 <code>Comparable</code> interface, the parameter of <code>compareTo()</code>
577 must have type <code>java.lang.Object</code>.</p>
578
579
580 <h3><a name="DE_MIGHT_DROP">DE: Method might drop exception (DE_MIGHT_DROP)</a></h3>
581
582
583 <p> This method might drop an exception.&nbsp; In general, exceptions
584 should be handled or reported in some way, or they should be thrown
585 out of the method.</p>
586
587
588 <h3><a name="DE_MIGHT_IGNORE">DE: Method might ignore exception (DE_MIGHT_IGNORE)</a></h3>
589
590
591 <p> This method might ignore an exception.&nbsp; In general, exceptions
592 should be handled or reported in some way, or they should be thrown
593 out of the method.</p>
594
595
596 <h3><a name="DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI: Adding elements of an entry set may fail due to reuse of Entry objects (DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS)</a></h3>
597
598
599 <p> The entrySet() method is allowed to return a view of the
600 underlying Map in which a single Entry object is reused and returned
601 during the iteration. As of Java 1.6, both IdentityHashMap
602 and EnumMap did so. When iterating through such a Map,
603 the Entry value is only valid until you advance to the next iteration.
604 If, for example, you try to pass such an entrySet to an addAll method,
605 things will go badly wrong.
606 </p>
607
608
609 <h3><a name="DMI_RANDOM_USED_ONLY_ONCE">DMI: Random object created and used only once (DMI_RANDOM_USED_ONLY_ONCE)</a></h3>
610
611
612 <p> This code creates a java.util.Random object, uses it to generate one random number, and then discards
613 the Random object. This produces mediocre quality random numbers and is inefficient.
614 If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number
615 is required invoke a method on the existing Random object to obtain it.
616 </p>
617
618 <p>If it is important that the generated Random numbers not be guessable, you <em>must</em> not create a new Random for each random
619 number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead
620 (and avoid allocating a new SecureRandom for each random number needed).
621 </p>
622
623
624 <h3><a name="DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">DMI: Don't use removeAll to clear a collection (DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION)</a></h3>
625
626
627 <p> If you want to remove all elements from a collection <code>c</code>, use <code>c.clear</code>,
628 not <code>c.removeAll(c)</code>. Calling <code>c.removeAll(c)</code> to clear a collection
629 is less clear, susceptible to errors from typos, less efficient and
630 for some collections, might throw a <code>ConcurrentModificationException</code>.
631 </p>
632
633
634 <h3><a name="DM_EXIT">Dm: Method invokes System.exit(...) (DM_EXIT)</a></h3>
635
636
637 <p> Invoking System.exit shuts down the entire Java virtual machine. This
638 should only been done when it is appropriate. Such calls make it
639 hard or impossible for your code to be invoked by other code.
640 Consider throwing a RuntimeException instead.</p>
641
642
643 <h3><a name="DM_RUN_FINALIZERS_ON_EXIT">Dm: Method invokes dangerous method runFinalizersOnExit (DM_RUN_FINALIZERS_ON_EXIT)</a></h3>
644
645
646 <p> <em>Never call System.runFinalizersOnExit
647 or Runtime.runFinalizersOnExit for any reason: they are among the most
648 dangerous methods in the Java libraries.</em> -- Joshua Bloch</p>
649
650
651 <h3><a name="ES_COMPARING_PARAMETER_STRING_WITH_EQ">ES: Comparison of String parameter using == or != (ES_COMPARING_PARAMETER_STRING_WITH_EQ)</a></h3>
652
653
654 <p>This code compares a <code>java.lang.String</code> parameter for reference
655 equality using the == or != operators. Requiring callers to
656 pass only String constants or interned strings to a method is unnecessarily
657 fragile, and rarely leads to measurable performance gains. Consider
658 using the <code>equals(Object)</code> method instead.</p>
659
660
661 <h3><a name="ES_COMPARING_STRINGS_WITH_EQ">ES: Comparison of String objects using == or != (ES_COMPARING_STRINGS_WITH_EQ)</a></h3>
662
663
664 <p>This code compares <code>java.lang.String</code> objects for reference
665 equality using the == or != operators.
666 Unless both strings are either constants in a source file, or have been
667 interned using the <code>String.intern()</code> method, the same string
668 value may be represented by two different String objects. Consider
669 using the <code>equals(Object)</code> method instead.</p>
670
671
672 <h3><a name="EQ_ABSTRACT_SELF">Eq: Abstract class defines covariant equals() method (EQ_ABSTRACT_SELF)</a></h3>
673
674
675 <p> This class defines a covariant version of <code>equals()</code>.&nbsp;
676 To correctly override the <code>equals()</code> method in
677 <code>java.lang.Object</code>, the parameter of <code>equals()</code>
678 must have type <code>java.lang.Object</code>.</p>
679
680
681 <h3><a name="EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS">Eq: Equals checks for incompatible operand (EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS)</a></h3>
682
683
684 <p> This equals method is checking to see if the argument is some incompatible type
685 (i.e., a class that is neither a supertype nor subtype of the class that defines
686 the equals method). For example, the Foo class might have an equals method
687 that looks like:
688 </p>
689 <pre>
690 public boolean equals(Object o) {
691 if (o instanceof Foo)
692 return name.equals(((Foo)o).name);
693 else if (o instanceof String)
694 return name.equals(o);
695 else return false;
696 </pre>
697
698 <p>This is considered bad practice, as it makes it very hard to implement an equals method that
699 is symmetric and transitive. Without those properties, very unexpected behavoirs are possible.
700 </p>
701
702
703 <h3><a name="EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) and uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS)</a></h3>
704
705
706 <p> This class defines a <code>compareTo(...)</code> method but inherits its
707 <code>equals()</code> method from <code>java.lang.Object</code>.
708 Generally, the value of compareTo should return zero if and only if
709 equals returns true. If this is violated, weird and unpredictable
710 failures will occur in classes such as PriorityQueue.
711 In Java 5 the PriorityQueue.remove method uses the compareTo method,
712 while in Java 6 it uses the equals method.
713
714 <p>From the JavaDoc for the compareTo method in the Comparable interface:
715 <blockquote>
716 It is strongly recommended, but not strictly required that <code>(x.compareTo(y)==0) == (x.equals(y))</code>.
717 Generally speaking, any class that implements the Comparable interface and violates this condition
718 should clearly indicate this fact. The recommended language
719 is "Note: this class has a natural ordering that is inconsistent with equals."
720 </blockquote>
721
722
723 <h3><a name="EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtypes (EQ_GETCLASS_AND_CLASS_CONSTANT)</a></h3>
724
725
726 <p> This class has an equals method that will be broken if it is inherited by subclasses.
727 It compares a class literal with the class of the argument (e.g., in class <code>Foo</code>
728 it might check if <code>Foo.class == o.getClass()</code>).
729 It is better to check if <code>this.getClass() == o.getClass()</code>.
730 </p>
731
732
733 <h3><a name="EQ_SELF_NO_OBJECT">Eq: Covariant equals() method defined (EQ_SELF_NO_OBJECT)</a></h3>
734
735
736 <p> This class defines a covariant version of <code>equals()</code>.&nbsp;
737 To correctly override the <code>equals()</code> method in
738 <code>java.lang.Object</code>, the parameter of <code>equals()</code>
739 must have type <code>java.lang.Object</code>.</p>
740
741
742 <h3><a name="FI_EMPTY">FI: Empty finalizer should be deleted (FI_EMPTY)</a></h3>
743
744
745 <p> Empty <code>finalize()</code> methods are useless, so they should
746 be deleted.</p>
747
748
749 <h3><a name="FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer (FI_EXPLICIT_INVOCATION)</a></h3>
750
751
752 <p> This method contains an explicit invocation of the <code>finalize()</code>
753 method on an object.&nbsp; Because finalizer methods are supposed to be
754 executed once, and only by the VM, this is a bad idea.</p>
755 <p>If a connected set of objects beings finalizable, then the VM will invoke the
756 finalize method on all the finalizable object, possibly at the same time in different threads.
757 Thus, it is a particularly bad idea, in the finalize method for a class X, invoke finalize
758 on objects referenced by X, because they may already be getting finalized in a separate thread.
759
760
761 <h3><a name="FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields (FI_FINALIZER_NULLS_FIELDS)</a></h3>
762
763
764 <p> This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection,
765 and the object is going to be garbage collected anyway.
766
767
768 <h3><a name="FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields (FI_FINALIZER_ONLY_NULLS_FIELDS)</a></h3>
769
770
771 <p> This finalizer does nothing except null out fields. This is completely pointless, and requires that
772 the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize
773 method.
774
775
776 <h3><a name="FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass finalizer (FI_MISSING_SUPER_CALL)</a></h3>
777
778
779 <p> This <code>finalize()</code> method does not make a call to its
780 superclass's <code>finalize()</code> method.&nbsp; So, any finalizer
781 actions defined for the superclass will not be performed.&nbsp;
782 Add a call to <code>super.finalize()</code>.</p>
783
784
785 <h3><a name="FI_NULLIFY_SUPER">FI: Finalizer nullifies superclass finalizer (FI_NULLIFY_SUPER)</a></h3>
786
787
788 <p> This empty <code>finalize()</code> method explicitly negates the
789 effect of any finalizer defined by its superclass.&nbsp; Any finalizer
790 actions defined for the superclass will not be performed.&nbsp;
791 Unless this is intended, delete this method.</p>
792
793
794 <h3><a name="FI_USELESS">FI: Finalizer does nothing but call superclass finalizer (FI_USELESS)</a></h3>
795
796
797 <p> The only thing this <code>finalize()</code> method does is call
798 the superclass's <code>finalize()</code> method, making it
799 redundant.&nbsp; Delete it.</p>
800
801
802 <h3><a name="VA_FORMAT_STRING_USES_NEWLINE">FS: Format string should use %n rather than \n (VA_FORMAT_STRING_USES_NEWLINE)</a></h3>
803
804
805 <p>
806 This format string include a newline character (\n). In format strings, it is generally
807 preferable better to use %n, which will produce the platform-specific line separator.
808 </p>
809
810
811 <h3><a name="GC_UNCHECKED_TYPE_IN_GENERIC_CALL">GC: Unchecked type in generic call (GC_UNCHECKED_TYPE_IN_GENERIC_CALL)</a></h3>
812
813
814 <p> This call to a generic collection method passes an argument
815 while compile type Object where a specific type from
816 the generic type parameters is expected.
817 Thus, neither the standard Java type system nor static analysis
818 can provide useful information on whether the
819 object being passed as a parameter is of an appropriate type.
820 </p>
821
822
823 <h3><a name="HE_EQUALS_NO_HASHCODE">HE: Class defines equals() but not hashCode() (HE_EQUALS_NO_HASHCODE)</a></h3>
824
825
826 <p> This class overrides <code>equals(Object)</code>, but does not
827 override <code>hashCode()</code>.&nbsp; Therefore, the class may violate the
828 invariant that equal objects must have equal hashcodes.</p>
829
830
831 <h3><a name="HE_EQUALS_USE_HASHCODE">HE: Class defines equals() and uses Object.hashCode() (HE_EQUALS_USE_HASHCODE)</a></h3>
832
833
834 <p> This class overrides <code>equals(Object)</code>, but does not
835 override <code>hashCode()</code>, and inherits the implementation of
836 <code>hashCode()</code> from <code>java.lang.Object</code> (which returns
837 the identity hash code, an arbitrary value assigned to the object
838 by the VM).&nbsp; Therefore, the class is very likely to violate the
839 invariant that equal objects must have equal hashcodes.</p>
840
841 <p>If you don't think instances of this class will ever be inserted into a HashMap/HashTable,
842 the recommended <code>hashCode</code> implementation to use is:</p>
843 <pre>public int hashCode() {
844 assert false : "hashCode not designed";
845 return 42; // any arbitrary constant will do
846 }</pre>
847
848
849 <h3><a name="HE_HASHCODE_NO_EQUALS">HE: Class defines hashCode() but not equals() (HE_HASHCODE_NO_EQUALS)</a></h3>
850
851
852 <p> This class defines a <code>hashCode()</code> method but not an
853 <code>equals()</code> method.&nbsp; Therefore, the class may
854 violate the invariant that equal objects must have equal hashcodes.</p>
855
856
857 <h3><a name="HE_HASHCODE_USE_OBJECT_EQUALS">HE: Class defines hashCode() and uses Object.equals() (HE_HASHCODE_USE_OBJECT_EQUALS)</a></h3>
858
859
860 <p> This class defines a <code>hashCode()</code> method but inherits its
861 <code>equals()</code> method from <code>java.lang.Object</code>
862 (which defines equality by comparing object references).&nbsp; Although
863 this will probably satisfy the contract that equal objects must have
864 equal hashcodes, it is probably not what was intended by overriding
865 the <code>hashCode()</code> method.&nbsp; (Overriding <code>hashCode()</code>
866 implies that the object's identity is based on criteria more complicated
867 than simple reference equality.)</p>
868 <p>If you don't think instances of this class will ever be inserted into a HashMap/HashTable,
869 the recommended <code>hashCode</code> implementation to use is:</p>
870 <pre>public int hashCode() {
871 assert false : "hashCode not designed";
872 return 42; // any arbitrary constant will do
873 }</pre>
874
875
876 <h3><a name="HE_INHERITS_EQUALS_USE_HASHCODE">HE: Class inherits equals() and uses Object.hashCode() (HE_INHERITS_EQUALS_USE_HASHCODE)</a></h3>
877
878
879 <p> This class inherits <code>equals(Object)</code> from an abstract
880 superclass, and <code>hashCode()</code> from
881 <code>java.lang.Object</code> (which returns
882 the identity hash code, an arbitrary value assigned to the object
883 by the VM).&nbsp; Therefore, the class is very likely to violate the
884 invariant that equal objects must have equal hashcodes.</p>
885
886 <p>If you don't want to define a hashCode method, and/or don't
887 believe the object will ever be put into a HashMap/Hashtable,
888 define the <code>hashCode()</code> method
889 to throw <code>UnsupportedOperationException</code>.</p>
890
891
892 <h3><a name="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION">IC: Superclass uses subclass during initialization (IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION)</a></h3>
893
894
895 <p> During the initialization of a class, the class makes an active use of a subclass.
896 That subclass will not yet be initialized at the time of this use.
897 For example, in the following code, <code>foo</code> will be null.</p>
898
899 <pre>
900 public class CircularClassInitialization {
901 static class InnerClassSingleton extends CircularClassInitialization {
902 static InnerClassSingleton singleton = new InnerClassSingleton();
903 }
904
905 static CircularClassInitialization foo = InnerClassSingleton.singleton;
906 }
907 </pre>
908
909
910
911 <h3><a name="IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching of IllegalMonitorStateException (IMSE_DONT_CATCH_IMSE)</a></h3>
912
913
914 <p>IllegalMonitorStateException is generally only
915 thrown in case of a design flaw in your code (calling wait or
916 notify on an object you do not hold a lock on).</p>
917
918
919 <h3><a name="ISC_INSTANTIATE_STATIC_CLASS">ISC: Needless instantiation of class that only supplies static methods (ISC_INSTANTIATE_STATIC_CLASS)</a></h3>
920
921
922 <p> This class allocates an object that is based on a class that only supplies static methods. This object
923 does not need to be created, just access the static methods directly using the class name as a qualifier.</p>
924
925
926 <h3><a name="IT_NO_SUCH_ELEMENT">It: Iterator next() method can't throw NoSuchElementException (IT_NO_SUCH_ELEMENT)</a></h3>
927
928
929 <p> This class implements the <code>java.util.Iterator</code> interface.&nbsp;
930 However, its <code>next()</code> method is not capable of throwing
931 <code>java.util.NoSuchElementException</code>.&nbsp; The <code>next()</code>
932 method should be changed so it throws <code>NoSuchElementException</code>
933 if is called when there are no more elements to return.</p>
934
935
936 <h3><a name="J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION">J2EE: Store of non serializable object into HttpSession (J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION)</a></h3>
937
938
939 <p>
940 This code seems to be storing a non-serializable object into an HttpSession.
941 If this session is passivated or migrated, an error will result.
942 </p>
943
944
945 <h3><a name="JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP: Fields of immutable classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS)</a></h3>
946
947
948 <p> The class is annotated with net.jcip.annotations.Immutable or javax.annotation.concurrent.Immutable,
949 and the rules for those annotations require that all fields are final.
950 .</p>
951
952
953 <h3><a name="NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns explicit null (NP_BOOLEAN_RETURN_NULL)</a></h3>
954
955
956 <p>
957 A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen.
958 This method can be invoked as though it returned a value of type boolean, and
959 the compiler will insert automatic unboxing of the Boolean value. If a null value is returned,
960 this will result in a NullPointerException.
961 </p>
962
963
964 <h3><a name="NP_CLONE_COULD_RETURN_NULL">NP: Clone method may return null (NP_CLONE_COULD_RETURN_NULL)</a></h3>
965
966
967 <p>
968 This clone method seems to return null in some circumstances, but clone is never
969 allowed to return a null value. If you are convinced this path is unreachable, throw an AssertionError
970 instead.
971 </p>
972
973
974 <h3><a name="NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT">NP: equals() method does not check for null argument (NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT)</a></h3>
975
976
977 <p>
978 This implementation of equals(Object) violates the contract defined
979 by java.lang.Object.equals() because it does not check for null
980 being passed as the argument. All equals() methods should return
981 false if passed a null value.
982 </p>
983
984
985 <h3><a name="NP_TOSTRING_COULD_RETURN_NULL">NP: toString method may return null (NP_TOSTRING_COULD_RETURN_NULL)</a></h3>
986
987
988 <p>
989 This toString method seems to return null in some circumstances. A liberal reading of the
990 spec could be interpreted as allowing this, but it is probably a bad idea and could cause
991 other code to break. Return the empty string or some other appropriate string rather than null.
992 </p>
993
994
995 <h3><a name="NM_CLASS_NAMING_CONVENTION">Nm: Class names should start with an upper case letter (NM_CLASS_NAMING_CONVENTION)</a></h3>
996
997
998 <p> Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).
999 </p>
1000
1001
1002 <h3><a name="NM_CLASS_NOT_EXCEPTION">Nm: Class is not derived from an Exception, even though it is named as such (NM_CLASS_NOT_EXCEPTION)</a></h3>
1003
1004
1005 <p> This class is not derived from another exception, but ends with 'Exception'. This will
1006 be confusing to users of this class.</p>
1007
1008
1009 <h3><a name="NM_CONFUSING">Nm: Confusing method names (NM_CONFUSING)</a></h3>
1010
1011
1012 <p> The referenced methods have names that differ only by capitalization.</p>
1013
1014
1015 <h3><a name="NM_FIELD_NAMING_CONVENTION">Nm: Field names should start with a lower case letter (NM_FIELD_NAMING_CONVENTION)</a></h3>
1016
1017
1018 <p>
1019 Names of fields that are not final should be in mixed case with a lowercase first letter and the first letters of subsequent words capitalized.
1020 </p>
1021
1022
1023 <h3><a name="NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER">Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER)</a></h3>
1024
1025
1026 <p>The identifier is a word that is reserved as a keyword in later versions of Java, and your code will need to be changed
1027 in order to compile it in later versions of Java.</p>
1028
1029
1030
1031 <h3><a name="NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER">Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER)</a></h3>
1032
1033
1034 <p>This identifier is used as a keyword in later versions of Java. This code, and
1035 any code that references this API,
1036 will need to be changed in order to compile it in later versions of Java.</p>
1037
1038
1039
1040 <h3><a name="NM_METHOD_NAMING_CONVENTION">Nm: Method names should start with a lower case letter (NM_METHOD_NAMING_CONVENTION)</a></h3>
1041
1042
1043 <p>
1044 Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
1045 </p>
1046
1047
1048 <h3><a name="NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class names shouldn't shadow simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE)</a></h3>
1049
1050
1051 <p> This class/interface has a simple name that is identical to that of an implemented/extended interface, except
1052 that the interface is in a different package (e.g., <code>alpha.Foo</code> extends <code>beta.Foo</code>).
1053 This can be exceptionally confusing, create lots of situations in which you have to look at import statements
1054 to resolve references and creates many
1055 opportunities to accidently define methods that do not override methods in their superclasses.
1056 </p>
1057
1058
1059 <h3><a name="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class names shouldn't shadow simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS)</a></h3>
1060
1061
1062 <p> This class has a simple name that is identical to that of its superclass, except
1063 that its superclass is in a different package (e.g., <code>alpha.Foo</code> extends <code>beta.Foo</code>).
1064 This can be exceptionally confusing, create lots of situations in which you have to look at import statements
1065 to resolve references and creates many
1066 opportunities to accidently define methods that do not override methods in their superclasses.
1067 </p>
1068
1069
1070 <h3><a name="NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL)</a></h3>
1071
1072
1073 <p> The referenced methods have names that differ only by capitalization.
1074 This is very confusing because if the capitalization were
1075 identical then one of the methods would override the other. From the existence of other methods, it
1076 seems that the existence of both of these methods is intentional, but is sure is confusing.
1077 You should try hard to eliminate one of them, unless you are forced to have both due to frozen APIs.
1078 </p>
1079
1080
1081 <h3><a name="NM_WRONG_PACKAGE_INTENTIONAL">Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE_INTENTIONAL)</a></h3>
1082
1083
1084 <p> The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match
1085 the type of the corresponding parameter in the superclass. For example, if you have:</p>
1086
1087 <blockquote>
1088 <pre>
1089 import alpha.Foo;
1090 public class A {
1091 public int f(Foo x) { return 17; }
1092 }
1093 ----
1094 import beta.Foo;
1095 public class B extends A {
1096 public int f(Foo x) { return 42; }
1097 public int f(alpha.Foo x) { return 27; }
1098 }
1099 </pre>
1100 </blockquote>
1101
1102 <p>The <code>f(Foo)</code> method defined in class <code>B</code> doesn't
1103 override the
1104 <code>f(Foo)</code> method defined in class <code>A</code>, because the argument
1105 types are <code>Foo</code>'s from different packages.
1106 </p>
1107
1108 <p>In this case, the subclass does define a method with a signature identical to the method in the superclass,
1109 so this is presumably understood. However, such methods are exceptionally confusing. You should strongly consider
1110 removing or deprecating the method with the similar but not identical signature.
1111 </p>
1112
1113
1114 <h3><a name="ODR_OPEN_DATABASE_RESOURCE">ODR: Method may fail to close database resource (ODR_OPEN_DATABASE_RESOURCE)</a></h3>
1115
1116
1117 <p> The method creates a database resource (such as a database connection
1118 or row set), does not assign it to any
1119 fields, pass it to other methods, or return it, and does not appear to close
1120 the object on all paths out of the method.&nbsp; Failure to
1121 close database resources on all paths out of a method may
1122 result in poor performance, and could cause the application to
1123 have problems communicating with the database.
1124 </p>
1125
1126
1127 <h3><a name="ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH">ODR: Method may fail to close database resource on exception (ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH)</a></h3>
1128
1129
1130 <p> The method creates a database resource (such as a database connection
1131 or row set), does not assign it to any
1132 fields, pass it to other methods, or return it, and does not appear to close
1133 the object on all exception paths out of the method.&nbsp; Failure to
1134 close database resources on all paths out of a method may
1135 result in poor performance, and could cause the application to
1136 have problems communicating with the database.</p>
1137
1138
1139 <h3><a name="OS_OPEN_STREAM">OS: Method may fail to close stream (OS_OPEN_STREAM)</a></h3>
1140
1141
1142 <p> The method creates an IO stream object, does not assign it to any
1143 fields, pass it to other methods that might close it,
1144 or return it, and does not appear to close
1145 the stream on all paths out of the method.&nbsp; This may result in
1146 a file descriptor leak.&nbsp; It is generally a good
1147 idea to use a <code>finally</code> block to ensure that streams are
1148 closed.</p>
1149
1150
1151 <h3><a name="OS_OPEN_STREAM_EXCEPTION_PATH">OS: Method may fail to close stream on exception (OS_OPEN_STREAM_EXCEPTION_PATH)</a></h3>
1152
1153
1154 <p> The method creates an IO stream object, does not assign it to any
1155 fields, pass it to other methods, or return it, and does not appear to close
1156 it on all possible exception paths out of the method.&nbsp;
1157 This may result in a file descriptor leak.&nbsp; It is generally a good
1158 idea to use a <code>finally</code> block to ensure that streams are
1159 closed.</p>
1160
1161
1162 <h3><a name="PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">PZ: Don't reuse entry objects in iterators (PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS)</a></h3>
1163
1164
1165 <p> The entrySet() method is allowed to return a view of the
1166 underlying Map in which an Iterator and Map.Entry. This clever
1167 idea was used in several Map implementations, but introduces the possibility
1168 of nasty coding mistakes. If a map <code>m</code> returns
1169 such an iterator for an entrySet, then
1170 <code>c.addAll(m.entrySet())</code> will go badly wrong. All of
1171 the Map implementations in OpenJDK 1.7 have been rewritten to avoid this,
1172 you should to.
1173 </p>
1174
1175
1176 <h3><a name="RC_REF_COMPARISON_BAD_PRACTICE">RC: Suspicious reference comparison to constant (RC_REF_COMPARISON_BAD_PRACTICE)</a></h3>
1177
1178
1179 <p> This method compares a reference value to a constant using the == or != operator,
1180 where the correct way to compare instances of this type is generally
1181 with the equals() method.
1182 It is possible to create distinct instances that are equal but do not compare as == since
1183 they are different objects.
1184 Examples of classes which should generally
1185 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p>
1186
1187
1188 <h3><a name="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN">RC: Suspicious reference comparison of Boolean values (RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN)</a></h3>
1189
1190
1191 <p> This method compares two Boolean values using the == or != operator.
1192 Normally, there are only two Boolean values (Boolean.TRUE and Boolean.FALSE),
1193 but it is possible to create other Boolean objects using the <code>new Boolean(b)</code>
1194 constructor. It is best to avoid such objects, but if they do exist,
1195 then checking Boolean objects for equality using == or != will give results
1196 than are different than you would get using <code>.equals(...)</code>
1197 </p>
1198
1199
1200 <h3><a name="RR_NOT_CHECKED">RR: Method ignores results of InputStream.read() (RR_NOT_CHECKED)</a></h3>
1201
1202
1203 <p> This method ignores the return value of one of the variants of
1204 <code>java.io.InputStream.read()</code> which can return multiple bytes.&nbsp;
1205 If the return value is not checked, the caller will not be able to correctly
1206 handle the case where fewer bytes were read than the caller requested.&nbsp;
1207 This is a particularly insidious kind of bug, because in many programs,
1208 reads from input streams usually do read the full amount of data requested,
1209 causing the program to fail only sporadically.</p>
1210
1211
1212 <h3><a name="SR_NOT_CHECKED">RR: Method ignores results of InputStream.skip() (SR_NOT_CHECKED)</a></h3>
1213
1214
1215 <p> This method ignores the return value of
1216 <code>java.io.InputStream.skip()</code> which can skip multiple bytes.&nbsp;
1217 If the return value is not checked, the caller will not be able to correctly
1218 handle the case where fewer bytes were skipped than the caller requested.&nbsp;
1219 This is a particularly insidious kind of bug, because in many programs,
1220 skips from input streams usually do skip the full amount of data requested,
1221 causing the program to fail only sporadically. With Buffered streams, however,
1222 skip() will only skip data in the buffer, and will routinely fail to skip the
1223 requested number of bytes.</p>
1224
1225
1226 <h3><a name="RV_NEGATING_RESULT_OF_COMPARETO">RV: Negating the result of compareTo()/compare() (RV_NEGATING_RESULT_OF_COMPARETO)</a></h3>
1227
1228
1229 <p> This code negatives the return value of a compareTo or compare method.
1230 This is a questionable or bad programming practice, since if the return
1231 value is Integer.MIN_VALUE, negating the return value won't
1232 negate the sign of the result. You can achieve the same intended result
1233 by reversing the order of the operands rather than by negating the results.
1234 </p>
1235
1236
1237 <h3><a name="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE">RV: Method ignores exceptional return value (RV_RETURN_VALUE_IGNORED_BAD_PRACTICE)</a></h3>
1238
1239
1240 <p> This method returns a value that is not checked. The return value should be checked
1241 since it can indicate an unusual or unexpected function execution. For
1242 example, the <code>File.delete()</code> method returns false
1243 if the file could not be successfully deleted (rather than
1244 throwing an Exception).
1245 If you don't check the result, you won't notice if the method invocation
1246 signals unexpected behavior by returning an atypical return value.
1247 </p>
1248
1249
1250 <h3><a name="SI_INSTANCE_BEFORE_FINALS_ASSIGNED">SI: Static initializer creates instance before all static final fields assigned (SI_INSTANCE_BEFORE_FINALS_ASSIGNED)</a></h3>
1251
1252
1253 <p> The class's static initializer creates an instance of the class
1254 before all of the static final fields are assigned.</p>
1255
1256
1257 <h3><a name="SW_SWING_METHODS_INVOKED_IN_SWING_THREAD">SW: Certain swing methods needs to be invoked in Swing thread (SW_SWING_METHODS_INVOKED_IN_SWING_THREAD)</a></h3>
1258
1259
1260 <p>(<a href="http://web.archive.org/web/20090526170426/http://java.sun.com/developer/JDCTechTips/2003/tt1208.html">From JDC Tech Tip</a>): The Swing methods
1261 show(), setVisible(), and pack() will create the associated peer for the frame.
1262 With the creation of the peer, the system creates the event dispatch thread.
1263 This makes things problematic because the event dispatch thread could be notifying
1264 listeners while pack and validate are still processing. This situation could result in
1265 two threads going through the Swing component-based GUI -- it's a serious flaw that
1266 could result in deadlocks or other related threading issues. A pack call causes
1267 components to be realized. As they are being realized (that is, not necessarily
1268 visible), they could trigger listener notification on the event dispatch thread.</p>
1269
1270
1271
1272 <h3><a name="SE_BAD_FIELD">Se: Non-transient non-serializable instance field in serializable class (SE_BAD_FIELD)</a></h3>
1273
1274
1275 <p> This Serializable class defines a non-primitive instance field which is neither transient,
1276 Serializable, or <code>java.lang.Object</code>, and does not appear to implement
1277 the <code>Externalizable</code> interface or the
1278 <code>readObject()</code> and <code>writeObject()</code> methods.&nbsp;
1279 Objects of this class will not be deserialized correctly if a non-Serializable
1280 object is stored in this field.</p>
1281
1282
1283 <h3><a name="SE_BAD_FIELD_INNER_CLASS">Se: Non-serializable class has a serializable inner class (SE_BAD_FIELD_INNER_CLASS)</a></h3>
1284
1285
1286 <p> This Serializable class is an inner class of a non-serializable class.
1287 Thus, attempts to serialize it will also attempt to associate instance of the outer
1288 class with which it is associated, leading to a runtime error.
1289 </p>
1290 <p>If possible, making the inner class a static inner class should solve the
1291 problem. Making the outer class serializable might also work, but that would
1292 mean serializing an instance of the inner class would always also serialize the instance
1293 of the outer class, which it often not what you really want.
1294
1295
1296 <h3><a name="SE_BAD_FIELD_STORE">Se: Non-serializable value stored into instance field of a serializable class (SE_BAD_FIELD_STORE)</a></h3>
1297
1298
1299 <p> A non-serializable value is stored into a non-transient field
1300 of a serializable class.</p>
1301
1302
1303 <h3><a name="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE">Se: Comparator doesn't implement Serializable (SE_COMPARATOR_SHOULD_BE_SERIALIZABLE)</a></h3>
1304
1305
1306 <p> This class implements the <code>Comparator</code> interface. You
1307 should consider whether or not it should also implement the <code>Serializable</code>
1308 interface. If a comparator is used to construct an ordered collection
1309 such as a <code>TreeMap</code>, then the <code>TreeMap</code>
1310 will be serializable only if the comparator is also serializable.
1311 As most comparators have little or no state, making them serializable
1312 is generally easy and good defensive programming.
1313 </p>
1314
1315
1316 <h3><a name="SE_INNER_CLASS">Se: Serializable inner class (SE_INNER_CLASS)</a></h3>
1317
1318
1319 <p> This Serializable class is an inner class. Any attempt to serialize
1320 it will also serialize the associated outer instance. The outer instance is serializable,
1321 so this won't fail, but it might serialize a lot more data than intended.
1322 If possible, making the inner class a static inner class (also known as a nested class) should solve the
1323 problem.
1324
1325
1326 <h3><a name="SE_NONFINAL_SERIALVERSIONID">Se: serialVersionUID isn't final (SE_NONFINAL_SERIALVERSIONID)</a></h3>
1327
1328
1329 <p> This class defines a <code>serialVersionUID</code> field that is not final.&nbsp;
1330 The field should be made final
1331 if it is intended to specify
1332 the version UID for purposes of serialization.</p>
1333
1334
1335 <h3><a name="SE_NONLONG_SERIALVERSIONID">Se: serialVersionUID isn't long (SE_NONLONG_SERIALVERSIONID)</a></h3>
1336
1337
1338 <p> This class defines a <code>serialVersionUID</code> field that is not long.&nbsp;
1339 The field should be made long
1340 if it is intended to specify
1341 the version UID for purposes of serialization.</p>
1342
1343
1344 <h3><a name="SE_NONSTATIC_SERIALVERSIONID">Se: serialVersionUID isn't static (SE_NONSTATIC_SERIALVERSIONID)</a></h3>
1345
1346
1347 <p> This class defines a <code>serialVersionUID</code> field that is not static.&nbsp;
1348 The field should be made static
1349 if it is intended to specify
1350 the version UID for purposes of serialization.</p>
1351
1352
1353 <h3><a name="SE_NO_SUITABLE_CONSTRUCTOR">Se: Class is Serializable but its superclass doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR)</a></h3>
1354
1355
1356 <p> This class implements the <code>Serializable</code> interface
1357 and its superclass does not. When such an object is deserialized,
1358 the fields of the superclass need to be initialized by
1359 invoking the void constructor of the superclass.
1360 Since the superclass does not have one,
1361 serialization and deserialization will fail at runtime.</p>
1362
1363
1364 <h3><a name="SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION">Se: Class is Externalizable but doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION)</a></h3>
1365
1366
1367 <p> This class implements the <code>Externalizable</code> interface, but does
1368 not define a void constructor. When Externalizable objects are deserialized,
1369 they first need to be constructed by invoking the void
1370 constructor. Since this class does not have one,
1371 serialization and deserialization will fail at runtime.</p>
1372
1373
1374 <h3><a name="SE_READ_RESOLVE_MUST_RETURN_OBJECT">Se: The readResolve method must be declared with a return type of Object. (SE_READ_RESOLVE_MUST_RETURN_OBJECT)</a></h3>
1375
1376
1377 <p> In order for the readResolve method to be recognized by the serialization
1378 mechanism, it must be declared to have a return type of Object.
1379 </p>
1380
1381
1382 <h3><a name="SE_TRANSIENT_FIELD_NOT_RESTORED">Se: Transient field that isn't set by deserialization. (SE_TRANSIENT_FIELD_NOT_RESTORED)</a></h3>
1383
1384
1385 <p> This class contains a field that is updated at multiple places in the class, thus it seems to be part of the state of the class. However, since the field is marked as transient and not set in readObject or readResolve, it will contain the default value in any
1386 deserialized instance of the class.
1387 </p>
1388
1389
1390 <h3><a name="SE_NO_SERIALVERSIONID">SnVI: Class is Serializable, but doesn't define serialVersionUID (SE_NO_SERIALVERSIONID)</a></h3>
1391
1392
1393 <p> This class implements the <code>Serializable</code> interface, but does
1394 not define a <code>serialVersionUID</code> field.&nbsp;
1395 A change as simple as adding a reference to a .class object
1396 will add synthetic fields to the class,
1397 which will unfortunately change the implicit
1398 serialVersionUID (e.g., adding a reference to <code>String.class</code>
1399 will generate a static field <code>class$java$lang$String</code>).
1400 Also, different source code to bytecode compilers may use different
1401 naming conventions for synthetic variables generated for
1402 references to class objects or inner classes.
1403 To ensure interoperability of Serializable across versions,
1404 consider adding an explicit serialVersionUID.</p>
1405
1406
1407 <h3><a name="UI_INHERITANCE_UNSAFE_GETRESOURCE">UI: Usage of GetResource may be unsafe if class is extended (UI_INHERITANCE_UNSAFE_GETRESOURCE)</a></h3>
1408
1409
1410 <p>Calling <code>this.getClass().getResource(...)</code> could give
1411 results other than expected if this class is extended by a class in
1412 another package.</p>
1413
1414
1415 <h3><a name="BAC_BAD_APPLET_CONSTRUCTOR">BAC: Bad Applet Constructor relies on uninitialized AppletStub (BAC_BAD_APPLET_CONSTRUCTOR)</a></h3>
1416
1417
1418 <p>
1419 This constructor calls methods in the parent Applet that rely on the AppletStub. Since the AppletStub
1420 isn't initialized until the init() method of this applet is called, these methods will not perform
1421 correctly.
1422 </p>
1423
1424
1425 <h3><a name="BC_IMPOSSIBLE_CAST">BC: Impossible cast (BC_IMPOSSIBLE_CAST)</a></h3>
1426
1427
1428 <p>
1429 This cast will always throw a ClassCastException.
1430 FindBugs tracks type information from instanceof checks,
1431 and also uses more precise information about the types
1432 of values returned from methods and loaded from fields.
1433 Thus, it may have more precise information that just
1434 the declared type of a variable, and can use this to determine
1435 that a cast will always throw an exception at runtime.
1436
1437 </p>
1438
1439
1440 <h3><a name="BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downcast (BC_IMPOSSIBLE_DOWNCAST)</a></h3>
1441
1442
1443 <p>
1444 This cast will always throw a ClassCastException.
1445 The analysis believes it knows
1446 the precise type of the value being cast, and the attempt to
1447 downcast it to a subtype will always fail by throwing a ClassCastException.
1448 </p>
1449
1450
1451 <h3><a name="BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impossible downcast of toArray() result (BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY)</a></h3>
1452
1453
1454 <p>
1455 This code is casting the result of calling <code>toArray()</code> on a collection
1456 to a type more specific than <code>Object[]</code>, as in:</p>
1457 <pre>
1458 String[] getAsArray(Collection&lt;String&gt; c) {
1459 return (String[]) c.toArray();
1460 }
1461 </pre>
1462 <p>This will usually fail by throwing a ClassCastException. The <code>toArray()</code>
1463 of almost all collections return an <code>Object[]</code>. They can't really do anything else,
1464 since the Collection object has no reference to the declared generic type of the collection.
1465 <p>The correct way to do get an array of a specific type from a collection is to use
1466 <code>c.toArray(new String[]);</code>
1467 or <code>c.toArray(new String[c.size()]);</code> (the latter is slightly more efficient).
1468 <p>There is one common/known exception exception to this. The <code>toArray()</code>
1469 method of lists returned by <code>Arrays.asList(...)</code> will return a covariantly
1470 typed array. For example, <code>Arrays.asArray(new String[] { "a" }).toArray()</code>
1471 will return a <code>String []</code>. FindBugs attempts to detect and suppress
1472 such cases, but may miss some.
1473 </p>
1474
1475
1476 <h3><a name="BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof will always return false (BC_IMPOSSIBLE_INSTANCEOF)</a></h3>
1477
1478
1479 <p>
1480 This instanceof test will always return false. Although this is safe, make sure it isn't
1481 an indication of some misunderstanding or some other logic error.
1482 </p>
1483
1484
1485 <h3><a name="BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of signed byte value (BIT_ADD_OF_SIGNED_BYTE)</a></h3>
1486
1487
1488 <p> Adds a byte value and a value which is known to have the 8 lower bits clear.
1489 Values loaded from a byte array are sign extended to 32 bits
1490 before any any bitwise operations are performed on the value.
1491 Thus, if <code>b[0]</code> contains the value <code>0xff</code>, and
1492 <code>x</code> is initially 0, then the code
1493 <code>((x &lt;&lt; 8) + b[0])</code> will sign extend <code>0xff</code>
1494 to get <code>0xffffffff</code>, and thus give the value
1495 <code>0xffffffff</code> as the result.
1496 </p>
1497
1498 <p>In particular, the following code for packing a byte array into an int is badly wrong: </p>
1499 <pre>
1500 int result = 0;
1501 for(int i = 0; i &lt; 4; i++)
1502 result = ((result &lt;&lt; 8) + b[i]);
1503 </pre>
1504
1505 <p>The following idiom will work instead: </p>
1506 <pre>
1507 int result = 0;
1508 for(int i = 0; i &lt; 4; i++)
1509 result = ((result &lt;&lt; 8) + (b[i] &amp; 0xff));
1510 </pre>
1511
1512
1513
1514 <h3><a name="BIT_AND">BIT: Incompatible bit masks (BIT_AND)</a></h3>
1515
1516
1517 <p> This method compares an expression of the form (e &amp; C) to D,
1518 which will always compare unequal
1519 due to the specific values of constants C and D.
1520 This may indicate a logic error or typo.</p>
1521
1522
1523 <h3><a name="BIT_AND_ZZ">BIT: Check to see if ((...) & 0) == 0 (BIT_AND_ZZ)</a></h3>
1524
1525
1526 <p> This method compares an expression of the form (e &amp; 0) to 0,
1527 which will always compare equal.
1528 This may indicate a logic error or typo.</p>
1529
1530
1531 <h3><a name="BIT_IOR">BIT: Incompatible bit masks (BIT_IOR)</a></h3>
1532
1533
1534 <p> This method compares an expression of the form (e | C) to D.
1535 which will always compare unequal
1536 due to the specific values of constants C and D.
1537 This may indicate a logic error or typo.</p>
1538
1539 <p> Typically, this bug occurs because the code wants to perform
1540 a membership test in a bit set, but uses the bitwise OR
1541 operator ("|") instead of bitwise AND ("&amp;").</p>
1542
1543
1544 <h3><a name="BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of signed byte value (BIT_IOR_OF_SIGNED_BYTE)</a></h3>
1545
1546
1547 <p> Loads a byte value (e.g., a value loaded from a byte array or returned by a method
1548 with return type byte) and performs a bitwise OR with
1549 that value. Byte values are sign extended to 32 bits
1550 before any any bitwise operations are performed on the value.
1551 Thus, if <code>b[0]</code> contains the value <code>0xff</code>, and
1552 <code>x</code> is initially 0, then the code
1553 <code>((x &lt;&lt; 8) | b[0])</code> will sign extend <code>0xff</code>
1554 to get <code>0xffffffff</code>, and thus give the value
1555 <code>0xffffffff</code> as the result.
1556 </p>
1557
1558 <p>In particular, the following code for packing a byte array into an int is badly wrong: </p>
1559 <pre>
1560 int result = 0;
1561 for(int i = 0; i &lt; 4; i++)
1562 result = ((result &lt;&lt; 8) | b[i]);
1563 </pre>
1564
1565 <p>The following idiom will work instead: </p>
1566 <pre>
1567 int result = 0;
1568 for(int i = 0; i &lt; 4; i++)
1569 result = ((result &lt;&lt; 8) | (b[i] &amp; 0xff));
1570 </pre>
1571
1572
1573
1574 <h3><a name="BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK_HIGH_BIT)</a></h3>
1575
1576
1577 <p> This method compares an expression such as</p>
1578 <pre>((event.detail &amp; SWT.SELECTED) &gt; 0)</pre>.
1579 <p>Using bit arithmetic and then comparing with the greater than operator can
1580 lead to unexpected results (of course depending on the value of
1581 SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate
1582 for a bug. Even when SWT.SELECTED is not negative, it seems good practice
1583 to use '!= 0' instead of '&gt; 0'.
1584 </p>
1585 <p>
1586 <em>Boris Bokowski</em>
1587 </p>
1588
1589
1590 <h3><a name="BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class overrides a method implemented in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER)</a></h3>
1591
1592
1593 <p> This method overrides a method found in a parent class, where that class is an Adapter that implements
1594 a listener defined in the java.awt.event or javax.swing.event package. As a result, this method will not
1595 get called when the event occurs.</p>
1596
1597
1598 <h3><a name="ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int shifted by an amount not in the range -31..31 (ICAST_BAD_SHIFT_AMOUNT)</a></h3>
1599
1600
1601 <p>
1602 The code performs shift of a 32 bit int by a constant amount outside
1603 the range -31..31.
1604 The effect of this is to use the lower 5 bits of the integer
1605 value to decide how much to shift by (e.g., shifting by 40 bits is the same as shifting by 8 bits,
1606 and shifting by 32 bits is the same as shifting by zero bits). This probably isn't what was expected,
1607 and it is at least confusing.
1608 </p>
1609
1610
1611 <h3><a name="BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">Bx: Primitive value is unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR)</a></h3>
1612
1613
1614 <p>A wrapped primitive value is unboxed and converted to another primitive type as part of the
1615 evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> operator). The
1616 semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrapped
1617 numeric values, the values are unboxed and converted/coerced to their common type (e.g,
1618 if <code>e1</code> is of type <code>Integer</code>
1619 and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unboxed,
1620 converted to a floating point value, and boxed. See JLS Section 15.25.
1621 </p>
1622
1623
1624 <h3><a name="CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns Integer.MIN_VALUE (CO_COMPARETO_RESULTS_MIN_VALUE)</a></h3>
1625
1626
1627 <p> In some situation, this compareTo or compare method returns
1628 the constant Integer.MIN_VALUE, which is an exceptionally bad practice.
1629 The only thing that matters about the return value of compareTo is the sign of the result.
1630 But people will sometimes negate the return value of compareTo, expecting that this will negate
1631 the sign of the result. And it will, except in the case where the value returned is Integer.MIN_VALUE.
1632 So just return -1 rather than Integer.MIN_VALUE.
1633
1634
1635 <h3><a name="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in return statement (DLS_DEAD_LOCAL_INCREMENT_IN_RETURN)</a></h3>
1636
1637
1638 <p>This statement has a return such as <code>return x++;</code>.
1639 A postfix increment/decrement does not impact the value of the expression,
1640 so this increment/decrement has no effect.
1641 Please verify that this statement does the right thing.
1642 </p>
1643
1644
1645 <h3><a name="DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead store of class literal (DLS_DEAD_STORE_OF_CLASS_LITERAL)</a></h3>
1646
1647
1648 <p>
1649 This instruction assigns a class literal to a variable and then never uses it.
1650 <a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">The behavior of this differs in Java 1.4 and in Java 5.</a>
1651 In Java 1.4 and earlier, a reference to <code>Foo.class</code> would force the static initializer
1652 for <code>Foo</code> to be executed, if it has not been executed already.
1653 In Java 5 and later, it does not.
1654 </p>
1655 <p>See Sun's <a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">article on Java SE compatibility</a>
1656 for more details and examples, and suggestions on how to force class initialization in Java 5.
1657 </p>
1658
1659
1660 <h3><a name="DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten increment (DLS_OVERWRITTEN_INCREMENT)</a></h3>
1661
1662
1663 <p>
1664 The code performs an increment operation (e.g., <code>i++</code>) and then
1665 immediately overwrites it. For example, <code>i = i++</code> immediately
1666 overwrites the incremented value with the original value.
1667 </p>
1668
1669
1670 <h3><a name="DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed method arguments (DMI_ARGUMENTS_WRONG_ORDER)</a></h3>
1671
1672
1673 <p> The arguments to this method call seem to be in the wrong order.
1674 For example, a call <code>Preconditions.checkNotNull("message", message)</code>
1675 has reserved arguments: the value to be checked is the first argument.
1676 </p>
1677
1678
1679 <h3><a name="DMI_BAD_MONTH">DMI: Bad constant value for month (DMI_BAD_MONTH)</a></h3>
1680
1681
1682 <p>
1683 This code passes a constant month
1684 value outside the expected range of 0..11 to a method.
1685 </p>
1686
1687
1688 <h3><a name="DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI: BigDecimal constructed from double that isn't represented precisely (DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE)</a></h3>
1689
1690
1691 <p>
1692 This code creates a BigDecimal from a double value that doesn't translate well to a
1693 decimal number.
1694 For example, one might assume that writing new BigDecimal(0.1) in Java creates a BigDecimal which is exactly equal to 0.1 (an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625.
1695 You probably want to use the BigDecimal.valueOf(double d) method, which uses the String representation
1696 of the double to create the BigDecimal (e.g., BigDecimal.valueOf(0.1) gives 0.1).
1697 </p>
1698
1699
1700
1701 <h3><a name="DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT)</a></h3>
1702
1703
1704 <p>
1705 The hasNext() method invokes the next() method. This is almost certainly wrong,
1706 since the hasNext() method is not supposed to change the state of the iterator,
1707 and the next method is supposed to change the state of the iterator.
1708 </p>
1709
1710
1711 <h3><a name="DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES">DMI: Collections should not contain themselves (DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES)</a></h3>
1712
1713
1714 <p> This call to a generic collection's method would only make sense if a collection contained
1715 itself (e.g., if <code>s.contains(s)</code> were true). This is unlikely to be true and would cause
1716 problems if it were true (such as the computation of the hash code resulting in infinite recursion).
1717 It is likely that the wrong value is being passed as a parameter.
1718 </p>
1719
1720
1721 <h3><a name="DMI_DOH">DMI: D'oh! A nonsensical method invocation (DMI_DOH)</a></h3>
1722
1723
1724 <p>
1725 This partical method invocation doesn't make sense, for reasons that should be apparent from inspection.
1726 </p>
1727
1728
1729
1730 <h3><a name="DMI_INVOKING_HASHCODE_ON_ARRAY">DMI: Invocation of hashCode on an array (DMI_INVOKING_HASHCODE_ON_ARRAY)</a></h3>
1731
1732
1733 <p>
1734 The code invokes hashCode on an array. Calling hashCode on
1735 an array returns the same value as System.identityHashCode, and ingores
1736 the contents and length of the array. If you need a hashCode that
1737 depends on the contents of an array <code>a</code>,
1738 use <code>java.util.Arrays.hashCode(a)</code>.
1739
1740 </p>
1741
1742
1743 <h3><a name="DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">DMI: Double.longBitsToDouble invoked on an int (DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT)</a></h3>
1744
1745
1746 <p> The Double.longBitsToDouble method is invoked, but a 32 bit int value is passed
1747 as an argument. This almostly certainly is not intended and is unlikely
1748 to give the intended result.
1749 </p>
1750
1751
1752 <h3><a name="DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuous call to collections (DMI_VACUOUS_SELF_COLLECTION_CALL)</a></h3>
1753
1754
1755 <p> This call doesn't make sense. For any collection <code>c</code>, calling <code>c.containsAll(c)</code> should
1756 always be true, and <code>c.retainAll(c)</code> should have no effect.
1757 </p>
1758
1759
1760 <h3><a name="DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION">Dm: Can't use reflection to check for presence of annotation without runtime retention (DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION)</a></h3>
1761
1762
1763 <p> Unless an annotation has itself been annotated with @Retention(RetentionPolicy.RUNTIME), the annotation can't be observed using reflection
1764 (e.g., by using the isAnnotationPresent method).
1765 .</p>
1766
1767
1768 <h3><a name="DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR">Dm: Futile attempt to change max pool size of ScheduledThreadPoolExecutor (DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR)</a></h3>
1769
1770
1771 <p>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html">Javadoc</a>)
1772 While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect.
1773 </p>
1774
1775
1776
1777 <h3><a name="DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS">Dm: Creation of ScheduledThreadPoolExecutor with zero core threads (DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS)</a></h3>
1778
1779
1780 <p>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html#ScheduledThreadPoolExecutor(int)">Javadoc</a>)
1781 A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored.
1782 </p>
1783
1784
1785
1786 <h3><a name="DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Useless/vacuous call to EasyMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD)</a></h3>
1787
1788
1789 <p>This call doesn't pass any objects to the EasyMock method, so the call doesn't do anything.
1790 </p>
1791
1792
1793
1794 <h3><a name="EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonarray (EC_ARRAY_AND_NONARRAY)</a></h3>
1795
1796
1797 <p>
1798 This method invokes the .equals(Object o) to compare an array and a reference that doesn't seem
1799 to be an array. If things being compared are of different types, they are guaranteed to be unequal
1800 and the comparison is almost certainly an error. Even if they are both arrays, the equals method
1801 on arrays only determines of the two arrays are the same object.
1802 To compare the
1803 contents of the arrays, use java.util.Arrays.equals(Object[], Object[]).
1804 </p>
1805
1806
1807 <h3><a name="EC_BAD_ARRAY_COMPARE">EC: Invocation of equals() on an array, which is equivalent to == (EC_BAD_ARRAY_COMPARE)</a></h3>
1808
1809
1810 <p>
1811 This method invokes the .equals(Object o) method on an array. Since arrays do not override the equals
1812 method of Object, calling equals on an array is the same as comparing their addresses. To compare the
1813 contents of the arrays, use <code>java.util.Arrays.equals(Object[], Object[])</code>.
1814 To compare the addresses of the arrays, it would be
1815 less confusing to explicitly check pointer equality using <code>==</code>.
1816 </p>
1817
1818
1819 <h3><a name="EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(...) used to compare incompatible arrays (EC_INCOMPATIBLE_ARRAY_COMPARE)</a></h3>
1820
1821
1822 <p>
1823 This method invokes the .equals(Object o) to compare two arrays, but the arrays of
1824 of incompatible types (e.g., String[] and StringBuffer[], or String[] and int[]).
1825 They will never be equal. In addition, when equals(...) is used to compare arrays it
1826 only checks to see if they are the same array, and ignores the contents of the arrays.
1827 </p>
1828
1829
1830 <h3><a name="EC_NULL_ARG">EC: Call to equals(null) (EC_NULL_ARG)</a></h3>
1831
1832
1833 <p> This method calls equals(Object), passing a null value as
1834 the argument. According to the contract of the equals() method,
1835 this call should always return <code>false</code>.</p>
1836
1837
1838 <h3><a name="EC_UNRELATED_CLASS_AND_INTERFACE">EC: Call to equals() comparing unrelated class and interface (EC_UNRELATED_CLASS_AND_INTERFACE)</a></h3>
1839
1840
1841 <p>
1842 This method calls equals(Object) on two references, one of which is a class
1843 and the other an interface, where neither the class nor any of its
1844 non-abstract subclasses implement the interface.
1845 Therefore, the objects being compared
1846 are unlikely to be members of the same class at runtime
1847 (unless some application classes were not analyzed, or dynamic class
1848 loading can occur at runtime).
1849 According to the contract of equals(),
1850 objects of different
1851 classes should always compare as unequal; therefore, according to the
1852 contract defined by java.lang.Object.equals(Object),
1853 the result of this comparison will always be false at runtime.
1854 </p>
1855
1856
1857 <h3><a name="EC_UNRELATED_INTERFACES">EC: Call to equals() comparing different interface types (EC_UNRELATED_INTERFACES)</a></h3>
1858
1859
1860 <p> This method calls equals(Object) on two references of unrelated
1861 interface types, where neither is a subtype of the other,
1862 and there are no known non-abstract classes which implement both interfaces.
1863 Therefore, the objects being compared
1864 are unlikely to be members of the same class at runtime
1865 (unless some application classes were not analyzed, or dynamic class
1866 loading can occur at runtime).
1867 According to the contract of equals(),
1868 objects of different
1869 classes should always compare as unequal; therefore, according to the
1870 contract defined by java.lang.Object.equals(Object),
1871 the result of this comparison will always be false at runtime.
1872 </p>
1873
1874
1875 <h3><a name="EC_UNRELATED_TYPES">EC: Call to equals() comparing different types (EC_UNRELATED_TYPES)</a></h3>
1876
1877
1878 <p> This method calls equals(Object) on two references of different
1879 class types with no common subclasses.
1880 Therefore, the objects being compared
1881 are unlikely to be members of the same class at runtime
1882 (unless some application classes were not analyzed, or dynamic class
1883 loading can occur at runtime).
1884 According to the contract of equals(),
1885 objects of different
1886 classes should always compare as unequal; therefore, according to the
1887 contract defined by java.lang.Object.equals(Object),
1888 the result of this comparison will always be false at runtime.
1889 </p>
1890
1891
1892 <h3><a name="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">EC: Using pointer equality to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY)</a></h3>
1893
1894
1895 <p> This method uses using pointer equality to compare two references that seem to be of
1896 different types. The result of this comparison will always be false at runtime.
1897 </p>
1898
1899
1900 <h3><a name="EQ_ALWAYS_FALSE">Eq: equals method always returns false (EQ_ALWAYS_FALSE)</a></h3>
1901
1902
1903 <p> This class defines an equals method that always returns false. This means that an object is not equal to itself, and it is impossible to create useful Maps or Sets of this class. More fundamentally, it means
1904 that equals is not reflexive, one of the requirements of the equals method.</p>
1905 <p>The likely intended semantics are object identity: that an object is equal to itself. This is the behavior inherited from class <code>Object</code>. If you need to override an equals inherited from a different
1906 superclass, you can use use:</p>
1907 <pre>
1908 public boolean equals(Object o) { return this == o; }
1909 </pre>
1910
1911
1912 <h3><a name="EQ_ALWAYS_TRUE">Eq: equals method always returns true (EQ_ALWAYS_TRUE)</a></h3>
1913
1914
1915 <p> This class defines an equals method that always returns true. This is imaginative, but not very smart.
1916 Plus, it means that the equals method is not symmetric.
1917 </p>
1918
1919
1920 <h3><a name="EQ_COMPARING_CLASS_NAMES">Eq: equals method compares class names rather than class objects (EQ_COMPARING_CLASS_NAMES)</a></h3>
1921
1922
1923 <p> This method checks to see if two objects are the same class by checking to see if the names
1924 of their classes are equal. You can have different classes with the same name if they are loaded by
1925 different class loaders. Just check to see if the class objects are the same.
1926 </p>
1927
1928
1929 <h3><a name="EQ_DONT_DEFINE_EQUALS_FOR_ENUM">Eq: Covariant equals() method defined for enum (EQ_DONT_DEFINE_EQUALS_FOR_ENUM)</a></h3>
1930
1931
1932 <p> This class defines an enumeration, and equality on enumerations are defined
1933 using object identity. Defining a covariant equals method for an enumeration
1934 value is exceptionally bad practice, since it would likely result
1935 in having two different enumeration values that compare as equals using
1936 the covariant enum method, and as not equal when compared normally.
1937 Don't do it.
1938 </p>
1939
1940
1941 <h3><a name="EQ_OTHER_NO_OBJECT">Eq: equals() method defined that doesn't override equals(Object) (EQ_OTHER_NO_OBJECT)</a></h3>
1942
1943
1944 <p> This class defines an <code>equals()</code>
1945 method, that doesn't override the normal <code>equals(Object)</code> method
1946 defined in the base <code>java.lang.Object</code> class.&nbsp; Instead, it
1947 inherits an <code>equals(Object)</code> method from a superclass.
1948 The class should probably define a <code>boolean equals(Object)</code> method.
1949 </p>
1950
1951
1952 <h3><a name="EQ_OTHER_USE_OBJECT">Eq: equals() method defined that doesn't override Object.equals(Object) (EQ_OTHER_USE_OBJECT)</a></h3>
1953
1954
1955 <p> This class defines an <code>equals()</code>
1956 method, that doesn't override the normal <code>equals(Object)</code> method
1957 defined in the base <code>java.lang.Object</code> class.&nbsp;
1958 The class should probably define a <code>boolean equals(Object)</code> method.
1959 </p>
1960
1961
1962 <h3><a name="EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC">Eq: equals method overrides equals in superclass and may not be symmetric (EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC)</a></h3>
1963
1964
1965 <p> This class defines an equals method that overrides an equals method in a superclass. Both equals methods
1966 methods use <code>instanceof</code> in the determination of whether two objects are equal. This is fraught with peril,
1967 since it is important that the equals method is symmetrical (in other words, <code>a.equals(b) == b.equals(a)</code>).
1968 If B is a subtype of A, and A's equals method checks that the argument is an instanceof A, and B's equals method
1969 checks that the argument is an instanceof B, it is quite likely that the equivalence relation defined by these
1970 methods is not symmetric.
1971 </p>
1972
1973
1974 <h3><a name="EQ_SELF_USE_OBJECT">Eq: Covariant equals() method defined, Object.equals(Object) inherited (EQ_SELF_USE_OBJECT)</a></h3>
1975
1976
1977 <p> This class defines a covariant version of the <code>equals()</code>
1978 method, but inherits the normal <code>equals(Object)</code> method
1979 defined in the base <code>java.lang.Object</code> class.&nbsp;
1980 The class should probably define a <code>boolean equals(Object)</code> method.
1981 </p>
1982
1983
1984 <h3><a name="FB_MISSING_EXPECTED_WARNING">FB: Missing expected or desired warning from FindBugs (FB_MISSING_EXPECTED_WARNING)</a></h3>
1985
1986
1987 <p>FindBugs didn't generate generated a warning that, according to a @ExpectedWarning annotated,
1988 is expected or desired</p>
1989
1990
1991 <h3><a name="FB_UNEXPECTED_WARNING">FB: Unexpected/undesired warning from FindBugs (FB_UNEXPECTED_WARNING)</a></h3>
1992
1993
1994 <p>FindBugs generated a warning that, according to a @NoWarning annotated,
1995 is unexpected or undesired</p>
1996
1997
1998 <h3><a name="FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER">FE: Doomed test for equality to NaN (FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER)</a></h3>
1999
2000
2001 <p>
2002 This code checks to see if a floating point value is equal to the special
2003 Not A Number value (e.g., <code>if (x == Double.NaN)</code>). However,
2004 because of the special semantics of <code>NaN</code>, no value
2005 is equal to <code>Nan</code>, including <code>NaN</code>. Thus,
2006 <code>x == Double.NaN</code> always evaluates to false.
2007
2008 To check to see if a value contained in <code>x</code>
2009 is the special Not A Number value, use
2010 <code>Double.isNaN(x)</code> (or <code>Float.isNaN(x)</code> if
2011 <code>x</code> is floating point precision).
2012 </p>
2013
2014
2015 <h3><a name="FL_MATH_USING_FLOAT_PRECISION">FL: Method performs math using floating point precision (FL_MATH_USING_FLOAT_PRECISION)</a></h3>
2016
2017
2018 <p>
2019 The method performs math operations using floating point precision.
2020 Floating point precision is very imprecise. For example,
2021 16777216.0f + 1.0f = 16777216.0f. Consider using double math instead.</p>
2022
2023
2024 <h3><a name="VA_FORMAT_STRING_BAD_ARGUMENT">FS: Format string placeholder incompatible with passed argument (VA_FORMAT_STRING_BAD_ARGUMENT)</a></h3>
2025
2026
2027 <p>
2028 The format string placeholder is incompatible with the corresponding
2029 argument. For example,
2030 <code>
2031 System.out.println("%d\n", "hello");
2032 </code>
2033 <p>The %d placeholder requires a numeric argument, but a string value is
2034 passed instead.
2035 A runtime exception will occur when
2036 this statement is executed.
2037 </p>
2038
2039
2040 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION">FS: The type of a supplied argument doesn't match format specifier (VA_FORMAT_STRING_BAD_CONVERSION)</a></h3>
2041
2042
2043 <p>
2044 One of the arguments is uncompatible with the corresponding format string specifier.
2045 As a result, this will generate a runtime exception when executed.
2046 For example, <code>String.format("%d", "1")</code> will generate an exception, since
2047 the String "1" is incompatible with the format specifier %d.
2048 </p>
2049
2050
2051 <h3><a name="VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED">FS: MessageFormat supplied where printf style format expected (VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED)</a></h3>
2052
2053
2054 <p>
2055 A method is called that expects a Java printf format string and a list of arguments.
2056 However, the format string doesn't contain any format specifiers (e.g., %s) but
2057 does contain message format elements (e.g., {0}). It is likely
2058 that the code is supplying a MessageFormat string when a printf-style format string
2059 is required. At runtime, all of the arguments will be ignored
2060 and the format string will be returned exactly as provided without any formatting.
2061 </p>
2062
2063
2064 <h3><a name="VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED">FS: More arguments are passed than are actually used in the format string (VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED)</a></h3>
2065
2066
2067 <p>
2068 A format-string method with a variable number of arguments is called,
2069 but more arguments are passed than are actually used by the format string.
2070 This won't cause a runtime exception, but the code may be silently omitting
2071 information that was intended to be included in the formatted string.
2072 </p>
2073
2074
2075 <h3><a name="VA_FORMAT_STRING_ILLEGAL">FS: Illegal format string (VA_FORMAT_STRING_ILLEGAL)</a></h3>
2076
2077
2078 <p>
2079 The format string is syntactically invalid,
2080 and a runtime exception will occur when
2081 this statement is executed.
2082 </p>
2083
2084
2085 <h3><a name="VA_FORMAT_STRING_MISSING_ARGUMENT">FS: Format string references missing argument (VA_FORMAT_STRING_MISSING_ARGUMENT)</a></h3>
2086
2087
2088 <p>
2089 Not enough arguments are passed to satisfy a placeholder in the format string.
2090 A runtime exception will occur when
2091 this statement is executed.
2092 </p>
2093
2094
2095 <h3><a name="VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT">FS: No previous argument for format string (VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT)</a></h3>
2096
2097
2098 <p>
2099 The format string specifies a relative index to request that the argument for the previous format specifier
2100 be reused. However, there is no previous argument.
2101 For example,
2102 </p>
2103 <p><code>formatter.format("%&lt;s %s", "a", "b")</code>
2104 </p>
2105 <p>would throw a MissingFormatArgumentException when executed.
2106 </p>
2107
2108
2109 <h3><a name="GC_UNRELATED_TYPES">GC: No relationship between generic parameter and method argument (GC_UNRELATED_TYPES)</a></h3>
2110
2111
2112 <p> This call to a generic collection method contains an argument
2113 with an incompatible class from that of the collection's parameter
2114 (i.e., the type of the argument is neither a supertype nor a subtype
2115 of the corresponding generic type argument).
2116 Therefore, it is unlikely that the collection contains any objects
2117 that are equal to the method argument used here.
2118 Most likely, the wrong value is being passed to the method.</p>
2119 <p>In general, instances of two unrelated classes are not equal.
2120 For example, if the <code>Foo</code> and <code>Bar</code> classes
2121 are not related by subtyping, then an instance of <code>Foo</code>
2122 should not be equal to an instance of <code>Bar</code>.
2123 Among other issues, doing so will likely result in an equals method
2124 that is not symmetrical. For example, if you define the <code>Foo</code> class
2125 so that a <code>Foo</code> can be equal to a <code>String</code>,
2126 your equals method isn't symmetrical since a <code>String</code> can only be equal
2127 to a <code>String</code>.
2128 </p>
2129 <p>In rare cases, people do define nonsymmetrical equals methods and still manage to make
2130 their code work. Although none of the APIs document or guarantee it, it is typically
2131 the case that if you check if a <code>Collection&lt;String&gt;</code> contains
2132 a <code>Foo</code>, the equals method of argument (e.g., the equals method of the
2133 <code>Foo</code> class) used to perform the equality checks.
2134 </p>
2135
2136
2137 <h3><a name="HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS">HE: Signature declares use of unhashable class in hashed construct (HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS)</a></h3>
2138
2139
2140 <p> A method, field or class declares a generic signature where a non-hashable class
2141 is used in context where a hashable class is required.
2142 A class that declares an equals method but inherits a hashCode() method
2143 from Object is unhashable, since it doesn't fulfill the requirement that
2144 equal objects have equal hashCodes.
2145 </p>
2146
2147
2148 <h3><a name="HE_USE_OF_UNHASHABLE_CLASS">HE: Use of class without a hashCode() method in a hashed data structure (HE_USE_OF_UNHASHABLE_CLASS)</a></h3>
2149
2150
2151 <p> A class defines an equals(Object) method but not a hashCode() method,
2152 and thus doesn't fulfill the requirement that equal objects have equal hashCodes.
2153 An instance of this class is used in a hash data structure, making the need to
2154 fix this problem of highest importance.
2155
2156
2157 <h3><a name="ICAST_INT_2_LONG_AS_INSTANT">ICAST: int value converted to long and used as absolute time (ICAST_INT_2_LONG_AS_INSTANT)</a></h3>
2158
2159
2160 <p>
2161 This code converts a 32-bit int value to a 64-bit long value, and then
2162 passes that value for a method parameter that requires an absolute time value.
2163 An absolute time value is the number
2164 of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
2165 For example, the following method, intended to convert seconds since the epoc into a Date, is badly
2166 broken:</p>
2167 <pre>
2168 Date getDate(int seconds) { return new Date(seconds * 1000); }
2169 </pre>
2170 <p>The multiplication is done using 32-bit arithmetic, and then converted to a 64-bit value.
2171 When a 32-bit value is converted to 64-bits and used to express an absolute time
2172 value, only dates in December 1969 and January 1970 can be represented.</p>
2173
2174 <p>Correct implementations for the above method are:</p>
2175
2176 <pre>
2177 // Fails for dates after 2037
2178 Date getDate(int seconds) { return new Date(seconds * 1000L); }
2179
2180 // better, works for all dates
2181 Date getDate(long seconds) { return new Date(seconds * 1000); }
2182 </pre>
2183
2184
2185 <h3><a name="ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL">ICAST: Integral value cast to double and then passed to Math.ceil (ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL)</a></h3>
2186
2187
2188 <p>
2189 This code converts an integral value (e.g., int or long)
2190 to a double precision
2191 floating point number and then
2192 passing the result to the Math.ceil() function, which rounds a double to
2193 the next higher integer value. This operation should always be a no-op,
2194 since the converting an integer to a double should give a number with no fractional part.
2195 It is likely that the operation that generated the value to be passed
2196 to Math.ceil was intended to be performed using double precision
2197 floating point arithmetic.
2198 </p>
2199
2200
2201
2202 <h3><a name="ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND">ICAST: int value cast to float and then passed to Math.round (ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND)</a></h3>
2203
2204
2205 <p>
2206 This code converts an int value to a float precision
2207 floating point number and then
2208 passing the result to the Math.round() function, which returns the int/long closest
2209 to the argument. This operation should always be a no-op,
2210 since the converting an integer to a float should give a number with no fractional part.
2211 It is likely that the operation that generated the value to be passed
2212 to Math.round was intended to be performed using
2213 floating point arithmetic.
2214 </p>
2215
2216
2217
2218 <h3><a name="IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD">IJU: JUnit assertion in run method will not be noticed by JUnit (IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD)</a></h3>
2219
2220
2221 <p> A JUnit assertion is performed in a run method. Failed JUnit assertions
2222 just result in exceptions being thrown.
2223 Thus, if this exception occurs in a thread other than the thread that invokes
2224 the test method, the exception will terminate the thread but not result
2225 in the test failing.
2226 </p>
2227
2228
2229 <h3><a name="IJU_BAD_SUITE_METHOD">IJU: TestCase declares a bad suite method (IJU_BAD_SUITE_METHOD)</a></h3>
2230
2231
2232 <p> Class is a JUnit TestCase and defines a suite() method.
2233 However, the suite method needs to be declared as either</p>
2234 <pre>public static junit.framework.Test suite()</pre>
2235 or
2236 <pre>public static junit.framework.TestSuite suite()</pre>
2237
2238
2239 <h3><a name="IJU_NO_TESTS">IJU: TestCase has no tests (IJU_NO_TESTS)</a></h3>
2240
2241
2242 <p> Class is a JUnit TestCase but has not implemented any test methods</p>
2243
2244
2245 <h3><a name="IJU_SETUP_NO_SUPER">IJU: TestCase defines setUp that doesn't call super.setUp() (IJU_SETUP_NO_SUPER)</a></h3>
2246
2247
2248 <p> Class is a JUnit TestCase and implements the setUp method. The setUp method should call
2249 super.setUp(), but doesn't.</p>
2250
2251
2252 <h3><a name="IJU_SUITE_NOT_STATIC">IJU: TestCase implements a non-static suite method (IJU_SUITE_NOT_STATIC)</a></h3>
2253
2254
2255 <p> Class is a JUnit TestCase and implements the suite() method.
2256 The suite method should be declared as being static, but isn't.</p>
2257
2258
2259 <h3><a name="IJU_TEARDOWN_NO_SUPER">IJU: TestCase defines tearDown that doesn't call super.tearDown() (IJU_TEARDOWN_NO_SUPER)</a></h3>
2260
2261
2262 <p> Class is a JUnit TestCase and implements the tearDown method. The tearDown method should call
2263 super.tearDown(), but doesn't.</p>
2264
2265
2266 <h3><a name="IL_CONTAINER_ADDED_TO_ITSELF">IL: A collection is added to itself (IL_CONTAINER_ADDED_TO_ITSELF)</a></h3>
2267
2268
2269 <p>A collection is added to itself. As a result, computing the hashCode of this
2270 set will throw a StackOverflowException.
2271 </p>
2272
2273
2274 <h3><a name="IL_INFINITE_LOOP">IL: An apparent infinite loop (IL_INFINITE_LOOP)</a></h3>
2275
2276
2277 <p>This loop doesn't seem to have a way to terminate (other than by perhaps
2278 throwing an exception).</p>
2279
2280
2281 <h3><a name="IL_INFINITE_RECURSIVE_LOOP">IL: An apparent infinite recursive loop (IL_INFINITE_RECURSIVE_LOOP)</a></h3>
2282
2283
2284 <p>This method unconditionally invokes itself. This would seem to indicate
2285 an infinite recursive loop that will result in a stack overflow.</p>
2286
2287
2288 <h3><a name="IM_MULTIPLYING_RESULT_OF_IREM">IM: Integer multiply of result of integer remainder (IM_MULTIPLYING_RESULT_OF_IREM)</a></h3>
2289
2290
2291 <p>
2292 The code multiplies the result of an integer remaining by an integer constant.
2293 Be sure you don't have your operator precedence confused. For example
2294 i % 60 * 1000 is (i % 60) * 1000, not i % (60 * 1000).
2295 </p>
2296
2297
2298 <h3><a name="INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad comparison of int value with long constant (INT_BAD_COMPARISON_WITH_INT_VALUE)</a></h3>
2299
2300
2301 <p> This code compares an int value with a long constant that is outside
2302 the range of values that can be represented as an int value.
2303 This comparison is vacuous and possibily to be incorrect.
2304 </p>
2305
2306
2307 <h3><a name="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT: Bad comparison of nonnegative value with negative constant (INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE)</a></h3>
2308
2309
2310 <p> This code compares a value that is guaranteed to be non-negative with a negative constant.
2311 </p>
2312
2313
2314 <h3><a name="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE)</a></h3>
2315
2316
2317 <p> Signed bytes can only have a value in the range -128 to 127. Comparing
2318 a signed byte with a value outside that range is vacuous and likely to be incorrect.
2319 To convert a signed byte <code>b</code> to an unsigned value in the range 0..255,
2320 use <code>0xff &amp; b</code>
2321 </p>
2322
2323
2324 <h3><a name="IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">IO: Doomed attempt to append to an object output stream (IO_APPENDING_TO_OBJECT_OUTPUT_STREAM)</a></h3>
2325
2326
2327 <p>
2328 This code opens a file in append mode and then wraps the result in an object output stream.
2329 This won't allow you to append to an existing object output stream stored in a file. If you want to be
2330 able to append to an object output stream, you need to keep the object output stream open.
2331 </p>
2332 <p>The only situation in which opening a file in append mode and the writing an object output stream
2333 could work is if on reading the file you plan to open it in random access mode and seek to the byte offset
2334 where the append started.
2335 </p>
2336
2337 <p>
2338 TODO: example.
2339 </p>
2340
2341
2342 <h3><a name="IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">IP: A parameter is dead upon entry to a method but overwritten (IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN)</a></h3>
2343
2344
2345 <p>
2346 The initial value of this parameter is ignored, and the parameter
2347 is overwritten here. This often indicates a mistaken belief that
2348 the write to the parameter will be conveyed back to
2349 the caller.
2350 </p>
2351
2352
2353 <h3><a name="MF_CLASS_MASKS_FIELD">MF: Class defines field that masks a superclass field (MF_CLASS_MASKS_FIELD)</a></h3>
2354
2355
2356 <p> This class defines a field with the same name as a visible
2357 instance field in a superclass. This is confusing, and
2358 may indicate an error if methods update or access one of
2359 the fields when they wanted the other.</p>
2360
2361
2362 <h3><a name="MF_METHOD_MASKS_FIELD">MF: Method defines a variable that obscures a field (MF_METHOD_MASKS_FIELD)</a></h3>
2363
2364
2365 <p> This method defines a local variable with the same name as a field
2366 in this class or a superclass. This may cause the method to
2367 read an uninitialized value from the field, leave the field uninitialized,
2368 or both.</p>
2369
2370
2371 <h3><a name="NP_ALWAYS_NULL">NP: Null pointer dereference (NP_ALWAYS_NULL)</a></h3>
2372
2373
2374 <p> A null pointer is dereferenced here.&nbsp; This will lead to a
2375 <code>NullPointerException</code> when the code is executed.</p>
2376
2377
2378 <h3><a name="NP_ALWAYS_NULL_EXCEPTION">NP: Null pointer dereference in method on exception path (NP_ALWAYS_NULL_EXCEPTION)</a></h3>
2379
2380
2381 <p> A pointer which is null on an exception path is dereferenced here.&nbsp;
2382 This will lead to a <code>NullPointerException</code> when the code is executed.&nbsp;
2383 Note that because FindBugs currently does not prune infeasible exception paths,
2384 this may be a false warning.</p>
2385
2386 <p> Also note that FindBugs considers the default case of a switch statement to
2387 be an exception path, since the default case is often infeasible.</p>
2388
2389
2390 <h3><a name="NP_ARGUMENT_MIGHT_BE_NULL">NP: Method does not check for null argument (NP_ARGUMENT_MIGHT_BE_NULL)</a></h3>
2391
2392
2393 <p>
2394 A parameter to this method has been identified as a value that should
2395 always be checked to see whether or not it is null, but it is being dereferenced
2396 without a preceding null check.
2397 </p>
2398
2399
2400 <h3><a name="NP_CLOSING_NULL">NP: close() invoked on a value that is always null (NP_CLOSING_NULL)</a></h3>
2401
2402
2403 <p> close() is being invoked on a value that is always null. If this statement is executed,
2404 a null pointer exception will occur. But the big risk here you never close
2405 something that should be closed.
2406
2407
2408 <h3><a name="NP_GUARANTEED_DEREF">NP: Null value is guaranteed to be dereferenced (NP_GUARANTEED_DEREF)</a></h3>
2409
2410
2411 <p>
2412 There is a statement or branch that if executed guarantees that
2413 a value is null at this point, and that
2414 value that is guaranteed to be dereferenced
2415 (except on forward paths involving runtime exceptions).
2416 </p>
2417 <p>Note that a check such as
2418 <code>if (x == null) throw new NullPointerException();</code>
2419 is treated as a dereference of <code>x</code>.
2420
2421
2422 <h3><a name="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: Value is null and guaranteed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH)</a></h3>
2423
2424
2425 <p>
2426 There is a statement or branch on an exception path
2427 that if executed guarantees that
2428 a value is null at this point, and that
2429 value that is guaranteed to be dereferenced
2430 (except on forward paths involving runtime exceptions).
2431 </p>
2432
2433
2434 <h3><a name="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP: Nonnull field is not initialized (NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR)</a></h3>
2435
2436
2437 <p> The field is marked as nonnull, but isn't written to by the constructor.
2438 The field might be initialized elsewhere during constructor, or might always
2439 be initialized before use.
2440 </p>
2441
2442
2443 <h3><a name="NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a nonnull parameter (NP_NONNULL_PARAM_VIOLATION)</a></h3>
2444
2445
2446 <p>
2447 This method passes a null value as the parameter of a method which
2448 must be nonnull. Either this parameter has been explicitly marked
2449 as @Nonnull, or analysis has determined that this parameter is
2450 always dereferenced.
2451 </p>
2452
2453
2454 <h3><a name="NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is declared @NonNull (NP_NONNULL_RETURN_VIOLATION)</a></h3>
2455
2456
2457 <p>
2458 This method may return a null value, but the method (or a superclass method
2459 which it overrides) is declared to return @NonNull.
2460 </p>
2461
2462
2463 <h3><a name="NP_NULL_INSTANCEOF">NP: A known null value is checked to see if it is an instance of a type (NP_NULL_INSTANCEOF)</a></h3>
2464
2465
2466 <p>
2467 This instanceof test will always return false, since the value being checked is guaranteed to be null.
2468 Although this is safe, make sure it isn't
2469 an indication of some misunderstanding or some other logic error.
2470 </p>
2471
2472
2473 <h3><a name="NP_NULL_ON_SOME_PATH">NP: Possible null pointer dereference (NP_NULL_ON_SOME_PATH)</a></h3>
2474
2475
2476 <p> There is a branch of statement that, <em>if executed,</em> guarantees that
2477 a null value will be dereferenced, which
2478 would generate a <code>NullPointerException</code> when the code is executed.
2479 Of course, the problem might be that the branch or statement is infeasible and that
2480 the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.
2481 </p>
2482
2483
2484 <h3><a name="NP_NULL_ON_SOME_PATH_EXCEPTION">NP: Possible null pointer dereference in method on exception path (NP_NULL_ON_SOME_PATH_EXCEPTION)</a></h3>
2485
2486
2487 <p> A reference value which is null on some exception control path is
2488 dereferenced here.&nbsp; This may lead to a <code>NullPointerException</code>
2489 when the code is executed.&nbsp;
2490 Note that because FindBugs currently does not prune infeasible exception paths,
2491 this may be a false warning.</p>
2492
2493 <p> Also note that FindBugs considers the default case of a switch statement to
2494 be an exception path, since the default case is often infeasible.</p>
2495
2496
2497 <h3><a name="NP_NULL_PARAM_DEREF">NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF)</a></h3>
2498
2499
2500 <p>
2501 This method call passes a null value for a nonnull method parameter.
2502 Either the parameter is annotated as a parameter that should
2503 always be nonnull, or analysis has shown that it will always be
2504 dereferenced.
2505 </p>
2506
2507
2508 <h3><a name="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS)</a></h3>
2509
2510
2511 <p>
2512 A possibly-null value is passed at a call site where all known
2513 target methods require the parameter to be nonnull.
2514 Either the parameter is annotated as a parameter that should
2515 always be nonnull, or analysis has shown that it will always be
2516 dereferenced.
2517 </p>
2518
2519
2520 <h3><a name="NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virtual method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL)</a></h3>
2521
2522
2523 <p>
2524 A possibly-null value is passed to a nonnull method parameter.
2525 Either the parameter is annotated as a parameter that should
2526 always be nonnull, or analysis has shown that it will always be
2527 dereferenced.
2528 </p>
2529
2530
2531 <h3><a name="NP_STORE_INTO_NONNULL_FIELD">NP: Store of null value into field annotated NonNull (NP_STORE_INTO_NONNULL_FIELD)</a></h3>
2532
2533
2534 <p> A value that could be null is stored into a field that has been annotated as NonNull. </p>
2535
2536
2537 <h3><a name="NP_UNWRITTEN_FIELD">NP: Read of unwritten field (NP_UNWRITTEN_FIELD)</a></h3>
2538
2539
2540 <p> The program is dereferencing a field that does not seem to ever have a non-null value written to it.
2541 Unless the field is initialized via some mechanism not seen by the analysis,
2542 dereferencing this value will generate a null pointer exception.
2543 </p>
2544
2545
2546 <h3><a name="NM_BAD_EQUAL">Nm: Class defines equal(Object); should it be equals(Object)? (NM_BAD_EQUAL)</a></h3>
2547
2548
2549 <p> This class defines a method <code>equal(Object)</code>.&nbsp; This method does
2550 not override the <code>equals(Object)</code> method in <code>java.lang.Object</code>,
2551 which is probably what was intended.</p>
2552
2553
2554 <h3><a name="NM_LCASE_HASHCODE">Nm: Class defines hashcode(); should it be hashCode()? (NM_LCASE_HASHCODE)</a></h3>
2555
2556
2557 <p> This class defines a method called <code>hashcode()</code>.&nbsp; This method
2558 does not override the <code>hashCode()</code> method in <code>java.lang.Object</code>,
2559 which is probably what was intended.</p>
2560
2561
2562 <h3><a name="NM_LCASE_TOSTRING">Nm: Class defines tostring(); should it be toString()? (NM_LCASE_TOSTRING)</a></h3>
2563
2564
2565 <p> This class defines a method called <code>tostring()</code>.&nbsp; This method
2566 does not override the <code>toString()</code> method in <code>java.lang.Object</code>,
2567 which is probably what was intended.</p>
2568
2569
2570 <h3><a name="NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor confusion (NM_METHOD_CONSTRUCTOR_CONFUSION)</a></h3>
2571
2572
2573 <p> This regular method has the same name as the class it is defined in. It is likely that this was intended to be a constructor.
2574 If it was intended to be a constructor, remove the declaration of a void return value.
2575 If you had accidently defined this method, realized the mistake, defined a proper constructor
2576 but can't get rid of this method due to backwards compatibility, deprecate the method.
2577 </p>
2578
2579
2580 <h3><a name="NM_VERY_CONFUSING">Nm: Very confusing method names (NM_VERY_CONFUSING)</a></h3>
2581
2582
2583 <p> The referenced methods have names that differ only by capitalization.
2584 This is very confusing because if the capitalization were
2585 identical then one of the methods would override the other.
2586 </p>
2587
2588
2589 <h3><a name="NM_WRONG_PACKAGE">Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE)</a></h3>
2590
2591
2592 <p> The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match
2593 the type of the corresponding parameter in the superclass. For example, if you have:</p>
2594
2595 <blockquote>
2596 <pre>
2597 import alpha.Foo;
2598 public class A {
2599 public int f(Foo x) { return 17; }
2600 }
2601 ----
2602 import beta.Foo;
2603 public class B extends A {
2604 public int f(Foo x) { return 42; }
2605 }
2606 </pre>
2607 </blockquote>
2608
2609 <p>The <code>f(Foo)</code> method defined in class <code>B</code> doesn't
2610 override the
2611 <code>f(Foo)</code> method defined in class <code>A</code>, because the argument
2612 types are <code>Foo</code>'s from different packages.
2613 </p>
2614
2615
2616 <h3><a name="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean literal in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT)</a></h3>
2617
2618
2619 <p>
2620 This method assigns a literal boolean value (true or false) to a boolean variable inside
2621 an if or while expression. Most probably this was supposed to be a boolean comparison using
2622 ==, not an assignment using =.
2623 </p>
2624
2625
2626 <h3><a name="RC_REF_COMPARISON">RC: Suspicious reference comparison (RC_REF_COMPARISON)</a></h3>
2627
2628
2629 <p> This method compares two reference values using the == or != operator,
2630 where the correct way to compare instances of this type is generally
2631 with the equals() method.
2632 It is possible to create distinct instances that are equal but do not compare as == since
2633 they are different objects.
2634 Examples of classes which should generally
2635 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p>
2636
2637
2638 <h3><a name="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE">RCN: Nullcheck of value previously dereferenced (RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE)</a></h3>
2639
2640
2641 <p> A value is checked here to see whether it is null, but this value can't
2642 be null because it was previously dereferenced and if it were null a null pointer
2643 exception would have occurred at the earlier dereference.
2644 Essentially, this code and the previous dereference
2645 disagree as to whether this value is allowed to be null. Either the check is redundant
2646 or the previous dereference is erroneous.</p>
2647
2648
2649 <h3><a name="RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">RE: Invalid syntax for regular expression (RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION)</a></h3>
2650
2651
2652 <p>
2653 The code here uses a regular expression that is invalid according to the syntax
2654 for regular expressions. This statement will throw a PatternSyntaxException when
2655 executed.
2656 </p>
2657
2658
2659 <h3><a name="RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION">RE: File.separator used for regular expression (RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION)</a></h3>
2660
2661
2662 <p>
2663 The code here uses <code>File.separator</code>
2664 where a regular expression is required. This will fail on Windows
2665 platforms, where the <code>File.separator</code> is a backslash, which is interpreted in a
2666 regular expression as an escape character. Amoung other options, you can just use
2667 <code>File.separatorChar=='\\' ? "\\\\" : File.separator</code> instead of
2668 <code>File.separator</code>
2669
2670 </p>
2671
2672
2673 <h3><a name="RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or "|" used for regular expression (RE_POSSIBLE_UNINTENDED_PATTERN)</a></h3>
2674
2675
2676 <p>
2677 A String function is being invoked and "." or "|" is being passed
2678 to a parameter that takes a regular expression as an argument. Is this what you intended?
2679 For example
2680 <li>s.replaceAll(".", "/") will return a String in which <em>every</em> character has been replaced by a '/' character
2681 <li>s.split(".") <em>always</em> returns a zero length array of String
2682 <li>"ab|cd".replaceAll("|", "/") will return "/a/b/|/c/d/"
2683 <li>"ab|cd".split("|") will return array with six (!) elements: [, a, b, |, c, d]
2684 </p>
2685
2686
2687 <h3><a name="RV_01_TO_INT">RV: Random value from 0 to 1 is coerced to the integer 0 (RV_01_TO_INT)</a></h3>
2688
2689
2690 <p>A random value from 0 to 1 is being coerced to the integer value 0. You probably
2691 want to multiple the random value by something else before coercing it to an integer, or use the <code>Random.nextInt(n)</code> method.
2692 </p>
2693
2694
2695 <h3><a name="RV_ABSOLUTE_VALUE_OF_HASHCODE">RV: Bad attempt to compute absolute value of signed 32-bit hashcode (RV_ABSOLUTE_VALUE_OF_HASHCODE)</a></h3>
2696
2697
2698 <p> This code generates a hashcode and then computes
2699 the absolute value of that hashcode. If the hashcode
2700 is <code>Integer.MIN_VALUE</code>, then the result will be negative as well (since
2701 <code>Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE</code>).
2702 </p>
2703 <p>One out of 2^32 strings have a hashCode of Integer.MIN_VALUE,
2704 including "polygenelubricants" "GydZG_" and ""DESIGNING WORKHOUSES".
2705 </p>
2706
2707
2708 <h3><a name="RV_ABSOLUTE_VALUE_OF_RANDOM_INT">RV: Bad attempt to compute absolute value of signed random integer (RV_ABSOLUTE_VALUE_OF_RANDOM_INT)</a></h3>
2709
2710
2711 <p> This code generates a random signed integer and then computes
2712 the absolute value of that random integer. If the number returned by the random number
2713 generator is <code>Integer.MIN_VALUE</code>, then the result will be negative as well (since
2714 <code>Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE</code>). (Same problem arised for long values as well).
2715 </p>
2716
2717
2718 <h3><a name="RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE">RV: Code checks for specific values returned by compareTo (RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE)</a></h3>
2719
2720
2721 <p> This code invoked a compareTo or compare method, and checks to see if the return value is a specific value,
2722 such as 1 or -1. When invoking these methods, you should only check the sign of the result, not for any specific
2723 non-zero value. While many or most compareTo and compare methods only return -1, 0 or 1, some of them
2724 will return other values.
2725
2726
2727 <h3><a name="RV_EXCEPTION_NOT_THROWN">RV: Exception created and dropped rather than thrown (RV_EXCEPTION_NOT_THROWN)</a></h3>
2728
2729
2730 <p> This code creates an exception (or error) object, but doesn't do anything with it. For example,
2731 something like </p>
2732 <blockquote>
2733 <pre>
2734 if (x &lt; 0)
2735 new IllegalArgumentException("x must be nonnegative");
2736 </pre>
2737 </blockquote>
2738 <p>It was probably the intent of the programmer to throw the created exception:</p>
2739 <blockquote>
2740 <pre>
2741 if (x &lt; 0)
2742 throw new IllegalArgumentException("x must be nonnegative");
2743 </pre>
2744 </blockquote>
2745
2746
2747 <h3><a name="RV_RETURN_VALUE_IGNORED">RV: Method ignores return value (RV_RETURN_VALUE_IGNORED)</a></h3>
2748
2749
2750 <p> The return value of this method should be checked. One common
2751 cause of this warning is to invoke a method on an immutable object,
2752 thinking that it updates the object. For example, in the following code
2753 fragment,</p>
2754 <blockquote>
2755 <pre>
2756 String dateString = getHeaderField(name);
2757 dateString.trim();
2758 </pre>
2759 </blockquote>
2760 <p>the programmer seems to be thinking that the trim() method will update
2761 the String referenced by dateString. But since Strings are immutable, the trim()
2762 function returns a new String value, which is being ignored here. The code
2763 should be corrected to: </p>
2764 <blockquote>
2765 <pre>
2766 String dateString = getHeaderField(name);
2767 dateString = dateString.trim();
2768 </pre>
2769 </blockquote>
2770
2771
2772 <h3><a name="RpC_REPEATED_CONDITIONAL_TEST">RpC: Repeated conditional tests (RpC_REPEATED_CONDITIONAL_TEST)</a></h3>
2773
2774
2775 <p>The code contains a conditional test is performed twice, one right after the other
2776 (e.g., <code>x == 0 || x == 0</code>). Perhaps the second occurrence is intended to be something else
2777 (e.g., <code>x == 0 || y == 0</code>).
2778 </p>
2779
2780
2781 <h3><a name="SA_FIELD_SELF_ASSIGNMENT">SA: Self assignment of field (SA_FIELD_SELF_ASSIGNMENT)</a></h3>
2782
2783
2784 <p> This method contains a self assignment of a field; e.g.
2785 </p>
2786 <pre>
2787 int x;
2788 public void foo() {
2789 x = x;
2790 }
2791 </pre>
2792 <p>Such assignments are useless, and may indicate a logic error or typo.</p>
2793
2794
2795 <h3><a name="SA_FIELD_SELF_COMPARISON">SA: Self comparison of field with itself (SA_FIELD_SELF_COMPARISON)</a></h3>
2796
2797
2798 <p> This method compares a field with itself, and may indicate a typo or
2799 a logic error. Make sure that you are comparing the right things.
2800 </p>
2801
2802
2803 <h3><a name="SA_FIELD_SELF_COMPUTATION">SA: Nonsensical self computation involving a field (e.g., x & x) (SA_FIELD_SELF_COMPUTATION)</a></h3>
2804
2805
2806 <p> This method performs a nonsensical computation of a field with another
2807 reference to the same field (e.g., x&x or x-x). Because of the nature
2808 of the computation, this operation doesn't seem to make sense,
2809 and may indicate a typo or
2810 a logic error. Double check the computation.
2811 </p>
2812
2813
2814 <h3><a name="SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">SA: Self assignment of local rather than assignment to field (SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD)</a></h3>
2815
2816
2817 <p> This method contains a self assignment of a local variable, and there
2818 is a field with an identical name.
2819 assignment appears to have been ; e.g.</p>
2820 <pre>
2821 int foo;
2822 public void setFoo(int foo) {
2823 foo = foo;
2824 }
2825 </pre>
2826 <p>The assignment is useless. Did you mean to assign to the field instead?</p>
2827
2828
2829 <h3><a name="SA_LOCAL_SELF_COMPARISON">SA: Self comparison of value with itself (SA_LOCAL_SELF_COMPARISON)</a></h3>
2830
2831
2832 <p> This method compares a local variable with itself, and may indicate a typo or
2833 a logic error. Make sure that you are comparing the right things.
2834 </p>
2835
2836
2837 <h3><a name="SA_LOCAL_SELF_COMPUTATION">SA: Nonsensical self computation involving a variable (e.g., x & x) (SA_LOCAL_SELF_COMPUTATION)</a></h3>
2838
2839
2840 <p> This method performs a nonsensical computation of a local variable with another
2841 reference to the same variable (e.g., x&x or x-x). Because of the nature
2842 of the computation, this operation doesn't seem to make sense,
2843 and may indicate a typo or
2844 a logic error. Double check the computation.
2845 </p>
2846
2847
2848 <h3><a name="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">SF: Dead store due to switch statement fall through (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH)</a></h3>
2849
2850
2851 <p> A value stored in the previous switch case is overwritten here due to a switch fall through. It is likely that
2852 you forgot to put a break or return at the end of the previous case.
2853 </p>
2854
2855
2856 <h3><a name="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW">SF: Dead store due to switch statement fall through to throw (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW)</a></h3>
2857
2858
2859 <p> A value stored in the previous switch case is ignored here due to a switch fall through to a place where
2860 an exception is thrown. It is likely that
2861 you forgot to put a break or return at the end of the previous case.
2862 </p>
2863
2864
2865 <h3><a name="SIC_THREADLOCAL_DEADLY_EMBRACE">SIC: Deadly embrace of non-static inner class and thread local (SIC_THREADLOCAL_DEADLY_EMBRACE)</a></h3>
2866
2867
2868 <p> This class is an inner class, but should probably be a static inner class.
2869 As it is, there is a serious danger of a deadly embrace between the inner class
2870 and the thread local in the outer class. Because the inner class isn't static,
2871 it retains a reference to the outer class.
2872 If the thread local contains a reference to an instance of the inner
2873 class, the inner and outer instance will both be reachable
2874 and not eligible for garbage collection.
2875 </p>
2876
2877
2878 <h3><a name="SIO_SUPERFLUOUS_INSTANCEOF">SIO: Unnecessary type check done using instanceof operator (SIO_SUPERFLUOUS_INSTANCEOF)</a></h3>
2879
2880
2881 <p> Type check performed using the instanceof operator where it can be statically determined whether the object
2882 is of the type requested. </p>
2883
2884
2885 <h3><a name="SQL_BAD_PREPARED_STATEMENT_ACCESS">SQL: Method attempts to access a prepared statement parameter with index 0 (SQL_BAD_PREPARED_STATEMENT_ACCESS)</a></h3>
2886
2887
2888 <p> A call to a setXXX method of a prepared statement was made where the
2889 parameter index is 0. As parameter indexes start at index 1, this is always a mistake.</p>
2890
2891
2892 <h3><a name="SQL_BAD_RESULTSET_ACCESS">SQL: Method attempts to access a result set field with index 0 (SQL_BAD_RESULTSET_ACCESS)</a></h3>
2893
2894
2895 <p> A call to getXXX or updateXXX methods of a result set was made where the
2896 field index is 0. As ResultSet fields start at index 1, this is always a mistake.</p>
2897
2898
2899 <h3><a name="STI_INTERRUPTED_ON_CURRENTTHREAD">STI: Unneeded use of currentThread() call, to call interrupted() (STI_INTERRUPTED_ON_CURRENTTHREAD)</a></h3>
2900
2901
2902 <p>
2903 This method invokes the Thread.currentThread() call, just to call the interrupted() method. As interrupted() is a
2904 static method, is more simple and clear to use Thread.interrupted().
2905 </p>
2906
2907
2908 <h3><a name="STI_INTERRUPTED_ON_UNKNOWNTHREAD">STI: Static Thread.interrupted() method invoked on thread instance (STI_INTERRUPTED_ON_UNKNOWNTHREAD)</a></h3>
2909
2910
2911 <p>
2912 This method invokes the Thread.interrupted() method on a Thread object that appears to be a Thread object that is
2913 not the current thread. As the interrupted() method is static, the interrupted method will be called on a different
2914 object than the one the author intended.
2915 </p>
2916
2917
2918 <h3><a name="SE_METHOD_MUST_BE_PRIVATE">Se: Method must be private in order for serialization to work (SE_METHOD_MUST_BE_PRIVATE)</a></h3>
2919
2920
2921 <p> This class implements the <code>Serializable</code> interface, and defines a method
2922 for custom serialization/deserialization. But since that method isn't declared private,
2923 it will be silently ignored by the serialization/deserialization API.</p>
2924
2925
2926 <h3><a name="SE_READ_RESOLVE_IS_STATIC">Se: The readResolve method must not be declared as a static method. (SE_READ_RESOLVE_IS_STATIC)</a></h3>
2927
2928
2929 <p> In order for the readResolve method to be recognized by the serialization
2930 mechanism, it must not be declared as a static method.
2931 </p>
2932
2933
2934 <h3><a name="TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">TQ: Value annotated as carrying a type qualifier used where a value that must not carry that qualifier is required (TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED)</a></h3>
2935
2936
2937 <p>
2938 A value specified as carrying a type qualifier annotation is
2939 consumed in a location or locations requiring that the value not
2940 carry that annotation.
2941 </p>
2942
2943 <p>
2944 More precisely, a value annotated with a type qualifier specifying when=ALWAYS
2945 is guaranteed to reach a use or uses where the same type qualifier specifies when=NEVER.
2946 </p>
2947
2948 <p>
2949 For example, say that @NonNegative is a nickname for
2950 the type qualifier annotation @Negative(when=When.NEVER).
2951 The following code will generate this warning because
2952 the return statement requires a @NonNegative value,
2953 but receives one that is marked as @Negative.
2954 </p>
2955 <blockquote>
2956 <pre>
2957 public @NonNegative Integer example(@Negative Integer value) {
2958 return value;
2959 }
2960 </pre>
2961 </blockquote>
2962
2963
2964 <h3><a name="TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS">TQ: Comparing values with incompatible type qualifiers (TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS)</a></h3>
2965
2966
2967 <p>
2968 A value specified as carrying a type qualifier annotation is
2969 compared with a value that doesn't ever carry that qualifier.
2970 </p>
2971
2972 <p>
2973 More precisely, a value annotated with a type qualifier specifying when=ALWAYS
2974 is compared with a value that where the same type qualifier specifies when=NEVER.
2975 </p>
2976
2977 <p>
2978 For example, say that @NonNegative is a nickname for
2979 the type qualifier annotation @Negative(when=When.NEVER).
2980 The following code will generate this warning because
2981 the return statement requires a @NonNegative value,
2982 but receives one that is marked as @Negative.
2983 </p>
2984 <blockquote>
2985 <pre>
2986 public boolean example(@Negative Integer value1, @NonNegative Integer value2) {
2987 return value1.equals(value2);
2988 }
2989 </pre>
2990 </blockquote>
2991
2992
2993 <h3><a name="TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">TQ: Value that might not carry a type qualifier is always used in a way requires that type qualifier (TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK)</a></h3>
2994
2995
2996 <p>
2997 A value that is annotated as possibility not being an instance of
2998 the values denoted by the type qualifier, and the value is guaranteed to be used
2999 in a way that requires values denoted by that type qualifier.
3000 </p>
3001
3002
3003 <h3><a name="TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value that might carry a type qualifier is always used in a way prohibits it from having that type qualifier (TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK)</a></h3>
3004
3005
3006 <p>
3007 A value that is annotated as possibility being an instance of
3008 the values denoted by the type qualifier, and the value is guaranteed to be used
3009 in a way that prohibits values denoted by that type qualifier.
3010 </p>
3011
3012
3013 <h3><a name="TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">TQ: Value annotated as never carrying a type qualifier used where value carrying that qualifier is required (TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED)</a></h3>
3014
3015
3016 <p>
3017 A value specified as not carrying a type qualifier annotation is guaranteed
3018 to be consumed in a location or locations requiring that the value does
3019 carry that annotation.
3020 </p>
3021
3022 <p>
3023 More precisely, a value annotated with a type qualifier specifying when=NEVER
3024 is guaranteed to reach a use or uses where the same type qualifier specifies when=ALWAYS.
3025 </p>
3026
3027 <p>
3028 TODO: example
3029 </p>
3030
3031
3032 <h3><a name="TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED">TQ: Value without a type qualifier used where a value is required to have that qualifier (TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED)</a></h3>
3033
3034
3035 <p>
3036 A value is being used in a way that requires the value be annotation with a type qualifier.
3037 The type qualifier is strict, so the tool rejects any values that do not have
3038 the appropriate annotation.
3039 </p>
3040
3041 <p>
3042 To coerce a value to have a strict annotation, define an identity function where the return value is annotated
3043 with the strict annotation.
3044 This is the only way to turn a non-annotated value into a value with a strict type qualifier annotation.
3045 </p>
3046
3047
3048
3049 <h3><a name="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">UMAC: Uncallable method defined in anonymous class (UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS)</a></h3>
3050
3051
3052 <p> This anonymous class defined a method that is not directly invoked and does not override
3053 a method in a superclass. Since methods in other classes cannot directly invoke methods
3054 declared in an anonymous class, it seems that this method is uncallable. The method
3055 might simply be dead code, but it is also possible that the method is intended to
3056 override a method declared in a superclass, and due to an typo or other error the method does not,
3057 in fact, override the method it is intended to.
3058 </p>
3059
3060
3061 <h3><a name="UR_UNINIT_READ">UR: Uninitialized read of field in constructor (UR_UNINIT_READ)</a></h3>
3062
3063
3064 <p> This constructor reads a field which has not yet been assigned a value.&nbsp;
3065 This is often caused when the programmer mistakenly uses the field instead
3066 of one of the constructor's parameters.</p>
3067
3068
3069 <h3><a name="UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR">UR: Uninitialized read of field method called from constructor of superclass (UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR)</a></h3>
3070
3071
3072 <p> This method is invoked in the constructor of of the superclass. At this point,
3073 the fields of the class have not yet initialized.</p>
3074 <p>To make this more concrete, consider the following classes:</p>
3075 <pre>abstract class A {
3076 int hashCode;
3077 abstract Object getValue();
3078 A() {
3079 hashCode = getValue().hashCode();
3080 }
3081 }
3082 class B extends A {
3083 Object value;
3084 B(Object v) {
3085 this.value = v;
3086 }
3087 Object getValue() {
3088 return value;
3089 }
3090 }</pre>
3091 <p>When a <code>B</code> is constructed,
3092 the constructor for the <code>A</code> class is invoked
3093 <em>before</em> the constructor for <code>B</code> sets <code>value</code>.
3094 Thus, when the constructor for <code>A</code> invokes <code>getValue</code>,
3095 an uninitialized value is read for <code>value</code>
3096 </p>
3097
3098
3099 <h3><a name="DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">USELESS_STRING: Invocation of toString on an unnamed array (DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY)</a></h3>
3100
3101
3102 <p>
3103 The code invokes toString on an (anonymous) array. Calling toString on an array generates a fairly useless result
3104 such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable
3105 String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.
3106 </p>
3107
3108
3109 <h3><a name="DMI_INVOKING_TOSTRING_ON_ARRAY">USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ARRAY)</a></h3>
3110
3111
3112 <p>
3113 The code invokes toString on an array, which will generate a fairly useless result
3114 such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable
3115 String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.
3116 </p>
3117
3118
3119 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">USELESS_STRING: Array formatted in useless way using format string (VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY)</a></h3>
3120
3121
3122 <p>
3123 One of the arguments being formatted with a format string is an array. This will be formatted
3124 using a fairly useless format, such as [I@304282, which doesn't actually show the contents
3125 of the array.
3126 Consider wrapping the array using <code>Arrays.asList(...)</code> before handling it off to a formatted.
3127 </p>
3128
3129
3130 <h3><a name="UWF_NULL_FIELD">UwF: Field only ever set to null (UWF_NULL_FIELD)</a></h3>
3131
3132
3133 <p> All writes to this field are of the constant value null, and thus
3134 all reads of the field will return null.
3135 Check for errors, or remove it if it is useless.</p>
3136
3137
3138 <h3><a name="UWF_UNWRITTEN_FIELD">UwF: Unwritten field (UWF_UNWRITTEN_FIELD)</a></h3>
3139
3140
3141 <p> This field is never written.&nbsp; All reads of it will return the default
3142 value. Check for errors (should it have been initialized?), or remove it if it is useless.</p>
3143
3144
3145 <h3><a name="VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">VA: Primitive array passed to function expecting a variable number of object arguments (VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG)</a></h3>
3146
3147
3148 <p>
3149 This code passes a primitive array to a function that takes a variable number of object arguments.
3150 This creates an array of length one to hold the primitive array and passes it to the function.
3151 </p>
3152
3153
3154 <h3><a name="VR_UNRESOLVABLE_REFERENCE">VR: Class makes reference to unresolvable class or method (VR_UNRESOLVABLE_REFERENCE)</a></h3>
3155
3156
3157 <p>
3158 This class makes a reference to a class or method that can not be
3159 resolved using against the libraries it is being analyzed with.
3160 </p>
3161
3162
3163 <h3><a name="LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">LG: Potential lost logger changes due to weak reference in OpenJDK (LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE)</a></h3>
3164
3165
3166 <p>OpenJDK introduces a potential incompatibility.
3167 In particular, the java.util.logging.Logger behavior has
3168 changed. Instead of using strong references, it now uses weak references
3169 internally. That's a reasonable change, but unfortunately some code relies on
3170 the old behavior - when changing logger configuration, it simply drops the
3171 logger reference. That means that the garbage collector is free to reclaim
3172 that memory, which means that the logger configuration is lost. For example,
3173 consider:
3174 </p>
3175
3176 <pre>public static void initLogging() throws Exception {
3177 Logger logger = Logger.getLogger("edu.umd.cs");
3178 logger.addHandler(new FileHandler()); // call to change logger configuration
3179 logger.setUseParentHandlers(false); // another call to change logger configuration
3180 }</pre>
3181
3182 <p>The logger reference is lost at the end of the method (it doesn't
3183 escape the method), so if you have a garbage collection cycle just
3184 after the call to initLogging, the logger configuration is lost
3185 (because Logger only keeps weak references).</p>
3186
3187 <pre>public static void main(String[] args) throws Exception {
3188 initLogging(); // adds a file handler to the logger
3189 System.gc(); // logger configuration lost
3190 Logger.getLogger("edu.umd.cs").info("Some message"); // this isn't logged to the file as expected
3191 }</pre>
3192 <p><em>Ulf Ochsenfahrt and Eric Fellheimer</em></p>
3193
3194
3195 <h3><a name="OBL_UNSATISFIED_OBLIGATION">OBL: Method may fail to clean up stream or resource (OBL_UNSATISFIED_OBLIGATION)</a></h3>
3196
3197
3198 <p>
3199 This method may fail to clean up (close, dispose of) a stream,
3200 database object, or other
3201 resource requiring an explicit cleanup operation.
3202 </p>
3203
3204 <p>
3205 In general, if a method opens a stream or other resource,
3206 the method should use a try/finally block to ensure that
3207 the stream or resource is cleaned up before the method
3208 returns.
3209 </p>
3210
3211 <p>
3212 This bug pattern is essentially the same as the
3213 OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE
3214 bug patterns, but is based on a different
3215 (and hopefully better) static analysis technique.
3216 We are interested is getting feedback about the
3217 usefulness of this bug pattern.
3218 To send feedback, either:
3219 </p>
3220 <ul>
3221 <li>send email to findbugs@cs.umd.edu</li>
3222 <li>file a bug report: <a href="http://findbugs.sourceforge.net/reportingBugs.html">http://findbugs.sourceforge.net/reportingBugs.html</a></li>
3223 </ul>
3224
3225 <p>
3226 In particular,
3227 the false-positive suppression heuristics for this
3228 bug pattern have not been extensively tuned, so
3229 reports about false positives are helpful to us.
3230 </p>
3231
3232 <p>
3233 See Weimer and Necula, <i>Finding and Preventing Run-Time Error Handling Mistakes</i>, for
3234 a description of the analysis technique.
3235 </p>
3236
3237
3238 <h3><a name="OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">OBL: Method may fail to clean up stream or resource on checked exception (OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE)</a></h3>
3239
3240
3241 <p>
3242 This method may fail to clean up (close, dispose of) a stream,
3243 database object, or other
3244 resource requiring an explicit cleanup operation.
3245 </p>
3246
3247 <p>
3248 In general, if a method opens a stream or other resource,
3249 the method should use a try/finally block to ensure that
3250 the stream or resource is cleaned up before the method
3251 returns.
3252 </p>
3253
3254 <p>
3255 This bug pattern is essentially the same as the
3256 OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE
3257 bug patterns, but is based on a different
3258 (and hopefully better) static analysis technique.
3259 We are interested is getting feedback about the
3260 usefulness of this bug pattern.
3261 To send feedback, either:
3262 </p>
3263 <ul>
3264 <li>send email to findbugs@cs.umd.edu</li>
3265 <li>file a bug report: <a href="http://findbugs.sourceforge.net/reportingBugs.html">http://findbugs.sourceforge.net/reportingBugs.html</a></li>
3266 </ul>
3267
3268 <p>
3269 In particular,
3270 the false-positive suppression heuristics for this
3271 bug pattern have not been extensively tuned, so
3272 reports about false positives are helpful to us.
3273 </p>
3274
3275 <p>
3276 See Weimer and Necula, <i>Finding and Preventing Run-Time Error Handling Mistakes</i>, for
3277 a description of the analysis technique.
3278 </p>
3279
3280
3281 <h3><a name="TESTING">TEST: Testing (TESTING)</a></h3>
3282
3283
3284 <p>This bug pattern is only generated by new, incompletely implemented
3285 bug detectors.</p>
3286
3287
3288 <h3><a name="DM_CONVERT_CASE">Dm: Consider using Locale parameterized version of invoked method (DM_CONVERT_CASE)</a></h3>
3289
3290
3291 <p> A String is being converted to upper or lowercase, using the platform's default encoding. This may
3292 result in improper conversions when used with international characters. Use the </p>
3293 <ul>
3294 <li>String.toUpperCase( Locale l )</li>
3295 <li>String.toLowerCase( Locale l )</li>
3296 </ul>
3297 <p>versions instead.</p>
3298
3299
3300 <h3><a name="DM_DEFAULT_ENCODING">Dm: Reliance on default encoding (DM_DEFAULT_ENCODING)</a></h3>
3301
3302
3303 <p> Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. </p>
3304
3305
3306 <h3><a name="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">DP: Classloaders should only be created inside doPrivileged block (DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED)</a></h3>
3307
3308
3309 <p> This code creates a classloader, which needs permission if a security manage is installed.
3310 If this code might be invoked by code that does not
3311 have security permissions, then the classloader creation needs to occur inside a doPrivileged block.</p>
3312
3313
3314 <h3><a name="DP_DO_INSIDE_DO_PRIVILEGED">DP: Method invoked that should be only be invoked inside a doPrivileged block (DP_DO_INSIDE_DO_PRIVILEGED)</a></h3>
3315
3316
3317 <p> This code invokes a method that requires a security permission check.
3318 If this code will be granted security permissions, but might be invoked by code that does not
3319 have security permissions, then the invocation needs to occur inside a doPrivileged block.</p>
3320
3321
3322 <h3><a name="EI_EXPOSE_REP">EI: May expose internal representation by returning reference to mutable object (EI_EXPOSE_REP)</a></h3>
3323
3324
3325 <p> Returning a reference to a mutable object value stored in one of the object's fields
3326 exposes the internal representation of the object.&nbsp;
3327 If instances
3328 are accessed by untrusted code, and unchecked changes to
3329 the mutable object would compromise security or other
3330 important properties, you will need to do something different.
3331 Returning a new copy of the object is better approach in many situations.</p>
3332
3333
3334 <h3><a name="EI_EXPOSE_REP2">EI2: May expose internal representation by incorporating reference to mutable object (EI_EXPOSE_REP2)</a></h3>
3335
3336
3337 <p> This code stores a reference to an externally mutable object into the
3338 internal representation of the object.&nbsp;
3339 If instances
3340 are accessed by untrusted code, and unchecked changes to
3341 the mutable object would compromise security or other
3342 important properties, you will need to do something different.
3343 Storing a copy of the object is better approach in many situations.</p>
3344
3345
3346 <h3><a name="FI_PUBLIC_SHOULD_BE_PROTECTED">FI: Finalizer should be protected, not public (FI_PUBLIC_SHOULD_BE_PROTECTED)</a></h3>
3347
3348
3349 <p> A class's <code>finalize()</code> method should have protected access,
3350 not public.</p>
3351
3352
3353 <h3><a name="EI_EXPOSE_STATIC_REP2">MS: May expose internal static state by storing a mutable object into a static field (EI_EXPOSE_STATIC_REP2)</a></h3>
3354
3355
3356 <p> This code stores a reference to an externally mutable object into a static
3357 field.
3358 If unchecked changes to
3359 the mutable object would compromise security or other
3360 important properties, you will need to do something different.
3361 Storing a copy of the object is better approach in many situations.</p>
3362
3363
3364 <h3><a name="MS_CANNOT_BE_FINAL">MS: Field isn't final and can't be protected from malicious code (MS_CANNOT_BE_FINAL)</a></h3>
3365
3366
3367 <p>
3368 A mutable static field could be changed by malicious code or
3369 by accident from another package.
3370 Unfortunately, the way the field is used doesn't allow
3371 any easy fix to this problem.</p>
3372
3373
3374 <h3><a name="MS_EXPOSE_REP">MS: Public static method may expose internal representation by returning array (MS_EXPOSE_REP)</a></h3>
3375
3376
3377 <p> A public static method returns a reference to
3378 an array that is part of the static state of the class.
3379 Any code that calls this method can freely modify
3380 the underlying array.
3381 One fix is to return a copy of the array.</p>
3382
3383
3384 <h3><a name="MS_FINAL_PKGPROTECT">MS: Field should be both final and package protected (MS_FINAL_PKGPROTECT)</a></h3>
3385
3386
3387 <p>
3388 A mutable static field could be changed by malicious code or
3389 by accident from another package.
3390 The field could be made package protected and/or made final
3391 to avoid
3392 this vulnerability.</p>
3393
3394
3395 <h3><a name="MS_MUTABLE_ARRAY">MS: Field is a mutable array (MS_MUTABLE_ARRAY)</a></h3>
3396
3397
3398 <p> A final static field references an array
3399 and can be accessed by malicious code or
3400 by accident from another package.
3401 This code can freely modify the contents of the array.</p>
3402
3403
3404 <h3><a name="MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable (MS_MUTABLE_HASHTABLE)</a></h3>
3405
3406
3407 <p>A final static field references a Hashtable
3408 and can be accessed by malicious code or
3409 by accident from another package.
3410 This code can freely modify the contents of the Hashtable.</p>
3411
3412
3413 <h3><a name="MS_OOI_PKGPROTECT">MS: Field should be moved out of an interface and made package protected (MS_OOI_PKGPROTECT)</a></h3>
3414
3415
3416 <p>
3417 A final static field that is
3418 defined in an interface references a mutable
3419 object such as an array or hashtable.
3420 This mutable object could
3421 be changed by malicious code or
3422 by accident from another package.
3423 To solve this, the field needs to be moved to a class
3424 and made package protected
3425 to avoid
3426 this vulnerability.</p>
3427
3428
3429 <h3><a name="MS_PKGPROTECT">MS: Field should be package protected (MS_PKGPROTECT)</a></h3>
3430
3431
3432 <p> A mutable static field could be changed by malicious code or
3433 by accident.
3434 The field could be made package protected to avoid
3435 this vulnerability.</p>
3436
3437
3438 <h3><a name="MS_SHOULD_BE_FINAL">MS: Field isn't final but should be (MS_SHOULD_BE_FINAL)</a></h3>
3439
3440
3441 <p>
3442 This static field public but not final, and
3443 could be changed by malicious code or
3444 by accident from another package.
3445 The field could be made final to avoid
3446 this vulnerability.</p>
3447
3448
3449 <h3><a name="MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS: Field isn't final but should be refactored to be so (MS_SHOULD_BE_REFACTORED_TO_BE_FINAL)</a></h3>
3450
3451
3452 <p>
3453 This static field public but not final, and
3454 could be changed by malicious code or
3455 by accident from another package.
3456 The field could be made final to avoid
3457 this vulnerability. However, the static initializer contains more than one write
3458 to the field, so doing so will require some refactoring.
3459 </p>
3460
3461
3462 <h3><a name="AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION">AT: Sequence of calls to concurrent abstraction may not be atomic (AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION)</a></h3>
3463
3464
3465 <p>This code contains a sequence of calls to a concurrent abstraction
3466 (such as a concurrent hash map).
3467 These calls will not be executed atomically.
3468
3469
3470 <h3><a name="DC_DOUBLECHECK">DC: Possible double check of field (DC_DOUBLECHECK)</a></h3>
3471
3472
3473 <p> This method may contain an instance of double-checked locking.&nbsp;
3474 This idiom is not correct according to the semantics of the Java memory
3475 model.&nbsp; For more information, see the web page
3476 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html"
3477 >http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</p>
3478
3479
3480 <h3><a name="DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean (DL_SYNCHRONIZATION_ON_BOOLEAN)</a></h3>
3481
3482
3483 <p> The code synchronizes on a boxed primitive constant, such as an Boolean.</p>
3484 <pre>
3485 private static Boolean inited = Boolean.FALSE;
3486 ...
3487 synchronized(inited) {
3488 if (!inited) {
3489 init();
3490 inited = Boolean.TRUE;
3491 }
3492 }
3493 ...
3494 </pre>
3495 <p>Since there normally exist only two Boolean objects, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness
3496 and possible deadlock</p>
3497 <p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
3498
3499
3500 <h3><a name="DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: Synchronization on boxed primitive (DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE)</a></h3>
3501
3502
3503 <p> The code synchronizes on a boxed primitive constant, such as an Integer.</p>
3504 <pre>
3505 private static Integer count = 0;
3506 ...
3507 synchronized(count) {
3508 count++;
3509 }
3510 ...
3511 </pre>
3512 <p>Since Integer objects can be cached and shared,
3513 this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness
3514 and possible deadlock</p>
3515 <p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
3516
3517
3518 <h3><a name="DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: Synchronization on interned String (DL_SYNCHRONIZATION_ON_SHARED_CONSTANT)</a></h3>
3519
3520
3521 <p> The code synchronizes on interned String.</p>
3522 <pre>
3523 private static String LOCK = "LOCK";
3524 ...
3525 synchronized(LOCK) { ...}
3526 ...
3527 </pre>
3528 <p>Constant Strings are interned and shared across all other classes loaded by the JVM. Thus, this could
3529 is locking on something that other code might also be locking. This could result in very strange and hard to diagnose
3530 blocking and deadlock behavior. See <a href="http://www.javalobby.org/java/forums/t96352.html">http://www.javalobby.org/java/forums/t96352.html</a> and <a href="http://jira.codehaus.org/browse/JETTY-352">http://jira.codehaus.org/browse/JETTY-352</a>.
3531 </p>
3532 <p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
3533
3534
3535 <h3><a name="DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE">DL: Synchronization on boxed primitive values (DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE)</a></h3>
3536
3537
3538 <p> The code synchronizes on an apparently unshared boxed primitive,
3539 such as an Integer.</p>
3540 <pre>
3541 private static final Integer fileLock = new Integer(1);
3542 ...
3543 synchronized(fileLock) {
3544 .. do something ..
3545 }
3546 ...
3547 </pre>
3548 <p>It would be much better, in this code, to redeclare fileLock as</p>
3549 <pre>
3550 private static final Object fileLock = new Object();
3551 </pre>
3552 <p>
3553 The existing code might be OK, but it is confusing and a
3554 future refactoring, such as the "Remove Boxing" refactoring in IntelliJ,
3555 might replace this with the use of an interned Integer object shared
3556 throughout the JVM, leading to very confusing behavior and potential deadlock.
3557 </p>
3558
3559
3560 <h3><a name="DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wait() called on Condition (DM_MONITOR_WAIT_ON_CONDITION)</a></h3>
3561
3562
3563 <p>
3564 This method calls <code>wait()</code> on a
3565 <code>java.util.concurrent.locks.Condition</code> object.&nbsp;
3566 Waiting for a <code>Condition</code> should be done using one of the <code>await()</code>
3567 methods defined by the <code>Condition</code> interface.
3568 </p>
3569
3570
3571 <h3><a name="DM_USELESS_THREAD">Dm: A thread was created using the default empty run method (DM_USELESS_THREAD)</a></h3>
3572
3573
3574 <p>This method creates a thread without specifying a run method either by deriving from the Thread class, or
3575 by passing a Runnable object. This thread, then, does nothing but waste time.
3576 </p>
3577
3578
3579 <h3><a name="ESync_EMPTY_SYNC">ESync: Empty synchronized block (ESync_EMPTY_SYNC)</a></h3>
3580
3581
3582 <p> The code contains an empty synchronized block:</p>
3583 <pre>
3584 synchronized() {}
3585 </pre>
3586 <p>Empty synchronized blocks are far more subtle and hard to use correctly
3587 than most people recognize, and empty synchronized blocks
3588 are almost never a better solution
3589 than less contrived solutions.
3590 </p>
3591
3592
3593 <h3><a name="IS2_INCONSISTENT_SYNC">IS: Inconsistent synchronization (IS2_INCONSISTENT_SYNC)</a></h3>
3594
3595
3596 <p> The fields of this class appear to be accessed inconsistently with respect
3597 to synchronization.&nbsp; This bug report indicates that the bug pattern detector
3598 judged that
3599 </p>
3600 <ul>
3601 <li> The class contains a mix of locked and unlocked accesses,</li>
3602 <li> The class is <b>not</b> annotated as javax.annotation.concurrent.NotThreadSafe,</li>
3603 <li> At least one locked access was performed by one of the class's own methods, and</li>
3604 <li> The number of unsynchronized field accesses (reads and writes) was no more than
3605 one third of all accesses, with writes being weighed twice as high as reads</li>
3606 </ul>
3607
3608 <p> A typical bug matching this bug pattern is forgetting to synchronize
3609 one of the methods in a class that is intended to be thread-safe.</p>
3610
3611 <p> You can select the nodes labeled "Unsynchronized access" to show the
3612 code locations where the detector believed that a field was accessed
3613 without synchronization.</p>
3614
3615 <p> Note that there are various sources of inaccuracy in this detector;
3616 for example, the detector cannot statically detect all situations in which
3617 a lock is held.&nbsp; Also, even when the detector is accurate in
3618 distinguishing locked vs. unlocked accesses, the code in question may still
3619 be correct.</p>
3620
3621
3622
3623 <h3><a name="IS_FIELD_NOT_GUARDED">IS: Field not guarded against concurrent access (IS_FIELD_NOT_GUARDED)</a></h3>
3624
3625
3626 <p> This field is annotated with net.jcip.annotations.GuardedBy or javax.annotation.concurrent.GuardedBy,
3627 but can be accessed in a way that seems to violate those annotations.</p>
3628
3629
3630 <h3><a name="JLM_JSR166_LOCK_MONITORENTER">JLM: Synchronization performed on Lock (JLM_JSR166_LOCK_MONITORENTER)</a></h3>
3631
3632
3633 <p> This method performs synchronization an object that implements
3634 java.util.concurrent.locks.Lock. Such an object is locked/unlocked
3635 using
3636 <code>acquire()</code>/<code>release()</code> rather
3637 than using the <code>synchronized (...)</code> construct.
3638 </p>
3639
3640
3641 <h3><a name="JLM_JSR166_UTILCONCURRENT_MONITORENTER">JLM: Synchronization performed on util.concurrent instance (JLM_JSR166_UTILCONCURRENT_MONITORENTER)</a></h3>
3642
3643
3644 <p> This method performs synchronization an object that is an instance of
3645 a class from the java.util.concurrent package (or its subclasses). Instances
3646 of these classes have their own concurrency control mechanisms that are orthogonal to
3647 the synchronization provided by the Java keyword <code>synchronized</code>. For example,
3648 synchronizing on an <code>AtomicBoolean</code> will not prevent other threads
3649 from modifying the <code>AtomicBoolean</code>.</p>
3650 <p>Such code may be correct, but should be carefully reviewed and documented,
3651 and may confuse people who have to maintain the code at a later date.
3652 </p>
3653
3654
3655 <h3><a name="JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">JLM: Using monitor style wait methods on util.concurrent abstraction (JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT)</a></h3>
3656
3657
3658 <p> This method calls
3659 <code>wait()</code>,
3660 <code>notify()</code> or
3661 <code>notifyAll()()</code>
3662 on an object that also provides an
3663 <code>await()</code>,
3664 <code>signal()</code>,
3665 <code>signalAll()</code> method (such as util.concurrent Condition objects).
3666 This probably isn't what you want, and even if you do want it, you should consider changing
3667 your design, as other developers will find it exceptionally confusing.
3668 </p>
3669
3670
3671 <h3><a name="LI_LAZY_INIT_STATIC">LI: Incorrect lazy initialization of static field (LI_LAZY_INIT_STATIC)</a></h3>
3672
3673
3674 <p> This method contains an unsynchronized lazy initialization of a non-volatile static field.
3675 Because the compiler or processor may reorder instructions,
3676 threads are not guaranteed to see a completely initialized object,
3677 <em>if the method can be called by multiple threads</em>.
3678 You can make the field volatile to correct the problem.
3679 For more information, see the
3680 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/">Java Memory Model web site</a>.
3681 </p>
3682
3683
3684 <h3><a name="LI_LAZY_INIT_UPDATE_STATIC">LI: Incorrect lazy initialization and update of static field (LI_LAZY_INIT_UPDATE_STATIC)</a></h3>
3685
3686
3687 <p> This method contains an unsynchronized lazy initialization of a static field.
3688 After the field is set, the object stored into that location is further updated or accessed.
3689 The setting of the field is visible to other threads as soon as it is set. If the
3690 futher accesses in the method that set the field serve to initialize the object, then
3691 you have a <em>very serious</em> multithreading bug, unless something else prevents
3692 any other thread from accessing the stored object until it is fully initialized.
3693 </p>
3694 <p>Even if you feel confident that the method is never called by multiple
3695 threads, it might be better to not set the static field until the value
3696 you are setting it to is fully populated/initialized.
3697
3698
3699 <h3><a name="ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD">ML: Synchronization on field in futile attempt to guard that field (ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD)</a></h3>
3700
3701
3702 <p> This method synchronizes on a field in what appears to be an attempt
3703 to guard against simultaneous updates to that field. But guarding a field
3704 gets a lock on the referenced object, not on the field. This may not
3705 provide the mutual exclusion you need, and other threads might
3706 be obtaining locks on the referenced objects (for other purposes). An example
3707 of this pattern would be:</p>
3708 <pre>
3709 private Long myNtfSeqNbrCounter = new Long(0);
3710 private Long getNotificationSequenceNumber() {
3711 Long result = null;
3712 synchronized(myNtfSeqNbrCounter) {
3713 result = new Long(myNtfSeqNbrCounter.longValue() + 1);
3714 myNtfSeqNbrCounter = new Long(result.longValue());
3715 }
3716 return result;
3717 }
3718 </pre>
3719
3720
3721 <h3><a name="ML_SYNC_ON_UPDATED_FIELD">ML: Method synchronizes on an updated field (ML_SYNC_ON_UPDATED_FIELD)</a></h3>
3722
3723
3724 <p> This method synchronizes on an object
3725 referenced from a mutable field.
3726 This is unlikely to have useful semantics, since different
3727 threads may be synchronizing on different objects.</p>
3728
3729
3730 <h3><a name="MSF_MUTABLE_SERVLET_FIELD">MSF: Mutable servlet field (MSF_MUTABLE_SERVLET_FIELD)</a></h3>
3731
3732
3733 <p>A web server generally only creates one instance of servlet or jsp class (i.e., treats
3734 the class as a Singleton),
3735 and will
3736 have multiple threads invoke methods on that instance to service multiple
3737 simultaneous requests.
3738 Thus, having a mutable instance field generally creates race conditions.
3739
3740
3741 <h3><a name="MWN_MISMATCHED_NOTIFY">MWN: Mismatched notify() (MWN_MISMATCHED_NOTIFY)</a></h3>
3742
3743
3744 <p> This method calls Object.notify() or Object.notifyAll() without obviously holding a lock
3745 on the object.&nbsp; Calling notify() or notifyAll() without a lock held will result in
3746 an <code>IllegalMonitorStateException</code> being thrown.</p>
3747
3748
3749 <h3><a name="MWN_MISMATCHED_WAIT">MWN: Mismatched wait() (MWN_MISMATCHED_WAIT)</a></h3>
3750
3751
3752 <p> This method calls Object.wait() without obviously holding a lock
3753 on the object.&nbsp; Calling wait() without a lock held will result in
3754 an <code>IllegalMonitorStateException</code> being thrown.</p>
3755
3756
3757 <h3><a name="NN_NAKED_NOTIFY">NN: Naked notify (NN_NAKED_NOTIFY)</a></h3>
3758
3759
3760 <p> A call to <code>notify()</code> or <code>notifyAll()</code>
3761 was made without any (apparent) accompanying
3762 modification to mutable object state.&nbsp; In general, calling a notify
3763 method on a monitor is done because some condition another thread is
3764 waiting for has become true.&nbsp; However, for the condition to be meaningful,
3765 it must involve a heap object that is visible to both threads.</p>
3766
3767 <p> This bug does not necessarily indicate an error, since the change to
3768 mutable object state may have taken place in a method which then called
3769 the method containing the notification.</p>
3770
3771
3772 <h3><a name="NP_SYNC_AND_NULL_CHECK_FIELD">NP: Synchronize and null check on the same field. (NP_SYNC_AND_NULL_CHECK_FIELD)</a></h3>
3773
3774
3775 <p>Since the field is synchronized on, it seems not likely to be null.
3776 If it is null and then synchronized on a NullPointerException will be
3777 thrown and the check would be pointless. Better to synchronize on
3778 another field.</p>
3779
3780
3781
3782 <h3><a name="NO_NOTIFY_NOT_NOTIFYALL">No: Using notify() rather than notifyAll() (NO_NOTIFY_NOT_NOTIFYALL)</a></h3>
3783
3784
3785 <p> This method calls <code>notify()</code> rather than <code>notifyAll()</code>.&nbsp;
3786 Java monitors are often used for multiple conditions.&nbsp; Calling <code>notify()</code>
3787 only wakes up one thread, meaning that the thread woken up might not be the
3788 one waiting for the condition that the caller just satisfied.</p>
3789
3790
3791 <h3><a name="RS_READOBJECT_SYNC">RS: Class's readObject() method is synchronized (RS_READOBJECT_SYNC)</a></h3>
3792
3793
3794 <p> This serializable class defines a <code>readObject()</code> which is
3795 synchronized.&nbsp; By definition, an object created by deserialization
3796 is only reachable by one thread, and thus there is no need for
3797 <code>readObject()</code> to be synchronized.&nbsp; If the <code>readObject()</code>
3798 method itself is causing the object to become visible to another thread,
3799 that is an example of very dubious coding style.</p>
3800
3801
3802 <h3><a name="RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED">RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused (RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED)</a></h3>
3803
3804
3805 The <code>putIfAbsent</code> method is typically used to ensure that a
3806 single value is associated with a given key (the first value for which put
3807 if absent succeeds).
3808 If you ignore the return value and retain a reference to the value passed in,
3809 you run the risk of retaining a value that is not the one that is associated with the key in the map.
3810 If it matters which one you use and you use the one that isn't stored in the map,
3811 your program will behave incorrectly.
3812
3813
3814 <h3><a name="RU_INVOKE_RUN">Ru: Invokes run on a thread (did you mean to start it instead?) (RU_INVOKE_RUN)</a></h3>
3815
3816
3817 <p> This method explicitly invokes <code>run()</code> on an object.&nbsp;
3818 In general, classes implement the <code>Runnable</code> interface because
3819 they are going to have their <code>run()</code> method invoked in a new thread,
3820 in which case <code>Thread.start()</code> is the right method to call.</p>
3821
3822
3823 <h3><a name="SC_START_IN_CTOR">SC: Constructor invokes Thread.start() (SC_START_IN_CTOR)</a></h3>
3824
3825
3826 <p> The constructor starts a thread. This is likely to be wrong if
3827 the class is ever extended/subclassed, since the thread will be started
3828 before the subclass constructor is started.</p>
3829
3830
3831 <h3><a name="SP_SPIN_ON_FIELD">SP: Method spins on field (SP_SPIN_ON_FIELD)</a></h3>
3832
3833
3834 <p> This method spins in a loop which reads a field.&nbsp; The compiler
3835 may legally hoist the read out of the loop, turning the code into an
3836 infinite loop.&nbsp; The class should be changed so it uses proper
3837 synchronization (including wait and notify calls).</p>
3838
3839
3840 <h3><a name="STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE">STCAL: Call to static Calendar (STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE)</a></h3>
3841
3842
3843 <p>Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use.
3844 The detector has found a call to an instance of Calendar that has been obtained via a static
3845 field. This looks suspicous.</p>
3846 <p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
3847 and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
3848
3849
3850 <h3><a name="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE">STCAL: Call to static DateFormat (STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE)</a></h3>
3851
3852
3853 <p>As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use.
3854 The detector has found a call to an instance of DateFormat that has been obtained via a static
3855 field. This looks suspicous.</p>
3856 <p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
3857 and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
3858
3859
3860 <h3><a name="STCAL_STATIC_CALENDAR_INSTANCE">STCAL: Static Calendar field (STCAL_STATIC_CALENDAR_INSTANCE)</a></h3>
3861
3862
3863 <p>Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use.
3864 Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the
3865 application. Under 1.4 problems seem to surface less often than under Java 5 where you will probably see
3866 random ArrayIndexOutOfBoundsExceptions or IndexOutOfBoundsExceptions in sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate().</p>
3867 <p>You may also experience serialization problems.</p>
3868 <p>Using an instance field is recommended.</p>
3869 <p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
3870 and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
3871
3872
3873 <h3><a name="STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE">STCAL: Static DateFormat (STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE)</a></h3>
3874
3875
3876 <p>As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use.
3877 Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the
3878 application.</p>
3879 <p>You may also experience serialization problems.</p>
3880 <p>Using an instance field is recommended.</p>
3881 <p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
3882 and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
3883
3884
3885 <h3><a name="SWL_SLEEP_WITH_LOCK_HELD">SWL: Method calls Thread.sleep() with a lock held (SWL_SLEEP_WITH_LOCK_HELD)</a></h3>
3886
3887
3888 <p>
3889 This method calls Thread.sleep() with a lock held. This may result
3890 in very poor performance and scalability, or a deadlock, since other threads may
3891 be waiting to acquire the lock. It is a much better idea to call
3892 wait() on the lock, which releases the lock and allows other threads
3893 to run.
3894 </p>
3895
3896
3897 <h3><a name="TLW_TWO_LOCK_WAIT">TLW: Wait with two locks held (TLW_TWO_LOCK_WAIT)</a></h3>
3898
3899
3900 <p> Waiting on a monitor while two locks are held may cause
3901 deadlock.
3902 &nbsp;
3903 Performing a wait only releases the lock on the object
3904 being waited on, not any other locks.
3905 &nbsp;
3906 This not necessarily a bug, but is worth examining
3907 closely.</p>
3908
3909
3910 <h3><a name="UG_SYNC_SET_UNSYNC_GET">UG: Unsynchronized get method, synchronized set method (UG_SYNC_SET_UNSYNC_GET)</a></h3>
3911
3912
3913 <p> This class contains similarly-named get and set
3914 methods where the set method is synchronized and the get method is not.&nbsp;
3915 This may result in incorrect behavior at runtime, as callers of the get
3916 method will not necessarily see a consistent state for the object.&nbsp;
3917 The get method should be made synchronized.</p>
3918
3919
3920 <h3><a name="UL_UNRELEASED_LOCK">UL: Method does not release lock on all paths (UL_UNRELEASED_LOCK)</a></h3>
3921
3922
3923 <p> This method acquires a JSR-166 (<code>java.util.concurrent</code>) lock,
3924 but does not release it on all paths out of the method. In general, the correct idiom
3925 for using a JSR-166 lock is:
3926 </p>
3927 <pre>
3928 Lock l = ...;
3929 l.lock();
3930 try {
3931 // do something
3932 } finally {
3933 l.unlock();
3934 }
3935 </pre>
3936
3937
3938 <h3><a name="UL_UNRELEASED_LOCK_EXCEPTION_PATH">UL: Method does not release lock on all exception paths (UL_UNRELEASED_LOCK_EXCEPTION_PATH)</a></h3>
3939
3940
3941 <p> This method acquires a JSR-166 (<code>java.util.concurrent</code>) lock,
3942 but does not release it on all exception paths out of the method. In general, the correct idiom
3943 for using a JSR-166 lock is:
3944 </p>
3945 <pre>
3946 Lock l = ...;
3947 l.lock();
3948 try {
3949 // do something
3950 } finally {
3951 l.unlock();
3952 }
3953 </pre>
3954
3955
3956 <h3><a name="UW_UNCOND_WAIT">UW: Unconditional wait (UW_UNCOND_WAIT)</a></h3>
3957
3958
3959 <p> This method contains a call to <code>java.lang.Object.wait()</code> which
3960 is not guarded by conditional control flow.&nbsp; The code should
3961 verify that condition it intends to wait for is not already satisfied
3962 before calling wait; any previous notifications will be ignored.
3963 </p>
3964
3965
3966 <h3><a name="VO_VOLATILE_INCREMENT">VO: An increment to a volatile field isn't atomic (VO_VOLATILE_INCREMENT)</a></h3>
3967
3968
3969 <p>This code increments a volatile field. Increments of volatile fields aren't
3970 atomic. If more than one thread is incrementing the field at the same time,
3971 increments could be lost.
3972 </p>
3973
3974
3975 <h3><a name="VO_VOLATILE_REFERENCE_TO_ARRAY">VO: A volatile reference to an array doesn't treat the array elements as volatile (VO_VOLATILE_REFERENCE_TO_ARRAY)</a></h3>
3976
3977
3978 <p>This declares a volatile reference to an array, which might not be what
3979 you want. With a volatile reference to an array, reads and writes of
3980 the reference to the array are treated as volatile, but the array elements
3981 are non-volatile. To get volatile array elements, you will need to use
3982 one of the atomic array classes in java.util.concurrent (provided
3983 in Java 5.0).</p>
3984
3985
3986 <h3><a name="WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL">WL: Synchronization on getClass rather than class literal (WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL)</a></h3>
3987
3988
3989 <p>
3990 This instance method synchronizes on <code>this.getClass()</code>. If this class is subclassed,
3991 subclasses will synchronize on the class object for the subclass, which isn't likely what was intended.
3992 For example, consider this code from java.awt.Label:</p>
3993 <pre>
3994 private static final String base = "label";
3995 private static int nameCounter = 0;
3996 String constructComponentName() {
3997 synchronized (getClass()) {
3998 return base + nameCounter++;
3999 }
4000 }
4001 </pre>
4002 <p>Subclasses of <code>Label</code> won't synchronize on the same subclass, giving rise to a datarace.
4003 Instead, this code should be synchronizing on <code>Label.class</code></p>
4004 <pre>
4005 private static final String base = "label";
4006 private static int nameCounter = 0;
4007 String constructComponentName() {
4008 synchronized (Label.class) {
4009 return base + nameCounter++;
4010 }
4011 }
4012 </pre>
4013 <p>Bug pattern contributed by Jason Mehrens</p>
4014
4015
4016 <h3><a name="WS_WRITEOBJECT_SYNC">WS: Class's writeObject() method is synchronized but nothing else is (WS_WRITEOBJECT_SYNC)</a></h3>
4017
4018
4019 <p> This class has a <code>writeObject()</code> method which is synchronized;
4020 however, no other method of the class is synchronized.</p>
4021
4022
4023 <h3><a name="WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await() not in loop (WA_AWAIT_NOT_IN_LOOP)</a></h3>
4024
4025
4026 <p> This method contains a call to <code>java.util.concurrent.await()</code>
4027 (or variants)
4028 which is not in a loop.&nbsp; If the object is used for multiple conditions,
4029 the condition the caller intended to wait for might not be the one
4030 that actually occurred.</p>
4031
4032
4033 <h3><a name="WA_NOT_IN_LOOP">Wa: Wait not in loop (WA_NOT_IN_LOOP)</a></h3>
4034
4035
4036 <p> This method contains a call to <code>java.lang.Object.wait()</code>
4037 which is not in a loop.&nbsp; If the monitor is used for multiple conditions,
4038 the condition the caller intended to wait for might not be the one
4039 that actually occurred.</p>
4040
4041
4042 <h3><a name="NOISE_FIELD_REFERENCE">NOISE: Bogus warning about a field reference (NOISE_FIELD_REFERENCE)</a></h3>
4043
4044
4045 <p>Bogus warning.</p>
4046
4047
4048 <h3><a name="NOISE_METHOD_CALL">NOISE: Bogus warning about a method call (NOISE_METHOD_CALL)</a></h3>
4049
4050
4051 <p>Bogus warning.</p>
4052
4053
4054 <h3><a name="NOISE_NULL_DEREFERENCE">NOISE: Bogus warning about a null pointer dereference (NOISE_NULL_DEREFERENCE)</a></h3>
4055
4056
4057 <p>Bogus warning.</p>
4058
4059
4060 <h3><a name="NOISE_OPERATION">NOISE: Bogus warning about an operation (NOISE_OPERATION)</a></h3>
4061
4062
4063 <p>Bogus warning.</p>
4064
4065
4066 <h3><a name="BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive value is boxed and then immediately unboxed (BX_BOXING_IMMEDIATELY_UNBOXED)</a></h3>
4067
4068
4069 <p>A primitive is boxed, and then immediately unboxed. This probably is due to a manual
4070 boxing in a place where an unboxed value is required, thus forcing the compiler
4071 to immediately undo the work of the boxing.
4072 </p>
4073
4074
4075 <h3><a name="BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">Bx: Primitive value is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION)</a></h3>
4076
4077
4078 <p>A primitive boxed value constructed and then immediately converted into a different primitive type
4079 (e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coercion (e.g., <code>(int) d</code>).</p>
4080
4081
4082 <h3><a name="BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and then immediately reboxed (BX_UNBOXING_IMMEDIATELY_REBOXED)</a></h3>
4083
4084
4085 <p>A boxed value is unboxed and then immediately reboxed.
4086 </p>
4087
4088
4089 <h3><a name="DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a primitive (DM_BOXED_PRIMITIVE_FOR_PARSING)</a></h3>
4090
4091
4092 <p>A boxed primitive is created from a String, just to extract the unboxed primitive value.
4093 It is more efficient to just call the static parseXXX method.</p>
4094
4095
4096 <h3><a name="DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive just to call toString (DM_BOXED_PRIMITIVE_TOSTRING)</a></h3>
4097
4098
4099 <p>A boxed primitive is allocated just to call toString(). It is more effective to just use the static
4100 form of toString which takes the primitive value. So,</p>
4101 <table>
4102 <tr><th>Replace...</th><th>With this...</th></tr>
4103 <tr><td>new Integer(1).toString()</td><td>Integer.toString(1)</td></tr>
4104 <tr><td>new Long(1).toString()</td><td>Long.toString(1)</td></tr>
4105 <tr><td>new Float(1.0).toString()</td><td>Float.toString(1.0)</td></tr>
4106 <tr><td>new Double(1.0).toString()</td><td>Double.toString(1.0)</td></tr>
4107 <tr><td>new Byte(1).toString()</td><td>Byte.toString(1)</td></tr>
4108 <tr><td>new Short(1).toString()</td><td>Short.toString(1)</td></tr>
4109 <tr><td>new Boolean(true).toString()</td><td>Boolean.toString(true)</td></tr>
4110 </table>
4111
4112
4113 <h3><a name="DM_FP_NUMBER_CTOR">Bx: Method invokes inefficient floating-point Number constructor; use static valueOf instead (DM_FP_NUMBER_CTOR)</a></h3>
4114
4115
4116 <p>
4117 Using <code>new Double(double)</code> is guaranteed to always result in a new object whereas
4118 <code>Double.valueOf(double)</code> allows caching of values to be done by the compiler, class library, or JVM.
4119 Using of cached values avoids object allocation and the code will be faster.
4120 </p>
4121 <p>
4122 Unless the class must be compatible with JVMs predating Java 1.5,
4123 use either autoboxing or the <code>valueOf()</code> method when creating instances of <code>Double</code> and <code>Float</code>.
4124 </p>
4125
4126
4127 <h3><a name="DM_NUMBER_CTOR">Bx: Method invokes inefficient Number constructor; use static valueOf instead (DM_NUMBER_CTOR)</a></h3>
4128
4129
4130 <p>
4131 Using <code>new Integer(int)</code> is guaranteed to always result in a new object whereas
4132 <code>Integer.valueOf(int)</code> allows caching of values to be done by the compiler, class library, or JVM.
4133 Using of cached values avoids object allocation and the code will be faster.
4134 </p>
4135 <p>
4136 Values between -128 and 127 are guaranteed to have corresponding cached instances
4137 and using <code>valueOf</code> is approximately 3.5 times faster than using constructor.
4138 For values outside the constant range the performance of both styles is the same.
4139 </p>
4140 <p>
4141 Unless the class must be compatible with JVMs predating Java 1.5,
4142 use either autoboxing or the <code>valueOf()</code> method when creating instances of
4143 <code>Long</code>, <code>Integer</code>, <code>Short</code>, <code>Character</code>, and <code>Byte</code>.
4144 </p>
4145
4146
4147 <h3><a name="DMI_BLOCKING_METHODS_ON_URL">Dm: The equals and hashCode methods of URL are blocking (DMI_BLOCKING_METHODS_ON_URL)</a></h3>
4148
4149
4150 <p> The equals and hashCode
4151 method of URL perform domain name resolution, this can result in a big performance hit.
4152 See <a href="http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html">http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html</a> for more information.
4153 Consider using <code>java.net.URI</code> instead.
4154 </p>
4155
4156
4157 <h3><a name="DMI_COLLECTION_OF_URLS">Dm: Maps and sets of URLs can be performance hogs (DMI_COLLECTION_OF_URLS)</a></h3>
4158
4159
4160 <p> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode
4161 method of URL perform domain name resolution, this can result in a big performance hit.
4162 See <a href="http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html">http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html</a> for more information.
4163 Consider using <code>java.net.URI</code> instead.
4164 </p>
4165
4166
4167 <h3><a name="DM_BOOLEAN_CTOR">Dm: Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead (DM_BOOLEAN_CTOR)</a></h3>
4168
4169
4170 <p> Creating new instances of <code>java.lang.Boolean</code> wastes
4171 memory, since <code>Boolean</code> objects are immutable and there are
4172 only two useful values of this type.&nbsp; Use the <code>Boolean.valueOf()</code>
4173 method (or Java 1.5 autoboxing) to create <code>Boolean</code> objects instead.</p>
4174
4175
4176 <h3><a name="DM_GC">Dm: Explicit garbage collection; extremely dubious except in benchmarking code (DM_GC)</a></h3>
4177
4178
4179 <p> Code explicitly invokes garbage collection.
4180 Except for specific use in benchmarking, this is very dubious.</p>
4181 <p>In the past, situations where people have explicitly invoked
4182 the garbage collector in routines such as close or finalize methods
4183 has led to huge performance black holes. Garbage collection
4184 can be expensive. Any situation that forces hundreds or thousands
4185 of garbage collections will bring the machine to a crawl.</p>
4186
4187
4188 <h3><a name="DM_NEW_FOR_GETCLASS">Dm: Method allocates an object, only to get the class object (DM_NEW_FOR_GETCLASS)</a></h3>
4189
4190
4191 <p>This method allocates an object just to call getClass() on it, in order to
4192 retrieve the Class object for it. It is simpler to just access the .class property of the class.</p>
4193
4194
4195 <h3><a name="DM_NEXTINT_VIA_NEXTDOUBLE">Dm: Use the nextInt method of Random rather than nextDouble to generate a random integer (DM_NEXTINT_VIA_NEXTDOUBLE)</a></h3>
4196
4197
4198 <p>If <code>r</code> is a <code>java.util.Random</code>, you can generate a random number from <code>0</code> to <code>n-1</code>
4199 using <code>r.nextInt(n)</code>, rather than using <code>(int)(r.nextDouble() * n)</code>.
4200 </p>
4201 <p>The argument to nextInt must be positive. If, for example, you want to generate a random
4202 value from -99 to 0, use <code>-r.nextInt(100)</code>.
4203 </p>
4204
4205
4206 <h3><a name="DM_STRING_CTOR">Dm: Method invokes inefficient new String(String) constructor (DM_STRING_CTOR)</a></h3>
4207
4208
4209 <p> Using the <code>java.lang.String(String)</code> constructor wastes memory
4210 because the object so constructed will be functionally indistinguishable
4211 from the <code>String</code> passed as a parameter.&nbsp; Just use the
4212 argument <code>String</code> directly.</p>
4213
4214
4215 <h3><a name="DM_STRING_TOSTRING">Dm: Method invokes toString() method on a String (DM_STRING_TOSTRING)</a></h3>
4216
4217
4218 <p> Calling <code>String.toString()</code> is just a redundant operation.
4219 Just use the String.</p>
4220
4221
4222 <h3><a name="DM_STRING_VOID_CTOR">Dm: Method invokes inefficient new String() constructor (DM_STRING_VOID_CTOR)</a></h3>
4223
4224
4225 <p> Creating a new <code>java.lang.String</code> object using the
4226 no-argument constructor wastes memory because the object so created will
4227 be functionally indistinguishable from the empty string constant
4228 <code>""</code>.&nbsp; Java guarantees that identical string constants
4229 will be represented by the same <code>String</code> object.&nbsp; Therefore,
4230 you should just use the empty string constant directly.</p>
4231
4232
4233 <h3><a name="HSC_HUGE_SHARED_STRING_CONSTANT">HSC: Huge string constants is duplicated across multiple class files (HSC_HUGE_SHARED_STRING_CONSTANT)</a></h3>
4234
4235
4236 <p>
4237 A large String constant is duplicated across multiple class files.
4238 This is likely because a final field is initialized to a String constant, and the Java language
4239 mandates that all references to a final field from other classes be inlined into
4240 that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6447475">JDK bug 6447475</a>
4241 for a description of an occurrence of this bug in the JDK and how resolving it reduced
4242 the size of the JDK by 1 megabyte.
4243 </p>
4244
4245
4246 <h3><a name="IMA_INEFFICIENT_MEMBER_ACCESS">IMA: Method accesses a private member variable of owning class (IMA_INEFFICIENT_MEMBER_ACCESS)</a></h3>
4247
4248
4249 <p>
4250 This method of an inner class reads from or writes to a private member variable of the owning class,
4251 or calls a private method of the owning class. The compiler must generate a special method to access this
4252 private member, causing this to be less efficient. Relaxing the protection of the member variable or method
4253 will allow the compiler to treat this as a normal access.
4254 </p>
4255
4256
4257 <h3><a name="ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses toArray() with zero-length array argument (ITA_INEFFICIENT_TO_ARRAY)</a></h3>
4258
4259
4260 <p> This method uses the toArray() method of a collection derived class, and passes
4261 in a zero-length prototype array argument. It is more efficient to use
4262 <code>myCollection.toArray(new Foo[myCollection.size()])</code>
4263 If the array passed in is big enough to store all of the
4264 elements of the collection, then it is populated and returned
4265 directly. This avoids the need to create a second array
4266 (by reflection) to return as the result.</p>
4267
4268
4269 <h3><a name="SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: Method concatenates strings using + in a loop (SBSC_USE_STRINGBUFFER_CONCATENATION)</a></h3>
4270
4271
4272 <p> The method seems to be building a String using concatenation in a loop.
4273 In each iteration, the String is converted to a StringBuffer/StringBuilder,
4274 appended to, and converted back to a String.
4275 This can lead to a cost quadratic in the number of iterations,
4276 as the growing string is recopied in each iteration. </p>
4277
4278 <p>Better performance can be obtained by using
4279 a StringBuffer (or StringBuilder in Java 1.5) explicitly.</p>
4280
4281 <p> For example:</p>
4282 <pre>
4283 // This is bad
4284 String s = "";
4285 for (int i = 0; i &lt; field.length; ++i) {
4286 s = s + field[i];
4287 }
4288
4289 // This is better
4290 StringBuffer buf = new StringBuffer();
4291 for (int i = 0; i &lt; field.length; ++i) {
4292 buf.append(field[i]);
4293 }
4294 String s = buf.toString();
4295 </pre>
4296
4297
4298 <h3><a name="SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a static inner class (SIC_INNER_SHOULD_BE_STATIC)</a></h3>
4299
4300
4301 <p> This class is an inner class, but does not use its embedded reference
4302 to the object which created it.&nbsp; This reference makes the instances
4303 of the class larger, and may keep the reference to the creator object
4304 alive longer than necessary.&nbsp; If possible, the class should be
4305 made static.
4306 </p>
4307
4308
4309 <h3><a name="SIC_INNER_SHOULD_BE_STATIC_ANON">SIC: Could be refactored into a named static inner class (SIC_INNER_SHOULD_BE_STATIC_ANON)</a></h3>
4310
4311
4312 <p> This class is an inner class, but does not use its embedded reference
4313 to the object which created it.&nbsp; This reference makes the instances
4314 of the class larger, and may keep the reference to the creator object
4315 alive longer than necessary.&nbsp; If possible, the class should be
4316 made into a <em>static</em> inner class. Since anonymous inner
4317 classes cannot be marked as static, doing this will require refactoring
4318 the inner class so that it is a named inner class.</p>
4319
4320
4321 <h3><a name="SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">SIC: Could be refactored into a static inner class (SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS)</a></h3>
4322
4323
4324 <p> This class is an inner class, but does not use its embedded reference
4325 to the object which created it except during construction of the
4326 inner object.&nbsp; This reference makes the instances
4327 of the class larger, and may keep the reference to the creator object
4328 alive longer than necessary.&nbsp; If possible, the class should be
4329 made into a <em>static</em> inner class. Since the reference to the
4330 outer object is required during construction of the inner instance,
4331 the inner class will need to be refactored so as to
4332 pass a reference to the outer instance to the constructor
4333 for the inner class.</p>
4334
4335
4336 <h3><a name="SS_SHOULD_BE_STATIC">SS: Unread field: should this field be static? (SS_SHOULD_BE_STATIC)</a></h3>
4337
4338
4339 <p> This class contains an instance final field that
4340 is initialized to a compile-time static value.
4341 Consider making the field static.</p>
4342
4343
4344 <h3><a name="UM_UNNECESSARY_MATH">UM: Method calls static Math class method on a constant value (UM_UNNECESSARY_MATH)</a></h3>
4345
4346
4347 <p> This method uses a static method from java.lang.Math on a constant value. This method's
4348 result in this case, can be determined statically, and is faster and sometimes more accurate to
4349 just use the constant. Methods detected are:
4350 </p>
4351 <table>
4352 <tr>
4353 <th>Method</th> <th>Parameter</th>
4354 </tr>
4355 <tr>
4356 <td>abs</td> <td>-any-</td>
4357 </tr>
4358 <tr>
4359 <td>acos</td> <td>0.0 or 1.0</td>
4360 </tr>
4361 <tr>
4362 <td>asin</td> <td>0.0 or 1.0</td>
4363 </tr>
4364 <tr>
4365 <td>atan</td> <td>0.0 or 1.0</td>
4366 </tr>
4367 <tr>
4368 <td>atan2</td> <td>0.0</td>
4369 </tr>
4370 <tr>
4371 <td>cbrt</td> <td>0.0 or 1.0</td>
4372 </tr>
4373 <tr>
4374 <td>ceil</td> <td>-any-</td>
4375 </tr>
4376 <tr>
4377 <td>cos</td> <td>0.0</td>
4378 </tr>
4379 <tr>
4380 <td>cosh</td> <td>0.0</td>
4381 </tr>
4382 <tr>
4383 <td>exp</td> <td>0.0 or 1.0</td>
4384 </tr>
4385 <tr>
4386 <td>expm1</td> <td>0.0</td>
4387 </tr>
4388 <tr>
4389 <td>floor</td> <td>-any-</td>
4390 </tr>
4391 <tr>
4392 <td>log</td> <td>0.0 or 1.0</td>
4393 </tr>
4394 <tr>
4395 <td>log10</td> <td>0.0 or 1.0</td>
4396 </tr>
4397 <tr>
4398 <td>rint</td> <td>-any-</td>
4399 </tr>
4400 <tr>
4401 <td>round</td> <td>-any-</td>
4402 </tr>
4403 <tr>
4404 <td>sin</td> <td>0.0</td>
4405 </tr>
4406 <tr>
4407 <td>sinh</td> <td>0.0</td>
4408 </tr>
4409 <tr>
4410 <td>sqrt</td> <td>0.0 or 1.0</td>
4411 </tr>
4412 <tr>
4413 <td>tan</td> <td>0.0</td>
4414 </tr>
4415 <tr>
4416 <td>tanh</td> <td>0.0</td>
4417 </tr>
4418 <tr>
4419 <td>toDegrees</td> <td>0.0 or 1.0</td>
4420 </tr>
4421 <tr>
4422 <td>toRadians</td> <td>0.0</td>
4423 </tr>
4424 </table>
4425
4426
4427 <h3><a name="UPM_UNCALLED_PRIVATE_METHOD">UPM: Private method is never called (UPM_UNCALLED_PRIVATE_METHOD)</a></h3>
4428
4429
4430 <p> This private method is never called. Although it is
4431 possible that the method will be invoked through reflection,
4432 it is more likely that the method is never used, and should be
4433 removed.
4434 </p>
4435
4436
4437 <h3><a name="URF_UNREAD_FIELD">UrF: Unread field (URF_UNREAD_FIELD)</a></h3>
4438
4439
4440 <p> This field is never read.&nbsp; Consider removing it from the class.</p>
4441
4442
4443 <h3><a name="UUF_UNUSED_FIELD">UuF: Unused field (UUF_UNUSED_FIELD)</a></h3>
4444
4445
4446 <p> This field is never used.&nbsp; Consider removing it from the class.</p>
4447
4448
4449 <h3><a name="WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use of keySet iterator instead of entrySet iterator (WMI_WRONG_MAP_ITERATOR)</a></h3>
4450
4451
4452 <p> This method accesses the value of a Map entry, using a key that was retrieved from
4453 a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the
4454 Map.get(key) lookup.</p>
4455
4456
4457 <h3><a name="DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded constant database password (DMI_CONSTANT_DB_PASSWORD)</a></h3>
4458
4459
4460 <p>This code creates a database connect using a hardcoded, constant password. Anyone with access to either the source code or the compiled code can
4461 easily learn the password.
4462 </p>
4463
4464
4465
4466 <h3><a name="DMI_EMPTY_DB_PASSWORD">Dm: Empty database password (DMI_EMPTY_DB_PASSWORD)</a></h3>
4467
4468
4469 <p>This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password.
4470 </p>
4471
4472
4473
4474 <h3><a name="HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP cookie formed from untrusted input (HRS_REQUEST_PARAMETER_TO_COOKIE)</a></h3>
4475
4476
4477 <p>This code constructs an HTTP Cookie using an untrusted HTTP parameter. If this cookie is added to an HTTP response, it will allow a HTTP response splitting
4478 vulnerability. See <a href="http://en.wikipedia.org/wiki/HTTP_response_splitting">http://en.wikipedia.org/wiki/HTTP_response_splitting</a>
4479 for more information.</p>
4480 <p>FindBugs looks only for the most blatant, obvious cases of HTTP response splitting.
4481 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4482 vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously
4483 consider using a commercial static analysis or pen-testing tool.
4484 </p>
4485
4486
4487
4488 <h3><a name="HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: HTTP Response splitting vulnerability (HRS_REQUEST_PARAMETER_TO_HTTP_HEADER)</a></h3>
4489
4490
4491 <p>This code directly writes an HTTP parameter to an HTTP header, which allows for a HTTP response splitting
4492 vulnerability. See <a href="http://en.wikipedia.org/wiki/HTTP_response_splitting">http://en.wikipedia.org/wiki/HTTP_response_splitting</a>
4493 for more information.</p>
4494 <p>FindBugs looks only for the most blatant, obvious cases of HTTP response splitting.
4495 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4496 vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously
4497 consider using a commercial static analysis or pen-testing tool.
4498 </p>
4499
4500
4501
4502 <h3><a name="PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute path traversal in servlet (PT_ABSOLUTE_PATH_TRAVERSAL)</a></h3>
4503
4504
4505 <p>The software uses an HTTP request parameter to construct a pathname that should be within a restricted directory,
4506 but it does not properly neutralize absolute path sequences such as "/abs/path" that can resolve to a location that is outside of that directory.
4507
4508 See <a href="http://cwe.mitre.org/data/definitions/36.html">http://cwe.mitre.org/data/definitions/36.html</a>
4509 for more information.</p>
4510 <p>FindBugs looks only for the most blatant, obvious cases of absolute path traversal.
4511 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4512 vulnerabilities that FindBugs doesn't report. If you are concerned about absolute path traversal, you should seriously
4513 consider using a commercial static analysis or pen-testing tool.
4514 </p>
4515
4516
4517
4518 <h3><a name="PT_RELATIVE_PATH_TRAVERSAL">PT: Relative path traversal in servlet (PT_RELATIVE_PATH_TRAVERSAL)</a></h3>
4519
4520
4521 <p>The software uses an HTTP request parameter to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.
4522
4523 See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org/data/definitions/23.html</a>
4524 for more information.</p>
4525 <p>FindBugs looks only for the most blatant, obvious cases of relative path traversal.
4526 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4527 vulnerabilities that FindBugs doesn't report. If you are concerned about relative path traversal, you should seriously
4528 consider using a commercial static analysis or pen-testing tool.
4529 </p>
4530
4531
4532
4533 <h3><a name="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQL: Nonconstant string passed to execute method on an SQL statement (SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE)</a></h3>
4534
4535
4536 <p>The method invokes the execute method on an SQL statement with a String that seems
4537 to be dynamically generated. Consider using
4538 a prepared statement instead. It is more efficient and less vulnerable to
4539 SQL injection attacks.
4540 </p>
4541
4542
4543 <h3><a name="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING">SQL: A prepared statement is generated from a nonconstant String (SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING)</a></h3>
4544
4545
4546 <p>The code creates an SQL prepared statement from a nonconstant String.
4547 If unchecked, tainted data from a user is used in building this String, SQL injection could
4548 be used to make the prepared statement do something unexpected and undesirable.
4549 </p>
4550
4551
4552 <h3><a name="XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JSP reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_JSP_WRITER)</a></h3>
4553
4554
4555 <p>This code directly writes an HTTP parameter to JSP output, which allows for a cross site scripting
4556 vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
4557 for more information.</p>
4558 <p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
4559 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
4560 vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
4561 consider using a commercial static analysis or pen-testing tool.
4562 </p>
4563
4564
4565 <h3><a name="XSS_REQUEST_PARAMETER_TO_SEND_ERROR">XSS: Servlet reflected cross site scripting vulnerability in error page (XSS_REQUEST_PARAMETER_TO_SEND_ERROR)</a></h3>
4566
4567
4568 <p>This code directly writes an HTTP parameter to a Server error page (using HttpServletResponse.sendError). Echoing this untrusted input allows
4569 for a reflected cross site scripting
4570 vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
4571 for more information.</p>
4572 <p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
4573 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
4574 vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
4575 consider using a commercial static analysis or pen-testing tool.
4576 </p>
4577
4578
4579
4580 <h3><a name="XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS: Servlet reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER)</a></h3>
4581
4582
4583 <p>This code directly writes an HTTP parameter to Servlet output, which allows for a reflected cross site scripting
4584 vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
4585 for more information.</p>
4586 <p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
4587 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
4588 vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
4589 consider using a commercial static analysis or pen-testing tool.
4590 </p>
4591
4592
4593
4594 <h3><a name="BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Questionable cast to abstract collection (BC_BAD_CAST_TO_ABSTRACT_COLLECTION)</a></h3>
4595
4596
4597 <p>
4598 This code casts a Collection to an abstract collection
4599 (such as <code>List</code>, <code>Set</code>, or <code>Map</code>).
4600 Ensure that you are guaranteed that the object is of the type
4601 you are casting to. If all you need is to be able
4602 to iterate through a collection, you don't need to cast it to a Set or List.
4603 </p>
4604
4605
4606 <h3><a name="BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Questionable cast to concrete collection (BC_BAD_CAST_TO_CONCRETE_COLLECTION)</a></h3>
4607
4608
4609 <p>
4610 This code casts an abstract collection (such as a Collection, List, or Set)
4611 to a specific concrete implementation (such as an ArrayList or HashSet).
4612 This might not be correct, and it may make your code fragile, since
4613 it makes it harder to switch to other concrete implementations at a future
4614 point. Unless you have a particular reason to do so, just use the abstract
4615 collection class.
4616 </p>
4617
4618
4619 <h3><a name="BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirmed cast (BC_UNCONFIRMED_CAST)</a></h3>
4620
4621
4622 <p>
4623 This cast is unchecked, and not all instances of the type casted from can be cast to
4624 the type it is being cast to. Check that your program logic ensures that this
4625 cast will not fail.
4626 </p>
4627
4628
4629 <h3><a name="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC: Unchecked/unconfirmed cast of return value from method (BC_UNCONFIRMED_CAST_OF_RETURN_VALUE)</a></h3>
4630
4631
4632 <p>
4633 This code performs an unchecked cast of the return value of a method.
4634 The code might be calling the method in such a way that the cast is guaranteed to be
4635 safe, but FindBugs is unable to verify that the cast is safe. Check that your program logic ensures that this
4636 cast will not fail.
4637 </p>
4638
4639
4640 <h3><a name="BC_VACUOUS_INSTANCEOF">BC: instanceof will always return true (BC_VACUOUS_INSTANCEOF)</a></h3>
4641
4642
4643 <p>
4644 This instanceof test will always return true (unless the value being tested is null).
4645 Although this is safe, make sure it isn't
4646 an indication of some misunderstanding or some other logic error.
4647 If you really want to test the value for being null, perhaps it would be clearer to do
4648 better to do a null test rather than an instanceof test.
4649 </p>
4650
4651
4652 <h3><a name="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSHIFT: Unsigned right shift cast to short/byte (ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT)</a></h3>
4653
4654
4655 <p>
4656 The code performs an unsigned right shift, whose result is then
4657 cast to a short or byte, which discards the upper bits of the result.
4658 Since the upper bits are discarded, there may be no difference between
4659 a signed and unsigned right shift (depending upon the size of the shift).
4660 </p>
4661
4662
4663 <h3><a name="CD_CIRCULAR_DEPENDENCY">CD: Test for circular dependencies among classes (CD_CIRCULAR_DEPENDENCY)</a></h3>
4664
4665
4666 <p>
4667 This class has a circular dependency with other classes. This makes building these classes
4668 difficult, as each is dependent on the other to build correctly. Consider using interfaces
4669 to break the hard dependency.
4670 </p>
4671
4672
4673 <h3><a name="CI_CONFUSED_INHERITANCE">CI: Class is final but declares protected field (CI_CONFUSED_INHERITANCE)</a></h3>
4674
4675
4676 <p>
4677 This class is declared to be final, but declares fields to be protected. Since the class
4678 is final, it can not be derived from, and the use of protected is confusing. The access
4679 modifier for the field should be changed to private or public to represent the true
4680 use for the field.
4681 </p>
4682
4683
4684 <h3><a name="DB_DUPLICATE_BRANCHES">DB: Method uses the same code for two branches (DB_DUPLICATE_BRANCHES)</a></h3>
4685
4686
4687 <p>
4688 This method uses the same code to implement two branches of a conditional branch.
4689 Check to ensure that this isn't a coding mistake.
4690 </p>
4691
4692
4693 <h3><a name="DB_DUPLICATE_SWITCH_CLAUSES">DB: Method uses the same code for two switch clauses (DB_DUPLICATE_SWITCH_CLAUSES)</a></h3>
4694
4695
4696 <p>
4697 This method uses the same code to implement two clauses of a switch statement.
4698 This could be a case of duplicate code, but it might also indicate
4699 a coding mistake.
4700 </p>
4701
4702
4703 <h3><a name="DLS_DEAD_LOCAL_STORE">DLS: Dead store to local variable (DLS_DEAD_LOCAL_STORE)</a></h3>
4704
4705
4706 <p>
4707 This instruction assigns a value to a local variable,
4708 but the value is not read or used in any subsequent instruction.
4709 Often, this indicates an error, because the value computed is never
4710 used.
4711 </p>
4712 <p>
4713 Note that Sun's javac compiler often generates dead stores for
4714 final local variables. Because FindBugs is a bytecode-based tool,
4715 there is no easy way to eliminate these false positives.
4716 </p>
4717
4718
4719 <h3><a name="DLS_DEAD_LOCAL_STORE_IN_RETURN">DLS: Useless assignment in return statement (DLS_DEAD_LOCAL_STORE_IN_RETURN)</a></h3>
4720
4721
4722 <p>
4723 This statement assigns to a local variable in a return statement. This assignment
4724 has effect. Please verify that this statement does the right thing.
4725 </p>
4726
4727
4728 <h3><a name="DLS_DEAD_LOCAL_STORE_OF_NULL">DLS: Dead store of null to local variable (DLS_DEAD_LOCAL_STORE_OF_NULL)</a></h3>
4729
4730
4731 <p>The code stores null into a local variable, and the stored value is not
4732 read. This store may have been introduced to assist the garbage collector, but
4733 as of Java SE 6.0, this is no longer needed or useful.
4734 </p>
4735
4736
4737 <h3><a name="DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS: Dead store to local variable that shadows field (DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD)</a></h3>
4738
4739
4740 <p>
4741 This instruction assigns a value to a local variable,
4742 but the value is not read or used in any subsequent instruction.
4743 Often, this indicates an error, because the value computed is never
4744 used. There is a field with the same name as the local variable. Did you
4745 mean to assign to that variable instead?
4746 </p>
4747
4748
4749 <h3><a name="DMI_HARDCODED_ABSOLUTE_FILENAME">DMI: Code contains a hard coded reference to an absolute pathname (DMI_HARDCODED_ABSOLUTE_FILENAME)</a></h3>
4750
4751
4752 <p>This code constructs a File object using a hard coded to an absolute pathname
4753 (e.g., <code>new File("/home/dannyc/workspace/j2ee/src/share/com/sun/enterprise/deployment");</code>
4754 </p>
4755
4756
4757 <h3><a name="DMI_NONSERIALIZABLE_OBJECT_WRITTEN">DMI: Non serializable object written to ObjectOutput (DMI_NONSERIALIZABLE_OBJECT_WRITTEN)</a></h3>
4758
4759
4760 <p>
4761 This code seems to be passing a non-serializable object to the ObjectOutput.writeObject method.
4762 If the object is, indeed, non-serializable, an error will result.
4763 </p>
4764
4765
4766 <h3><a name="DMI_USELESS_SUBSTRING">DMI: Invocation of substring(0), which returns the original value (DMI_USELESS_SUBSTRING)</a></h3>
4767
4768
4769 <p>
4770 This code invokes substring(0) on a String, which returns the original value.
4771 </p>
4772
4773
4774 <h3><a name="DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">Dm: Thread passed where Runnable expected (DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED)</a></h3>
4775
4776
4777 <p> A Thread object is passed as a parameter to a method where
4778 a Runnable is expected. This is rather unusual, and may indicate a logic error
4779 or cause unexpected behavior.
4780 </p>
4781
4782
4783 <h3><a name="DMI_UNSUPPORTED_METHOD">Dm: Call to unsupported method (DMI_UNSUPPORTED_METHOD)</a></h3>
4784
4785
4786 <p>All targets of this method invocation throw an UnsupportedOperationException.
4787 </p>
4788
4789
4790
4791 <h3><a name="EQ_DOESNT_OVERRIDE_EQUALS">Eq: Class doesn't override equals in superclass (EQ_DOESNT_OVERRIDE_EQUALS)</a></h3>
4792
4793
4794 <p> This class extends a class that defines an equals method and adds fields, but doesn't
4795 define an equals method itself. Thus, equality on instances of this class will
4796 ignore the identity of the subclass and the added fields. Be sure this is what is intended,
4797 and that you don't need to override the equals method. Even if you don't need to override
4798 the equals method, consider overriding it anyway to document the fact
4799 that the equals method for the subclass just return the result of
4800 invoking super.equals(o).
4801 </p>
4802
4803
4804 <h3><a name="EQ_UNUSUAL">Eq: Unusual equals method (EQ_UNUSUAL)</a></h3>
4805
4806
4807 <p> This class doesn't do any of the patterns we recognize for checking that the type of the argument
4808 is compatible with the type of the <code>this</code> object. There might not be anything wrong with
4809 this code, but it is worth reviewing.
4810 </p>
4811
4812
4813 <h3><a name="FE_FLOATING_POINT_EQUALITY">FE: Test for floating point equality (FE_FLOATING_POINT_EQUALITY)</a></h3>
4814
4815
4816 <p>
4817 This operation compares two floating point values for equality.
4818 Because floating point calculations may involve rounding,
4819 calculated float and double values may not be accurate.
4820 For values that must be precise, such as monetary values,
4821 consider using a fixed-precision type such as BigDecimal.
4822 For values that need not be precise, consider comparing for equality
4823 within some range, for example:
4824 <code>if ( Math.abs(x - y) &lt; .0000001 )</code>.
4825 See the Java Language Specification, section 4.2.4.
4826 </p>
4827
4828
4829 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">FS: Non-Boolean argument formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN)</a></h3>
4830
4831
4832 <p>
4833 An argument not of type Boolean is being formatted with a %b format specifier. This won't throw an
4834 exception; instead, it will print true for any nonnull value, and false for null.
4835 This feature of format strings is strange, and may not be what you intended.
4836 </p>
4837
4838
4839 <h3><a name="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">IA: Potentially ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD)</a></h3>
4840
4841
4842 <p>
4843 An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class.
4844 For example, you invoke <code>foo(17)</code>, which is defined in both a superclass and in an outer method.
4845 By the Java semantics,
4846 it will be resolved to invoke the inherited method, but this may not be want
4847 you intend.
4848 </p>
4849 <p>If you really intend to invoke the inherited method,
4850 invoke it by invoking the method on super (e.g., invoke super.foo(17)), and
4851 thus it will be clear to other readers of your code and to FindBugs
4852 that you want to invoke the inherited method, not the method in the outer class.
4853 </p>
4854 <p>If you call <code>this.foo(17)</code>, then the inherited method will be invoked. However, since FindBugs only looks at
4855 classfiles, it
4856 can't tell the difference between an invocation of <code>this.foo(17)</code> and <code>foo(17)</code>, it will still
4857 complain about a potential ambiguous invocation.
4858 </p>
4859
4860
4861 <h3><a name="IC_INIT_CIRCULARITY">IC: Initialization circularity (IC_INIT_CIRCULARITY)</a></h3>
4862
4863
4864 <p> A circularity was detected in the static initializers of the two
4865 classes referenced by the bug instance.&nbsp; Many kinds of unexpected
4866 behavior may arise from such circularity.</p>
4867
4868
4869 <h3><a name="ICAST_IDIV_CAST_TO_DOUBLE">ICAST: Integral division result cast to double or float (ICAST_IDIV_CAST_TO_DOUBLE)</a></h3>
4870
4871
4872 <p>
4873 This code casts the result of an integral division (e.g., int or long division)
4874 operation to double or
4875 float.
4876 Doing division on integers truncates the result
4877 to the integer value closest to zero. The fact that the result
4878 was cast to double suggests that this precision should have been retained.
4879 What was probably meant was to cast one or both of the operands to
4880 double <em>before</em> performing the division. Here is an example:
4881 </p>
4882 <blockquote>
4883 <pre>
4884 int x = 2;
4885 int y = 5;
4886 // Wrong: yields result 0.0
4887 double value1 = x / y;
4888
4889 // Right: yields result 0.4
4890 double value2 = x / (double) y;
4891 </pre>
4892 </blockquote>
4893
4894
4895 <h3><a name="ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">ICAST: Result of integer multiplication cast to long (ICAST_INTEGER_MULTIPLY_CAST_TO_LONG)</a></h3>
4896
4897
4898 <p>
4899 This code performs integer multiply and then converts the result to a long,
4900 as in:</p>
4901 <pre>
4902 long convertDaysToMilliseconds(int days) { return 1000*3600*24*days; }
4903 </pre>
4904 <p>
4905 If the multiplication is done using long arithmetic, you can avoid
4906 the possibility that the result will overflow. For example, you
4907 could fix the above code to:</p>
4908 <pre>
4909 long convertDaysToMilliseconds(int days) { return 1000L*3600*24*days; }
4910 </pre>
4911 or
4912 <pre>
4913 static final long MILLISECONDS_PER_DAY = 24L*3600*1000;
4914 long convertDaysToMilliseconds(int days) { return days * MILLISECONDS_PER_DAY; }
4915 </pre>
4916
4917
4918 <h3><a name="IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">IM: Computation of average could overflow (IM_AVERAGE_COMPUTATION_COULD_OVERFLOW)</a></h3>
4919
4920
4921 <p>The code computes the average of two integers using either division or signed right shift,
4922 and then uses the result as the index of an array.
4923 If the values being averaged are very large, this can overflow (resulting in the computation
4924 of a negative average). Assuming that the result is intended to be nonnegative, you
4925 can use an unsigned right shift instead. In other words, rather that using <code>(low+high)/2</code>,
4926 use <code>(low+high) &gt;&gt;&gt; 1</code>
4927 </p>
4928 <p>This bug exists in many earlier implementations of binary search and merge sort.
4929 Martin Buchholz <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6412541">found and fixed it</a>
4930 in the JDK libraries, and Joshua Bloch
4931 <a href="http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html">widely
4932 publicized the bug pattern</a>.
4933 </p>
4934
4935
4936 <h3><a name="IM_BAD_CHECK_FOR_ODD">IM: Check for oddness that won't work for negative numbers (IM_BAD_CHECK_FOR_ODD)</a></h3>
4937
4938
4939 <p>
4940 The code uses x % 2 == 1 to check to see if a value is odd, but this won't work
4941 for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check
4942 for oddness, consider using x &amp; 1 == 1, or x % 2 != 0.
4943 </p>
4944
4945
4946 <h3><a name="INT_BAD_REM_BY_1">INT: Integer remainder modulo 1 (INT_BAD_REM_BY_1)</a></h3>
4947
4948
4949 <p> Any expression (exp % 1) is guaranteed to always return zero.
4950 Did you mean (exp &amp; 1) or (exp % 2) instead?
4951 </p>
4952
4953
4954 <h3><a name="INT_VACUOUS_BIT_OPERATION">INT: Vacuous bit mask operation on integer value (INT_VACUOUS_BIT_OPERATION)</a></h3>
4955
4956
4957 <p> This is an integer bit operation (and, or, or exclusive or) that doesn't do any useful work
4958 (e.g., <code>v & 0xffffffff</code>).
4959
4960 </p>
4961
4962
4963 <h3><a name="INT_VACUOUS_COMPARISON">INT: Vacuous comparison of integer value (INT_VACUOUS_COMPARISON)</a></h3>
4964
4965
4966 <p> There is an integer comparison that always returns
4967 the same value (e.g., x &lt;= Integer.MAX_VALUE).
4968 </p>
4969
4970
4971 <h3><a name="MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">MTIA: Class extends Servlet class and uses instance variables (MTIA_SUSPECT_SERVLET_INSTANCE_FIELD)</a></h3>
4972
4973
4974 <p>
4975 This class extends from a Servlet class, and uses an instance member variable. Since only
4976 one instance of a Servlet class is created by the J2EE framework, and used in a
4977 multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider
4978 only using method local variables.
4979 </p>
4980
4981
4982 <h3><a name="MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">MTIA: Class extends Struts Action class and uses instance variables (MTIA_SUSPECT_STRUTS_INSTANCE_FIELD)</a></h3>
4983
4984
4985 <p>
4986 This class extends from a Struts Action class, and uses an instance member variable. Since only
4987 one instance of a struts Action class is created by the Struts framework, and used in a
4988 multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider
4989 only using method local variables. Only instance fields that are written outside of a monitor
4990 are reported.
4991 </p>
4992
4993
4994 <h3><a name="NP_DEREFERENCE_OF_READLINE_VALUE">NP: Dereference of the result of readLine() without nullcheck (NP_DEREFERENCE_OF_READLINE_VALUE)</a></h3>
4995
4996
4997 <p> The result of invoking readLine() is dereferenced without checking to see if the result is null. If there are no more lines of text
4998 to read, readLine() will return null and dereferencing that will generate a null pointer exception.
4999 </p>
5000
5001
5002 <h3><a name="NP_IMMEDIATE_DEREFERENCE_OF_READLINE">NP: Immediate dereference of the result of readLine() (NP_IMMEDIATE_DEREFERENCE_OF_READLINE)</a></h3>
5003
5004
5005 <p> The result of invoking readLine() is immediately dereferenced. If there are no more lines of text
5006 to read, readLine() will return null and dereferencing that will generate a null pointer exception.
5007 </p>
5008
5009
5010 <h3><a name="NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value (NP_LOAD_OF_KNOWN_NULL_VALUE)</a></h3>
5011
5012
5013 <p> The variable referenced at this point is known to be null due to an earlier
5014 check against null. Although this is valid, it might be a mistake (perhaps you
5015 intended to refer to a different variable, or perhaps the earlier check to see if the
5016 variable is null should have been a check to see if it was nonnull).
5017 </p>
5018
5019
5020 <h3><a name="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullness annotation on parameter (NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION)</a></h3>
5021
5022 <p>
5023 A method should always implement the contract of a method it overrides. Thus, if a method takes a parameter
5024 that is marked as @Nullable, you shouldn't override that method in a subclass with a method where that parameter is @Nonnull.
5025 Doing so violates the contract that the method should handle a null parameter.
5026 </p>
5027
5028 <h3><a name="NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Method relaxes nullness annotation on return value (NP_METHOD_RETURN_RELAXING_ANNOTATION)</a></h3>
5029
5030 <p>
5031 A method should always implement the contract of a method it overrides. Thus, if a method takes is annotated
5032 as returning a @Nonnull value,
5033 you shouldn't override that method in a subclass with a method annotated as returning a @Nullable or @CheckForNull value.
5034 Doing so violates the contract that the method shouldn't return null.
5035 </p>
5036
5037 <h3><a name="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP: Possible null pointer dereference due to return value of called method (NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE)</a></h3>
5038
5039
5040 <p> The return value from a method is dereferenced without a null check,
5041 and the return value of that method is one that should generally be checked
5042 for null. This may lead to a <code>NullPointerException</code> when the code is executed.
5043 </p>
5044
5045
5046 <h3><a name="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP: Possible null pointer dereference on branch that might be infeasible (NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE)</a></h3>
5047
5048
5049 <p> There is a branch of statement that, <em>if executed,</em> guarantees that
5050 a null value will be dereferenced, which
5051 would generate a <code>NullPointerException</code> when the code is executed.
5052 Of course, the problem might be that the branch or statement is infeasible and that
5053 the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.
5054 Due to the fact that this value had been previously tested for nullness,
5055 this is a definite possibility.
5056 </p>
5057
5058
5059 <h3><a name="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP: Parameter must be nonnull but is marked as nullable (NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE)</a></h3>
5060
5061
5062 <p> This parameter is always used in a way that requires it to be nonnull,
5063 but the parameter is explicitly annotated as being Nullable. Either the use
5064 of the parameter or the annotation is wrong.
5065 </p>
5066
5067
5068 <h3><a name="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP: Read of unwritten public or protected field (NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD)</a></h3>
5069
5070
5071 <p> The program is dereferencing a public or protected
5072 field that does not seem to ever have a non-null value written to it.
5073 Unless the field is initialized via some mechanism not seen by the analysis,
5074 dereferencing this value will generate a null pointer exception.
5075 </p>
5076
5077
5078 <h3><a name="NS_DANGEROUS_NON_SHORT_CIRCUIT">NS: Potentially dangerous use of non-short-circuit logic (NS_DANGEROUS_NON_SHORT_CIRCUIT)</a></h3>
5079
5080
5081 <p> This code seems to be using non-short-circuit logic (e.g., &amp;
5082 or |)
5083 rather than short-circuit logic (&amp;&amp; or ||). In addition,
5084 it seem possible that, depending on the value of the left hand side, you might not
5085 want to evaluate the right hand side (because it would have side effects, could cause an exception
5086 or could be expensive.</p>
5087 <p>
5088 Non-short-circuit logic causes both sides of the expression
5089 to be evaluated even when the result can be inferred from
5090 knowing the left-hand side. This can be less efficient and
5091 can result in errors if the left-hand side guards cases
5092 when evaluating the right-hand side can generate an error.
5093 </p>
5094
5095 <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.22.2">the Java
5096 Language Specification</a> for details
5097
5098 </p>
5099
5100
5101 <h3><a name="NS_NON_SHORT_CIRCUIT">NS: Questionable use of non-short-circuit logic (NS_NON_SHORT_CIRCUIT)</a></h3>
5102
5103
5104 <p> This code seems to be using non-short-circuit logic (e.g., &amp;
5105 or |)
5106 rather than short-circuit logic (&amp;&amp; or ||).
5107 Non-short-circuit logic causes both sides of the expression
5108 to be evaluated even when the result can be inferred from
5109 knowing the left-hand side. This can be less efficient and
5110 can result in errors if the left-hand side guards cases
5111 when evaluating the right-hand side can generate an error.
5112
5113 <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.22.2">the Java
5114 Language Specification</a> for details
5115
5116 </p>
5117
5118
5119 <h3><a name="PS_PUBLIC_SEMAPHORES">PS: Class exposes synchronization and semaphores in its public interface (PS_PUBLIC_SEMAPHORES)</a></h3>
5120
5121
5122 <p>
5123 This class uses synchronization along with wait(), notify() or notifyAll() on itself (the this
5124 reference). Client classes that use this class, may, in addition, use an instance of this class
5125 as a synchronizing object. Because two classes are using the same object for synchronization,
5126 Multithread correctness is suspect. You should not synchronize nor call semaphore methods on
5127 a public reference. Consider using a internal private member variable to control synchronization.
5128 </p>
5129
5130
5131 <h3><a name="PZLA_PREFER_ZERO_LENGTH_ARRAYS">PZLA: Consider returning a zero length array rather than null (PZLA_PREFER_ZERO_LENGTH_ARRAYS)</a></h3>
5132
5133
5134 <p> It is often a better design to
5135 return a length zero array rather than a null reference to indicate that there
5136 are no results (i.e., an empty list of results).
5137 This way, no explicit check for null is needed by clients of the method.</p>
5138
5139 <p>On the other hand, using null to indicate
5140 "there is no answer to this question" is probably appropriate.
5141 For example, <code>File.listFiles()</code> returns an empty list
5142 if given a directory containing no files, and returns null if the file
5143 is not a directory.</p>
5144
5145
5146 <h3><a name="QF_QUESTIONABLE_FOR_LOOP">QF: Complicated, subtle or wrong increment in for-loop (QF_QUESTIONABLE_FOR_LOOP)</a></h3>
5147
5148
5149 <p>Are you sure this for loop is incrementing the correct variable?
5150 It appears that another variable is being initialized and checked
5151 by the for loop.
5152 </p>
5153
5154
5155 <h3><a name="RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE">RCN: Redundant comparison of non-null value to null (RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE)</a></h3>
5156
5157
5158 <p> This method contains a reference known to be non-null with another reference
5159 known to be null.</p>
5160
5161
5162 <h3><a name="RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">RCN: Redundant comparison of two null values (RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES)</a></h3>
5163
5164
5165 <p> This method contains a redundant comparison of two references known to
5166 both be definitely null.</p>
5167
5168
5169 <h3><a name="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">RCN: Redundant nullcheck of value known to be non-null (RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE)</a></h3>
5170
5171
5172 <p> This method contains a redundant check of a known non-null value against
5173 the constant null.</p>
5174
5175
5176 <h3><a name="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN: Redundant nullcheck of value known to be null (RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE)</a></h3>
5177
5178
5179 <p> This method contains a redundant check of a known null value against
5180 the constant null.</p>
5181
5182
5183 <h3><a name="REC_CATCH_EXCEPTION">REC: Exception is caught when Exception is not thrown (REC_CATCH_EXCEPTION)</a></h3>
5184
5185
5186 <p>
5187 This method uses a try-catch block that catches Exception objects, but Exception is not
5188 thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to
5189 say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception
5190 each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well,
5191 masking potential bugs.
5192 </p>
5193 <p>A better approach is to either explicitly catch the specific exceptions that are thrown,
5194 or to explicitly catch RuntimeException exception, rethrow it, and then catch all non-Runtime Exceptions, as shown below:</p>
5195 <pre>
5196 try {
5197 ...
5198 } catch (RuntimeException e) {
5199 throw e;
5200 } catch (Exception e) {
5201 ... deal with all non-runtime exceptions ...
5202 }</pre>
5203
5204
5205 <h3><a name="RI_REDUNDANT_INTERFACES">RI: Class implements same interface as superclass (RI_REDUNDANT_INTERFACES)</a></h3>
5206
5207
5208 <p>
5209 This class declares that it implements an interface that is also implemented by a superclass.
5210 This is redundant because once a superclass implements an interface, all subclasses by default also
5211 implement this interface. It may point out that the inheritance hierarchy has changed since
5212 this class was created, and consideration should be given to the ownership of
5213 the interface's implementation.
5214 </p>
5215
5216
5217 <h3><a name="RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method checks to see if result of String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF)</a></h3>
5218
5219
5220 <p> The method invokes String.indexOf and checks to see if the result is positive or non-positive.
5221 It is much more typical to check to see if the result is negative or non-negative. It is
5222 positive only if the substring checked for occurs at some place other than at the beginning of
5223 the String.</p>
5224
5225
5226 <h3><a name="RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method discards result of readLine after checking if it is nonnull (RV_DONT_JUST_NULL_CHECK_READLINE)</a></h3>
5227
5228
5229 <p> The value returned by readLine is discarded after checking to see if the return
5230 value is non-null. In almost all situations, if the result is non-null, you will want
5231 to use that non-null value. Calling readLine again will give you a different line.</p>
5232
5233
5234 <h3><a name="RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative (RV_REM_OF_HASHCODE)</a></h3>
5235
5236
5237 <p> This code computes a hashCode, and then computes
5238 the remainder of that value modulo another value. Since the hashCode
5239 can be negative, the result of the remainder operation
5240 can also be negative. </p>
5241 <p> Assuming you want to ensure that the result of your computation is nonnegative,
5242 you may need to change your code.
5243 If you know the divisor is a power of 2,
5244 you can use a bitwise and operator instead (i.e., instead of
5245 using <code>x.hashCode()%n</code>, use <code>x.hashCode()&amp;(n-1)</code>.
5246 This is probably faster than computing the remainder as well.
5247 If you don't know that the divisor is a power of 2, take the absolute
5248 value of the result of the remainder operation (i.e., use
5249 <code>Math.abs(x.hashCode()%n)</code>
5250 </p>
5251
5252
5253 <h3><a name="RV_REM_OF_RANDOM_INT">RV: Remainder of 32-bit signed random integer (RV_REM_OF_RANDOM_INT)</a></h3>
5254
5255
5256 <p> This code generates a random signed integer and then computes
5257 the remainder of that value modulo another value. Since the random
5258 number can be negative, the result of the remainder operation
5259 can also be negative. Be sure this is intended, and strongly
5260 consider using the Random.nextInt(int) method instead.
5261 </p>
5262
5263
5264 <h3><a name="RV_RETURN_VALUE_IGNORED_INFERRED">RV: Method ignores return value, is this OK? (RV_RETURN_VALUE_IGNORED_INFERRED)</a></h3>
5265
5266
5267 <p>This code calls a method and ignores the return value. The return value
5268 is the same type as the type the method is invoked on, and from our analysis it looks
5269 like the return value might be important (e.g., like ignoring the
5270 return value of <code>String.toLowerCase()</code>).
5271 </p>
5272 <p>We are guessing that ignoring the return value might be a bad idea just from
5273 a simple analysis of the body of the method. You can use a @CheckReturnValue annotation
5274 to instruct FindBugs as to whether ignoring the return value of this method
5275 is important or acceptable.
5276 </p>
5277 <p>Please investigate this closely to decide whether it is OK to ignore the return value.
5278 </p>
5279
5280
5281 <h3><a name="SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field (SA_FIELD_DOUBLE_ASSIGNMENT)</a></h3>
5282
5283
5284 <p> This method contains a double assignment of a field; e.g.
5285 </p>
5286 <pre>
5287 int x,y;
5288 public void foo() {
5289 x = x = 17;
5290 }
5291 </pre>
5292 <p>Assigning to a field twice is useless, and may indicate a logic error or typo.</p>
5293
5294
5295 <h3><a name="SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assignment of local variable (SA_LOCAL_DOUBLE_ASSIGNMENT)</a></h3>
5296
5297
5298 <p> This method contains a double assignment of a local variable; e.g.
5299 </p>
5300 <pre>
5301 public void foo() {
5302 int x,y;
5303 x = x = 17;
5304 }
5305 </pre>
5306 <p>Assigning the same value to a variable twice is useless, and may indicate a logic error or typo.</p>
5307
5308
5309 <h3><a name="SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignment of local variable (SA_LOCAL_SELF_ASSIGNMENT)</a></h3>
5310
5311
5312 <p> This method contains a self assignment of a local variable; e.g.</p>
5313 <pre>
5314 public void foo() {
5315 int x = 3;
5316 x = x;
5317 }
5318 </pre>
5319 <p>
5320 Such assignments are useless, and may indicate a logic error or typo.
5321 </p>
5322
5323
5324 <h3><a name="SF_SWITCH_FALLTHROUGH">SF: Switch statement found where one case falls through to the next case (SF_SWITCH_FALLTHROUGH)</a></h3>
5325
5326
5327 <p> This method contains a switch statement where one case branch will fall through to the next case.
5328 Usually you need to end this case with a break or return.</p>
5329
5330
5331 <h3><a name="SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case is missing (SF_SWITCH_NO_DEFAULT)</a></h3>
5332
5333
5334 <p> This method contains a switch statement where default case is missing.
5335 Usually you need to provide a default case.</p>
5336 <p>Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if
5337 the default case is at the end of the switch statement and doesn't end with a break statement.
5338
5339
5340 <h3><a name="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST: Write to static field from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD)</a></h3>
5341
5342
5343 <p> This instance method writes to a static field. This is tricky to get
5344 correct if multiple instances are being manipulated,
5345 and generally bad practice.
5346 </p>
5347
5348
5349 <h3><a name="SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">Se: Private readResolve method not inherited by subclasses (SE_PRIVATE_READ_RESOLVE_NOT_INHERITED)</a></h3>
5350
5351
5352 <p> This class defines a private readResolve method. Since it is private, it won't be inherited by subclasses.
5353 This might be intentional and OK, but should be reviewed to ensure it is what is intended.
5354 </p>
5355
5356
5357 <h3><a name="SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS">Se: Transient field of class that isn't Serializable. (SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS)</a></h3>
5358
5359
5360 <p> The field is marked as transient, but the class isn't Serializable, so marking it as transient
5361 has absolutely no effect.
5362 This may be leftover marking from a previous version of the code in which the class was transient, or
5363 it may indicate a misunderstanding of how serialization works.
5364 </p>
5365
5366
5367 <h3><a name="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK">TQ: Value required to have type qualifier, but marked as unknown (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK)</a></h3>
5368
5369
5370 <p>
5371 A value is used in a way that requires it to be always be a value denoted by a type qualifier, but
5372 there is an explicit annotation stating that it is not known where the value is required to have that type qualifier.
5373 Either the usage or the annotation is incorrect.
5374 </p>
5375
5376
5377 <h3><a name="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value required to not have type qualifier, but marked as unknown (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK)</a></h3>
5378
5379
5380 <p>
5381 A value is used in a way that requires it to be never be a value denoted by a type qualifier, but
5382 there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier.
5383 Either the usage or the annotation is incorrect.
5384 </p>
5385
5386
5387 <h3><a name="UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow (UCF_USELESS_CONTROL_FLOW)</a></h3>
5388
5389
5390 <p> This method contains a useless control flow statement, where
5391 control flow continues onto the same place regardless of whether or not
5392 the branch is taken. For example,
5393 this is caused by having an empty statement
5394 block for an <code>if</code> statement:</p>
5395 <pre>
5396 if (argv.length == 0) {
5397 // TODO: handle this case
5398 }
5399 </pre>
5400
5401
5402 <h3><a name="UCF_USELESS_CONTROL_FLOW_NEXT_LINE">UCF: Useless control flow to next line (UCF_USELESS_CONTROL_FLOW_NEXT_LINE)</a></h3>
5403
5404
5405 <p> This method contains a useless control flow statement in which control
5406 flow follows to the same or following line regardless of whether or not
5407 the branch is taken.
5408 Often, this is caused by inadvertently using an empty statement as the
5409 body of an <code>if</code> statement, e.g.:</p>
5410 <pre>
5411 if (argv.length == 1);
5412 System.out.println("Hello, " + argv[0]);
5413 </pre>
5414
5415
5416 <h3><a name="USM_USELESS_ABSTRACT_METHOD">USM: Abstract Method is already defined in implemented interface (USM_USELESS_ABSTRACT_METHOD)</a></h3>
5417
5418
5419 <p>
5420 This abstract method is already defined in an interface that is implemented by this abstract
5421 class. This method can be removed, as it provides no additional value.
5422 </p>
5423
5424
5425 <h3><a name="USM_USELESS_SUBCLASS_METHOD">USM: Method superfluously delegates to parent class method (USM_USELESS_SUBCLASS_METHOD)</a></h3>
5426
5427
5428 <p>
5429 This derived method merely calls the same superclass method passing in the exact parameters
5430 received. This method can be removed, as it provides no additional value.
5431 </p>
5432
5433
5434 <h3><a name="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">UrF: Unread public/protected field (URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)</a></h3>
5435
5436
5437 <p> This field is never read.&nbsp;
5438 The field is public or protected, so perhaps
5439 it is intended to be used with classes not seen as part of the analysis. If not,
5440 consider removing it from the class.</p>
5441
5442
5443 <h3><a name="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UuF: Unused public or protected field (UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD)</a></h3>
5444
5445
5446 <p> This field is never used.&nbsp;
5447 The field is public or protected, so perhaps
5448 it is intended to be used with classes not seen as part of the analysis. If not,
5449 consider removing it from the class.</p>
5450
5451
5452 <h3><a name="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">UwF: Field not initialized in constructor but dereferenced without null check (UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR)</a></h3>
5453
5454
5455 <p> This field is never initialized within any constructor, and is therefore could be null after
5456 the object is constructed. Elsewhere, it is loaded and dereferenced without a null check.
5457 This could be a either an error or a questionable design, since
5458 it means a null pointer exception will be generated if that field is dereferenced
5459 before being initialized.
5460 </p>
5461
5462
5463 <h3><a name="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UwF: Unwritten public or protected field (UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD)</a></h3>
5464
5465
5466 <p> No writes were seen to this public/protected field.&nbsp; All reads of it will return the default
5467 value. Check for errors (should it have been initialized?), or remove it if it is useless.</p>
5468
5469
5470 <h3><a name="XFB_XML_FACTORY_BYPASS">XFB: Method directly allocates a specific implementation of xml interfaces (XFB_XML_FACTORY_BYPASS)</a></h3>
5471
5472
5473 <p>
5474 This method allocates a specific implementation of an xml interface. It is preferable to use
5475 the supplied factory classes to create these objects so that the implementation can be
5476 changed at runtime. See
5477 </p>
5478 <ul>
5479 <li>javax.xml.parsers.DocumentBuilderFactory</li>
5480 <li>javax.xml.parsers.SAXParserFactory</li>
5481 <li>javax.xml.transform.TransformerFactory</li>
5482 <li>org.w3c.dom.Document.create<i>XXXX</i></li>
5483 </ul>
5484 <p>for details.</p>
5485
5486
5487
5488
5489 <hr> <p>
5490 <script language="JavaScript" type="text/javascript">
5491 <!---//hide script from old browsers
5492 document.write( "Last updated "+ document.lastModified + "." );
5493 //end hiding contents --->
5494 </script>
5495 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
5496 <p>
5497 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
5498 </td></tr></table>
5499 </body></html>
doc/bug-logo.png less more
Binary diff not shown
+0
-5325
doc/bugDescriptions.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1 <html><head><title>FindBugs Bug Descriptions</title>
2 <link rel="stylesheet" type="text/css" href="findbugs.css"/>
3 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
4 </head><body>
5
6 <table width="100%"><tr>
7
8 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
9 <table width="100%" cellspacing="0" border="0">
10 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
11
12 <tr><td>&nbsp;</td></tr>
13
14 <tr><td><b>Docs and Info</b></td></tr>
15 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
16 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
17 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
27
28 <tr><td>&nbsp;</td></tr>
29
30 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
31
32 <tr><td>&nbsp;</td></tr>
33
34 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
35
36 <tr><td>&nbsp;</td></tr>
37
38 <tr><td><b>Development</b></td></tr>
39 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
40 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
41 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
48 </table>
49 </td>
50 <td align="left" valign="top">
51 <h1>FindBugs Bug Descriptions</h1>
52 <p>This document lists the standard bug patterns reported by
53 <a href="http://findbugs.sourceforge.net">FindBugs</a> version 2.0.3.</p>
54 <h2>Summary</h2>
55 <table width="100%">
56 <tr bgcolor="#b9b9fe"><th>Description</th><th>Category</th></tr>
57 <tr bgcolor="#eeeeee"><td><a href="#BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS">BC: Equals method should not assume anything about the type of its argument</a></td><td>Bad practice</td></tr>
58 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK">BIT: Check for sign of bitwise operation</a></td><td>Bad practice</td></tr>
59 <tr bgcolor="#eeeeee"><td><a href="#CN_IDIOM">CN: Class implements Cloneable but does not define or use clone method</a></td><td>Bad practice</td></tr>
60 <tr bgcolor="#ffffff"><td><a href="#CN_IDIOM_NO_SUPER_CALL">CN: clone method does not call super.clone()</a></td><td>Bad practice</td></tr>
61 <tr bgcolor="#eeeeee"><td><a href="#CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: Class defines clone() but doesn't implement Cloneable</a></td><td>Bad practice</td></tr>
62 <tr bgcolor="#ffffff"><td><a href="#CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo() method</a></td><td>Bad practice</td></tr>
63 <tr bgcolor="#eeeeee"><td><a href="#CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined</a></td><td>Bad practice</td></tr>
64 <tr bgcolor="#ffffff"><td><a href="#DE_MIGHT_DROP">DE: Method might drop exception</a></td><td>Bad practice</td></tr>
65 <tr bgcolor="#eeeeee"><td><a href="#DE_MIGHT_IGNORE">DE: Method might ignore exception</a></td><td>Bad practice</td></tr>
66 <tr bgcolor="#ffffff"><td><a href="#DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI: Adding elements of an entry set may fail due to reuse of Entry objects</a></td><td>Bad practice</td></tr>
67 <tr bgcolor="#eeeeee"><td><a href="#DMI_RANDOM_USED_ONLY_ONCE">DMI: Random object created and used only once</a></td><td>Bad practice</td></tr>
68 <tr bgcolor="#ffffff"><td><a href="#DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">DMI: Don't use removeAll to clear a collection</a></td><td>Bad practice</td></tr>
69 <tr bgcolor="#eeeeee"><td><a href="#DM_EXIT">Dm: Method invokes System.exit(...)</a></td><td>Bad practice</td></tr>
70 <tr bgcolor="#ffffff"><td><a href="#DM_RUN_FINALIZERS_ON_EXIT">Dm: Method invokes dangerous method runFinalizersOnExit</a></td><td>Bad practice</td></tr>
71 <tr bgcolor="#eeeeee"><td><a href="#ES_COMPARING_PARAMETER_STRING_WITH_EQ">ES: Comparison of String parameter using == or !=</a></td><td>Bad practice</td></tr>
72 <tr bgcolor="#ffffff"><td><a href="#ES_COMPARING_STRINGS_WITH_EQ">ES: Comparison of String objects using == or !=</a></td><td>Bad practice</td></tr>
73 <tr bgcolor="#eeeeee"><td><a href="#EQ_ABSTRACT_SELF">Eq: Abstract class defines covariant equals() method</a></td><td>Bad practice</td></tr>
74 <tr bgcolor="#ffffff"><td><a href="#EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS">Eq: Equals checks for incompatible operand</a></td><td>Bad practice</td></tr>
75 <tr bgcolor="#eeeeee"><td><a href="#EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) and uses Object.equals()</a></td><td>Bad practice</td></tr>
76 <tr bgcolor="#ffffff"><td><a href="#EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtypes</a></td><td>Bad practice</td></tr>
77 <tr bgcolor="#eeeeee"><td><a href="#EQ_SELF_NO_OBJECT">Eq: Covariant equals() method defined</a></td><td>Bad practice</td></tr>
78 <tr bgcolor="#ffffff"><td><a href="#FI_EMPTY">FI: Empty finalizer should be deleted</a></td><td>Bad practice</td></tr>
79 <tr bgcolor="#eeeeee"><td><a href="#FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer</a></td><td>Bad practice</td></tr>
80 <tr bgcolor="#ffffff"><td><a href="#FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields</a></td><td>Bad practice</td></tr>
81 <tr bgcolor="#eeeeee"><td><a href="#FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields</a></td><td>Bad practice</td></tr>
82 <tr bgcolor="#ffffff"><td><a href="#FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass finalizer</a></td><td>Bad practice</td></tr>
83 <tr bgcolor="#eeeeee"><td><a href="#FI_NULLIFY_SUPER">FI: Finalizer nullifies superclass finalizer</a></td><td>Bad practice</td></tr>
84 <tr bgcolor="#ffffff"><td><a href="#FI_USELESS">FI: Finalizer does nothing but call superclass finalizer</a></td><td>Bad practice</td></tr>
85 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_USES_NEWLINE">FS: Format string should use %n rather than \n</a></td><td>Bad practice</td></tr>
86 <tr bgcolor="#ffffff"><td><a href="#GC_UNCHECKED_TYPE_IN_GENERIC_CALL">GC: Unchecked type in generic call</a></td><td>Bad practice</td></tr>
87 <tr bgcolor="#eeeeee"><td><a href="#HE_EQUALS_NO_HASHCODE">HE: Class defines equals() but not hashCode()</a></td><td>Bad practice</td></tr>
88 <tr bgcolor="#ffffff"><td><a href="#HE_EQUALS_USE_HASHCODE">HE: Class defines equals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr>
89 <tr bgcolor="#eeeeee"><td><a href="#HE_HASHCODE_NO_EQUALS">HE: Class defines hashCode() but not equals()</a></td><td>Bad practice</td></tr>
90 <tr bgcolor="#ffffff"><td><a href="#HE_HASHCODE_USE_OBJECT_EQUALS">HE: Class defines hashCode() and uses Object.equals()</a></td><td>Bad practice</td></tr>
91 <tr bgcolor="#eeeeee"><td><a href="#HE_INHERITS_EQUALS_USE_HASHCODE">HE: Class inherits equals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr>
92 <tr bgcolor="#ffffff"><td><a href="#IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION">IC: Superclass uses subclass during initialization</a></td><td>Bad practice</td></tr>
93 <tr bgcolor="#eeeeee"><td><a href="#IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching of IllegalMonitorStateException</a></td><td>Bad practice</td></tr>
94 <tr bgcolor="#ffffff"><td><a href="#ISC_INSTANTIATE_STATIC_CLASS">ISC: Needless instantiation of class that only supplies static methods</a></td><td>Bad practice</td></tr>
95 <tr bgcolor="#eeeeee"><td><a href="#IT_NO_SUCH_ELEMENT">It: Iterator next() method can't throw NoSuchElementException</a></td><td>Bad practice</td></tr>
96 <tr bgcolor="#ffffff"><td><a href="#J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION">J2EE: Store of non serializable object into HttpSession</a></td><td>Bad practice</td></tr>
97 <tr bgcolor="#eeeeee"><td><a href="#JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP: Fields of immutable classes should be final</a></td><td>Bad practice</td></tr>
98 <tr bgcolor="#ffffff"><td><a href="#NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns explicit null</a></td><td>Bad practice</td></tr>
99 <tr bgcolor="#eeeeee"><td><a href="#NP_CLONE_COULD_RETURN_NULL">NP: Clone method may return null</a></td><td>Bad practice</td></tr>
100 <tr bgcolor="#ffffff"><td><a href="#NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT">NP: equals() method does not check for null argument</a></td><td>Bad practice</td></tr>
101 <tr bgcolor="#eeeeee"><td><a href="#NP_TOSTRING_COULD_RETURN_NULL">NP: toString method may return null</a></td><td>Bad practice</td></tr>
102 <tr bgcolor="#ffffff"><td><a href="#NM_CLASS_NAMING_CONVENTION">Nm: Class names should start with an upper case letter</a></td><td>Bad practice</td></tr>
103 <tr bgcolor="#eeeeee"><td><a href="#NM_CLASS_NOT_EXCEPTION">Nm: Class is not derived from an Exception, even though it is named as such</a></td><td>Bad practice</td></tr>
104 <tr bgcolor="#ffffff"><td><a href="#NM_CONFUSING">Nm: Confusing method names</a></td><td>Bad practice</td></tr>
105 <tr bgcolor="#eeeeee"><td><a href="#NM_FIELD_NAMING_CONVENTION">Nm: Field names should start with a lower case letter</a></td><td>Bad practice</td></tr>
106 <tr bgcolor="#ffffff"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER">Nm: Use of identifier that is a keyword in later versions of Java</a></td><td>Bad practice</td></tr>
107 <tr bgcolor="#eeeeee"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER">Nm: Use of identifier that is a keyword in later versions of Java</a></td><td>Bad practice</td></tr>
108 <tr bgcolor="#ffffff"><td><a href="#NM_METHOD_NAMING_CONVENTION">Nm: Method names should start with a lower case letter</a></td><td>Bad practice</td></tr>
109 <tr bgcolor="#eeeeee"><td><a href="#NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class names shouldn't shadow simple name of implemented interface</a></td><td>Bad practice</td></tr>
110 <tr bgcolor="#ffffff"><td><a href="#NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class names shouldn't shadow simple name of superclass</a></td><td>Bad practice</td></tr>
111 <tr bgcolor="#eeeeee"><td><a href="#NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but perhaps intentional)</a></td><td>Bad practice</td></tr>
112 <tr bgcolor="#ffffff"><td><a href="#NM_WRONG_PACKAGE_INTENTIONAL">Nm: Method doesn't override method in superclass due to wrong package for parameter</a></td><td>Bad practice</td></tr>
113 <tr bgcolor="#eeeeee"><td><a href="#ODR_OPEN_DATABASE_RESOURCE">ODR: Method may fail to close database resource</a></td><td>Bad practice</td></tr>
114 <tr bgcolor="#ffffff"><td><a href="#ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH">ODR: Method may fail to close database resource on exception</a></td><td>Bad practice</td></tr>
115 <tr bgcolor="#eeeeee"><td><a href="#OS_OPEN_STREAM">OS: Method may fail to close stream</a></td><td>Bad practice</td></tr>
116 <tr bgcolor="#ffffff"><td><a href="#OS_OPEN_STREAM_EXCEPTION_PATH">OS: Method may fail to close stream on exception</a></td><td>Bad practice</td></tr>
117 <tr bgcolor="#eeeeee"><td><a href="#PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">PZ: Don't reuse entry objects in iterators</a></td><td>Bad practice</td></tr>
118 <tr bgcolor="#ffffff"><td><a href="#RC_REF_COMPARISON_BAD_PRACTICE">RC: Suspicious reference comparison to constant</a></td><td>Bad practice</td></tr>
119 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN">RC: Suspicious reference comparison of Boolean values</a></td><td>Bad practice</td></tr>
120 <tr bgcolor="#ffffff"><td><a href="#RR_NOT_CHECKED">RR: Method ignores results of InputStream.read()</a></td><td>Bad practice</td></tr>
121 <tr bgcolor="#eeeeee"><td><a href="#SR_NOT_CHECKED">RR: Method ignores results of InputStream.skip()</a></td><td>Bad practice</td></tr>
122 <tr bgcolor="#ffffff"><td><a href="#RV_NEGATING_RESULT_OF_COMPARETO">RV: Negating the result of compareTo()/compare()</a></td><td>Bad practice</td></tr>
123 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_BAD_PRACTICE">RV: Method ignores exceptional return value</a></td><td>Bad practice</td></tr>
124 <tr bgcolor="#ffffff"><td><a href="#SI_INSTANCE_BEFORE_FINALS_ASSIGNED">SI: Static initializer creates instance before all static final fields assigned</a></td><td>Bad practice</td></tr>
125 <tr bgcolor="#eeeeee"><td><a href="#SW_SWING_METHODS_INVOKED_IN_SWING_THREAD">SW: Certain swing methods needs to be invoked in Swing thread</a></td><td>Bad practice</td></tr>
126 <tr bgcolor="#ffffff"><td><a href="#SE_BAD_FIELD">Se: Non-transient non-serializable instance field in serializable class</a></td><td>Bad practice</td></tr>
127 <tr bgcolor="#eeeeee"><td><a href="#SE_BAD_FIELD_INNER_CLASS">Se: Non-serializable class has a serializable inner class</a></td><td>Bad practice</td></tr>
128 <tr bgcolor="#ffffff"><td><a href="#SE_BAD_FIELD_STORE">Se: Non-serializable value stored into instance field of a serializable class</a></td><td>Bad practice</td></tr>
129 <tr bgcolor="#eeeeee"><td><a href="#SE_COMPARATOR_SHOULD_BE_SERIALIZABLE">Se: Comparator doesn't implement Serializable</a></td><td>Bad practice</td></tr>
130 <tr bgcolor="#ffffff"><td><a href="#SE_INNER_CLASS">Se: Serializable inner class</a></td><td>Bad practice</td></tr>
131 <tr bgcolor="#eeeeee"><td><a href="#SE_NONFINAL_SERIALVERSIONID">Se: serialVersionUID isn't final</a></td><td>Bad practice</td></tr>
132 <tr bgcolor="#ffffff"><td><a href="#SE_NONLONG_SERIALVERSIONID">Se: serialVersionUID isn't long</a></td><td>Bad practice</td></tr>
133 <tr bgcolor="#eeeeee"><td><a href="#SE_NONSTATIC_SERIALVERSIONID">Se: serialVersionUID isn't static</a></td><td>Bad practice</td></tr>
134 <tr bgcolor="#ffffff"><td><a href="#SE_NO_SUITABLE_CONSTRUCTOR">Se: Class is Serializable but its superclass doesn't define a void constructor</a></td><td>Bad practice</td></tr>
135 <tr bgcolor="#eeeeee"><td><a href="#SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION">Se: Class is Externalizable but doesn't define a void constructor</a></td><td>Bad practice</td></tr>
136 <tr bgcolor="#ffffff"><td><a href="#SE_READ_RESOLVE_MUST_RETURN_OBJECT">Se: The readResolve method must be declared with a return type of Object. </a></td><td>Bad practice</td></tr>
137 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_NOT_RESTORED">Se: Transient field that isn't set by deserialization. </a></td><td>Bad practice</td></tr>
138 <tr bgcolor="#ffffff"><td><a href="#SE_NO_SERIALVERSIONID">SnVI: Class is Serializable, but doesn't define serialVersionUID</a></td><td>Bad practice</td></tr>
139 <tr bgcolor="#eeeeee"><td><a href="#UI_INHERITANCE_UNSAFE_GETRESOURCE">UI: Usage of GetResource may be unsafe if class is extended</a></td><td>Bad practice</td></tr>
140 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_CAST">BC: Impossible cast</a></td><td>Correctness</td></tr>
141 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downcast</a></td><td>Correctness</td></tr>
142 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impossible downcast of toArray() result</a></td><td>Correctness</td></tr>
143 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof will always return false</a></td><td>Correctness</td></tr>
144 <tr bgcolor="#ffffff"><td><a href="#BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of signed byte value</a></td><td>Correctness</td></tr>
145 <tr bgcolor="#eeeeee"><td><a href="#BIT_AND">BIT: Incompatible bit masks</a></td><td>Correctness</td></tr>
146 <tr bgcolor="#ffffff"><td><a href="#BIT_AND_ZZ">BIT: Check to see if ((...) & 0) == 0</a></td><td>Correctness</td></tr>
147 <tr bgcolor="#eeeeee"><td><a href="#BIT_IOR">BIT: Incompatible bit masks</a></td><td>Correctness</td></tr>
148 <tr bgcolor="#ffffff"><td><a href="#BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of signed byte value</a></td><td>Correctness</td></tr>
149 <tr bgcolor="#eeeeee"><td><a href="#BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for sign of bitwise operation</a></td><td>Correctness</td></tr>
150 <tr bgcolor="#ffffff"><td><a href="#BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class overrides a method implemented in super class Adapter wrongly</a></td><td>Correctness</td></tr>
151 <tr bgcolor="#eeeeee"><td><a href="#ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int shifted by an amount not in the range -31..31</a></td><td>Correctness</td></tr>
152 <tr bgcolor="#ffffff"><td><a href="#BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">Bx: Primitive value is unboxed and coerced for ternary operator</a></td><td>Correctness</td></tr>
153 <tr bgcolor="#eeeeee"><td><a href="#CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns Integer.MIN_VALUE</a></td><td>Correctness</td></tr>
154 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in return statement</a></td><td>Correctness</td></tr>
155 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead store of class literal</a></td><td>Correctness</td></tr>
156 <tr bgcolor="#ffffff"><td><a href="#DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten increment</a></td><td>Correctness</td></tr>
157 <tr bgcolor="#eeeeee"><td><a href="#DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed method arguments</a></td><td>Correctness</td></tr>
158 <tr bgcolor="#ffffff"><td><a href="#DMI_BAD_MONTH">DMI: Bad constant value for month</a></td><td>Correctness</td></tr>
159 <tr bgcolor="#eeeeee"><td><a href="#DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI: BigDecimal constructed from double that isn't represented precisely</a></td><td>Correctness</td></tr>
160 <tr bgcolor="#ffffff"><td><a href="#DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext method invokes next</a></td><td>Correctness</td></tr>
161 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES">DMI: Collections should not contain themselves</a></td><td>Correctness</td></tr>
162 <tr bgcolor="#ffffff"><td><a href="#DMI_DOH">DMI: D'oh! A nonsensical method invocation</a></td><td>Correctness</td></tr>
163 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_HASHCODE_ON_ARRAY">DMI: Invocation of hashCode on an array</a></td><td>Correctness</td></tr>
164 <tr bgcolor="#ffffff"><td><a href="#DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">DMI: Double.longBitsToDouble invoked on an int</a></td><td>Correctness</td></tr>
165 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuous call to collections</a></td><td>Correctness</td></tr>
166 <tr bgcolor="#ffffff"><td><a href="#DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION">Dm: Can't use reflection to check for presence of annotation without runtime retention</a></td><td>Correctness</td></tr>
167 <tr bgcolor="#eeeeee"><td><a href="#DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR">Dm: Futile attempt to change max pool size of ScheduledThreadPoolExecutor</a></td><td>Correctness</td></tr>
168 <tr bgcolor="#ffffff"><td><a href="#DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS">Dm: Creation of ScheduledThreadPoolExecutor with zero core threads</a></td><td>Correctness</td></tr>
169 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Useless/vacuous call to EasyMock method</a></td><td>Correctness</td></tr>
170 <tr bgcolor="#ffffff"><td><a href="#EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonarray</a></td><td>Correctness</td></tr>
171 <tr bgcolor="#eeeeee"><td><a href="#EC_BAD_ARRAY_COMPARE">EC: Invocation of equals() on an array, which is equivalent to ==</a></td><td>Correctness</td></tr>
172 <tr bgcolor="#ffffff"><td><a href="#EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(...) used to compare incompatible arrays</a></td><td>Correctness</td></tr>
173 <tr bgcolor="#eeeeee"><td><a href="#EC_NULL_ARG">EC: Call to equals(null)</a></td><td>Correctness</td></tr>
174 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_CLASS_AND_INTERFACE">EC: Call to equals() comparing unrelated class and interface</a></td><td>Correctness</td></tr>
175 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_INTERFACES">EC: Call to equals() comparing different interface types</a></td><td>Correctness</td></tr>
176 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_TYPES">EC: Call to equals() comparing different types</a></td><td>Correctness</td></tr>
177 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">EC: Using pointer equality to compare different types</a></td><td>Correctness</td></tr>
178 <tr bgcolor="#ffffff"><td><a href="#EQ_ALWAYS_FALSE">Eq: equals method always returns false</a></td><td>Correctness</td></tr>
179 <tr bgcolor="#eeeeee"><td><a href="#EQ_ALWAYS_TRUE">Eq: equals method always returns true</a></td><td>Correctness</td></tr>
180 <tr bgcolor="#ffffff"><td><a href="#EQ_COMPARING_CLASS_NAMES">Eq: equals method compares class names rather than class objects</a></td><td>Correctness</td></tr>
181 <tr bgcolor="#eeeeee"><td><a href="#EQ_DONT_DEFINE_EQUALS_FOR_ENUM">Eq: Covariant equals() method defined for enum</a></td><td>Correctness</td></tr>
182 <tr bgcolor="#ffffff"><td><a href="#EQ_OTHER_NO_OBJECT">Eq: equals() method defined that doesn't override equals(Object)</a></td><td>Correctness</td></tr>
183 <tr bgcolor="#eeeeee"><td><a href="#EQ_OTHER_USE_OBJECT">Eq: equals() method defined that doesn't override Object.equals(Object)</a></td><td>Correctness</td></tr>
184 <tr bgcolor="#ffffff"><td><a href="#EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC">Eq: equals method overrides equals in superclass and may not be symmetric</a></td><td>Correctness</td></tr>
185 <tr bgcolor="#eeeeee"><td><a href="#EQ_SELF_USE_OBJECT">Eq: Covariant equals() method defined, Object.equals(Object) inherited</a></td><td>Correctness</td></tr>
186 <tr bgcolor="#ffffff"><td><a href="#FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER">FE: Doomed test for equality to NaN</a></td><td>Correctness</td></tr>
187 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_ARGUMENT">FS: Format string placeholder incompatible with passed argument</a></td><td>Correctness</td></tr>
188 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION">FS: The type of a supplied argument doesn't match format specifier</a></td><td>Correctness</td></tr>
189 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED">FS: MessageFormat supplied where printf style format expected</a></td><td>Correctness</td></tr>
190 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED">FS: More arguments are passed than are actually used in the format string</a></td><td>Correctness</td></tr>
191 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_ILLEGAL">FS: Illegal format string</a></td><td>Correctness</td></tr>
192 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_MISSING_ARGUMENT">FS: Format string references missing argument</a></td><td>Correctness</td></tr>
193 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT">FS: No previous argument for format string</a></td><td>Correctness</td></tr>
194 <tr bgcolor="#ffffff"><td><a href="#GC_UNRELATED_TYPES">GC: No relationship between generic parameter and method argument</a></td><td>Correctness</td></tr>
195 <tr bgcolor="#eeeeee"><td><a href="#HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS">HE: Signature declares use of unhashable class in hashed construct</a></td><td>Correctness</td></tr>
196 <tr bgcolor="#ffffff"><td><a href="#HE_USE_OF_UNHASHABLE_CLASS">HE: Use of class without a hashCode() method in a hashed data structure</a></td><td>Correctness</td></tr>
197 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INT_2_LONG_AS_INSTANT">ICAST: int value converted to long and used as absolute time</a></td><td>Correctness</td></tr>
198 <tr bgcolor="#ffffff"><td><a href="#ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL">ICAST: Integral value cast to double and then passed to Math.ceil</a></td><td>Correctness</td></tr>
199 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND">ICAST: int value cast to float and then passed to Math.round</a></td><td>Correctness</td></tr>
200 <tr bgcolor="#ffffff"><td><a href="#IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD">IJU: JUnit assertion in run method will not be noticed by JUnit</a></td><td>Correctness</td></tr>
201 <tr bgcolor="#eeeeee"><td><a href="#IJU_BAD_SUITE_METHOD">IJU: TestCase declares a bad suite method </a></td><td>Correctness</td></tr>
202 <tr bgcolor="#ffffff"><td><a href="#IJU_NO_TESTS">IJU: TestCase has no tests</a></td><td>Correctness</td></tr>
203 <tr bgcolor="#eeeeee"><td><a href="#IJU_SETUP_NO_SUPER">IJU: TestCase defines setUp that doesn't call super.setUp()</a></td><td>Correctness</td></tr>
204 <tr bgcolor="#ffffff"><td><a href="#IJU_SUITE_NOT_STATIC">IJU: TestCase implements a non-static suite method </a></td><td>Correctness</td></tr>
205 <tr bgcolor="#eeeeee"><td><a href="#IJU_TEARDOWN_NO_SUPER">IJU: TestCase defines tearDown that doesn't call super.tearDown()</a></td><td>Correctness</td></tr>
206 <tr bgcolor="#ffffff"><td><a href="#IL_CONTAINER_ADDED_TO_ITSELF">IL: A collection is added to itself</a></td><td>Correctness</td></tr>
207 <tr bgcolor="#eeeeee"><td><a href="#IL_INFINITE_LOOP">IL: An apparent infinite loop</a></td><td>Correctness</td></tr>
208 <tr bgcolor="#ffffff"><td><a href="#IL_INFINITE_RECURSIVE_LOOP">IL: An apparent infinite recursive loop</a></td><td>Correctness</td></tr>
209 <tr bgcolor="#eeeeee"><td><a href="#IM_MULTIPLYING_RESULT_OF_IREM">IM: Integer multiply of result of integer remainder</a></td><td>Correctness</td></tr>
210 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad comparison of int value with long constant</a></td><td>Correctness</td></tr>
211 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT: Bad comparison of nonnegative value with negative constant</a></td><td>Correctness</td></tr>
212 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed byte</a></td><td>Correctness</td></tr>
213 <tr bgcolor="#eeeeee"><td><a href="#IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">IO: Doomed attempt to append to an object output stream</a></td><td>Correctness</td></tr>
214 <tr bgcolor="#ffffff"><td><a href="#IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">IP: A parameter is dead upon entry to a method but overwritten</a></td><td>Correctness</td></tr>
215 <tr bgcolor="#eeeeee"><td><a href="#MF_CLASS_MASKS_FIELD">MF: Class defines field that masks a superclass field</a></td><td>Correctness</td></tr>
216 <tr bgcolor="#ffffff"><td><a href="#MF_METHOD_MASKS_FIELD">MF: Method defines a variable that obscures a field</a></td><td>Correctness</td></tr>
217 <tr bgcolor="#eeeeee"><td><a href="#NP_ALWAYS_NULL">NP: Null pointer dereference</a></td><td>Correctness</td></tr>
218 <tr bgcolor="#ffffff"><td><a href="#NP_ALWAYS_NULL_EXCEPTION">NP: Null pointer dereference in method on exception path</a></td><td>Correctness</td></tr>
219 <tr bgcolor="#eeeeee"><td><a href="#NP_ARGUMENT_MIGHT_BE_NULL">NP: Method does not check for null argument</a></td><td>Correctness</td></tr>
220 <tr bgcolor="#ffffff"><td><a href="#NP_CLOSING_NULL">NP: close() invoked on a value that is always null</a></td><td>Correctness</td></tr>
221 <tr bgcolor="#eeeeee"><td><a href="#NP_GUARANTEED_DEREF">NP: Null value is guaranteed to be dereferenced</a></td><td>Correctness</td></tr>
222 <tr bgcolor="#ffffff"><td><a href="#NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: Value is null and guaranteed to be dereferenced on exception path</a></td><td>Correctness</td></tr>
223 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP: Nonnull field is not initialized</a></td><td>Correctness</td></tr>
224 <tr bgcolor="#ffffff"><td><a href="#NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a nonnull parameter </a></td><td>Correctness</td></tr>
225 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is declared @NonNull</a></td><td>Correctness</td></tr>
226 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_INSTANCEOF">NP: A known null value is checked to see if it is an instance of a type</a></td><td>Correctness</td></tr>
227 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH">NP: Possible null pointer dereference</a></td><td>Correctness</td></tr>
228 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_EXCEPTION">NP: Possible null pointer dereference in method on exception path</a></td><td>Correctness</td></tr>
229 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF">NP: Method call passes null for nonnull parameter</a></td><td>Correctness</td></tr>
230 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP: Method call passes null for nonnull parameter</a></td><td>Correctness</td></tr>
231 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virtual method call passes null for nonnull parameter</a></td><td>Correctness</td></tr>
232 <tr bgcolor="#ffffff"><td><a href="#NP_STORE_INTO_NONNULL_FIELD">NP: Store of null value into field annotated NonNull</a></td><td>Correctness</td></tr>
233 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_FIELD">NP: Read of unwritten field</a></td><td>Correctness</td></tr>
234 <tr bgcolor="#ffffff"><td><a href="#NM_BAD_EQUAL">Nm: Class defines equal(Object); should it be equals(Object)?</a></td><td>Correctness</td></tr>
235 <tr bgcolor="#eeeeee"><td><a href="#NM_LCASE_HASHCODE">Nm: Class defines hashcode(); should it be hashCode()?</a></td><td>Correctness</td></tr>
236 <tr bgcolor="#ffffff"><td><a href="#NM_LCASE_TOSTRING">Nm: Class defines tostring(); should it be toString()?</a></td><td>Correctness</td></tr>
237 <tr bgcolor="#eeeeee"><td><a href="#NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor confusion</a></td><td>Correctness</td></tr>
238 <tr bgcolor="#ffffff"><td><a href="#NM_VERY_CONFUSING">Nm: Very confusing method names</a></td><td>Correctness</td></tr>
239 <tr bgcolor="#eeeeee"><td><a href="#NM_WRONG_PACKAGE">Nm: Method doesn't override method in superclass due to wrong package for parameter</a></td><td>Correctness</td></tr>
240 <tr bgcolor="#ffffff"><td><a href="#QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean literal in boolean expression</a></td><td>Correctness</td></tr>
241 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON">RC: Suspicious reference comparison</a></td><td>Correctness</td></tr>
242 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE">RCN: Nullcheck of value previously dereferenced</a></td><td>Correctness</td></tr>
243 <tr bgcolor="#eeeeee"><td><a href="#RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">RE: Invalid syntax for regular expression</a></td><td>Correctness</td></tr>
244 <tr bgcolor="#ffffff"><td><a href="#RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION">RE: File.separator used for regular expression</a></td><td>Correctness</td></tr>
245 <tr bgcolor="#eeeeee"><td><a href="#RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or "|" used for regular expression</a></td><td>Correctness</td></tr>
246 <tr bgcolor="#ffffff"><td><a href="#RV_01_TO_INT">RV: Random value from 0 to 1 is coerced to the integer 0</a></td><td>Correctness</td></tr>
247 <tr bgcolor="#eeeeee"><td><a href="#RV_ABSOLUTE_VALUE_OF_HASHCODE">RV: Bad attempt to compute absolute value of signed 32-bit hashcode </a></td><td>Correctness</td></tr>
248 <tr bgcolor="#ffffff"><td><a href="#RV_ABSOLUTE_VALUE_OF_RANDOM_INT">RV: Bad attempt to compute absolute value of signed random integer</a></td><td>Correctness</td></tr>
249 <tr bgcolor="#eeeeee"><td><a href="#RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE">RV: Code checks for specific values returned by compareTo</a></td><td>Correctness</td></tr>
250 <tr bgcolor="#ffffff"><td><a href="#RV_EXCEPTION_NOT_THROWN">RV: Exception created and dropped rather than thrown</a></td><td>Correctness</td></tr>
251 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED">RV: Method ignores return value</a></td><td>Correctness</td></tr>
252 <tr bgcolor="#ffffff"><td><a href="#RpC_REPEATED_CONDITIONAL_TEST">RpC: Repeated conditional tests</a></td><td>Correctness</td></tr>
253 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_ASSIGNMENT">SA: Self assignment of field</a></td><td>Correctness</td></tr>
254 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_SELF_COMPARISON">SA: Self comparison of field with itself</a></td><td>Correctness</td></tr>
255 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_COMPUTATION">SA: Nonsensical self computation involving a field (e.g., x & x)</a></td><td>Correctness</td></tr>
256 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">SA: Self assignment of local rather than assignment to field</a></td><td>Correctness</td></tr>
257 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_COMPARISON">SA: Self comparison of value with itself</a></td><td>Correctness</td></tr>
258 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_COMPUTATION">SA: Nonsensical self computation involving a variable (e.g., x & x)</a></td><td>Correctness</td></tr>
259 <tr bgcolor="#eeeeee"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">SF: Dead store due to switch statement fall through</a></td><td>Correctness</td></tr>
260 <tr bgcolor="#ffffff"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW">SF: Dead store due to switch statement fall through to throw</a></td><td>Correctness</td></tr>
261 <tr bgcolor="#eeeeee"><td><a href="#SIC_THREADLOCAL_DEADLY_EMBRACE">SIC: Deadly embrace of non-static inner class and thread local</a></td><td>Correctness</td></tr>
262 <tr bgcolor="#ffffff"><td><a href="#SIO_SUPERFLUOUS_INSTANCEOF">SIO: Unnecessary type check done using instanceof operator</a></td><td>Correctness</td></tr>
263 <tr bgcolor="#eeeeee"><td><a href="#SQL_BAD_PREPARED_STATEMENT_ACCESS">SQL: Method attempts to access a prepared statement parameter with index 0</a></td><td>Correctness</td></tr>
264 <tr bgcolor="#ffffff"><td><a href="#SQL_BAD_RESULTSET_ACCESS">SQL: Method attempts to access a result set field with index 0</a></td><td>Correctness</td></tr>
265 <tr bgcolor="#eeeeee"><td><a href="#STI_INTERRUPTED_ON_CURRENTTHREAD">STI: Unneeded use of currentThread() call, to call interrupted() </a></td><td>Correctness</td></tr>
266 <tr bgcolor="#ffffff"><td><a href="#STI_INTERRUPTED_ON_UNKNOWNTHREAD">STI: Static Thread.interrupted() method invoked on thread instance</a></td><td>Correctness</td></tr>
267 <tr bgcolor="#eeeeee"><td><a href="#SE_METHOD_MUST_BE_PRIVATE">Se: Method must be private in order for serialization to work</a></td><td>Correctness</td></tr>
268 <tr bgcolor="#ffffff"><td><a href="#SE_READ_RESOLVE_IS_STATIC">Se: The readResolve method must not be declared as a static method. </a></td><td>Correctness</td></tr>
269 <tr bgcolor="#eeeeee"><td><a href="#TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">TQ: Value annotated as carrying a type qualifier used where a value that must not carry that qualifier is required</a></td><td>Correctness</td></tr>
270 <tr bgcolor="#ffffff"><td><a href="#TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS">TQ: Comparing values with incompatible type qualifiers</a></td><td>Correctness</td></tr>
271 <tr bgcolor="#eeeeee"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">TQ: Value that might not carry a type qualifier is always used in a way requires that type qualifier</a></td><td>Correctness</td></tr>
272 <tr bgcolor="#ffffff"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value that might carry a type qualifier is always used in a way prohibits it from having that type qualifier</a></td><td>Correctness</td></tr>
273 <tr bgcolor="#eeeeee"><td><a href="#TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">TQ: Value annotated as never carrying a type qualifier used where value carrying that qualifier is required</a></td><td>Correctness</td></tr>
274 <tr bgcolor="#ffffff"><td><a href="#TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED">TQ: Value without a type qualifier used where a value is required to have that qualifier</a></td><td>Correctness</td></tr>
275 <tr bgcolor="#eeeeee"><td><a href="#UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">UMAC: Uncallable method defined in anonymous class</a></td><td>Correctness</td></tr>
276 <tr bgcolor="#ffffff"><td><a href="#UR_UNINIT_READ">UR: Uninitialized read of field in constructor</a></td><td>Correctness</td></tr>
277 <tr bgcolor="#eeeeee"><td><a href="#UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR">UR: Uninitialized read of field method called from constructor of superclass</a></td><td>Correctness</td></tr>
278 <tr bgcolor="#ffffff"><td><a href="#DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">USELESS_STRING: Invocation of toString on an unnamed array</a></td><td>Correctness</td></tr>
279 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_TOSTRING_ON_ARRAY">USELESS_STRING: Invocation of toString on an array</a></td><td>Correctness</td></tr>
280 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">USELESS_STRING: Array formatted in useless way using format string</a></td><td>Correctness</td></tr>
281 <tr bgcolor="#eeeeee"><td><a href="#UWF_NULL_FIELD">UwF: Field only ever set to null</a></td><td>Correctness</td></tr>
282 <tr bgcolor="#ffffff"><td><a href="#UWF_UNWRITTEN_FIELD">UwF: Unwritten field</a></td><td>Correctness</td></tr>
283 <tr bgcolor="#eeeeee"><td><a href="#VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">VA: Primitive array passed to function expecting a variable number of object arguments</a></td><td>Correctness</td></tr>
284 <tr bgcolor="#ffffff"><td><a href="#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">LG: Potential lost logger changes due to weak reference in OpenJDK</a></td><td>Experimental</td></tr>
285 <tr bgcolor="#eeeeee"><td><a href="#OBL_UNSATISFIED_OBLIGATION">OBL: Method may fail to clean up stream or resource</a></td><td>Experimental</td></tr>
286 <tr bgcolor="#ffffff"><td><a href="#OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">OBL: Method may fail to clean up stream or resource on checked exception</a></td><td>Experimental</td></tr>
287 <tr bgcolor="#eeeeee"><td><a href="#DM_CONVERT_CASE">Dm: Consider using Locale parameterized version of invoked method</a></td><td>Internationalization</td></tr>
288 <tr bgcolor="#ffffff"><td><a href="#DM_DEFAULT_ENCODING">Dm: Reliance on default encoding</a></td><td>Internationalization</td></tr>
289 <tr bgcolor="#eeeeee"><td><a href="#DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">DP: Classloaders should only be created inside doPrivileged block</a></td><td>Malicious code vulnerability</td></tr>
290 <tr bgcolor="#ffffff"><td><a href="#DP_DO_INSIDE_DO_PRIVILEGED">DP: Method invoked that should be only be invoked inside a doPrivileged block</a></td><td>Malicious code vulnerability</td></tr>
291 <tr bgcolor="#eeeeee"><td><a href="#EI_EXPOSE_REP">EI: May expose internal representation by returning reference to mutable object</a></td><td>Malicious code vulnerability</td></tr>
292 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_REP2">EI2: May expose internal representation by incorporating reference to mutable object</a></td><td>Malicious code vulnerability</td></tr>
293 <tr bgcolor="#eeeeee"><td><a href="#FI_PUBLIC_SHOULD_BE_PROTECTED">FI: Finalizer should be protected, not public</a></td><td>Malicious code vulnerability</td></tr>
294 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_STATIC_REP2">MS: May expose internal static state by storing a mutable object into a static field</a></td><td>Malicious code vulnerability</td></tr>
295 <tr bgcolor="#eeeeee"><td><a href="#MS_CANNOT_BE_FINAL">MS: Field isn't final and can't be protected from malicious code</a></td><td>Malicious code vulnerability</td></tr>
296 <tr bgcolor="#ffffff"><td><a href="#MS_EXPOSE_REP">MS: Public static method may expose internal representation by returning array</a></td><td>Malicious code vulnerability</td></tr>
297 <tr bgcolor="#eeeeee"><td><a href="#MS_FINAL_PKGPROTECT">MS: Field should be both final and package protected</a></td><td>Malicious code vulnerability</td></tr>
298 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_ARRAY">MS: Field is a mutable array</a></td><td>Malicious code vulnerability</td></tr>
299 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable</a></td><td>Malicious code vulnerability</td></tr>
300 <tr bgcolor="#ffffff"><td><a href="#MS_OOI_PKGPROTECT">MS: Field should be moved out of an interface and made package protected</a></td><td>Malicious code vulnerability</td></tr>
301 <tr bgcolor="#eeeeee"><td><a href="#MS_PKGPROTECT">MS: Field should be package protected</a></td><td>Malicious code vulnerability</td></tr>
302 <tr bgcolor="#ffffff"><td><a href="#MS_SHOULD_BE_FINAL">MS: Field isn't final but should be</a></td><td>Malicious code vulnerability</td></tr>
303 <tr bgcolor="#eeeeee"><td><a href="#MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS: Field isn't final but should be refactored to be so</a></td><td>Malicious code vulnerability</td></tr>
304 <tr bgcolor="#ffffff"><td><a href="#AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION">AT: Sequence of calls to concurrent abstraction may not be atomic</a></td><td>Multithreaded correctness</td></tr>
305 <tr bgcolor="#eeeeee"><td><a href="#DC_DOUBLECHECK">DC: Possible double check of field</a></td><td>Multithreaded correctness</td></tr>
306 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean</a></td><td>Multithreaded correctness</td></tr>
307 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: Synchronization on boxed primitive</a></td><td>Multithreaded correctness</td></tr>
308 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: Synchronization on interned String </a></td><td>Multithreaded correctness</td></tr>
309 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE">DL: Synchronization on boxed primitive values</a></td><td>Multithreaded correctness</td></tr>
310 <tr bgcolor="#ffffff"><td><a href="#DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wait() called on Condition</a></td><td>Multithreaded correctness</td></tr>
311 <tr bgcolor="#eeeeee"><td><a href="#DM_USELESS_THREAD">Dm: A thread was created using the default empty run method</a></td><td>Multithreaded correctness</td></tr>
312 <tr bgcolor="#ffffff"><td><a href="#ESync_EMPTY_SYNC">ESync: Empty synchronized block</a></td><td>Multithreaded correctness</td></tr>
313 <tr bgcolor="#eeeeee"><td><a href="#IS2_INCONSISTENT_SYNC">IS: Inconsistent synchronization</a></td><td>Multithreaded correctness</td></tr>
314 <tr bgcolor="#ffffff"><td><a href="#IS_FIELD_NOT_GUARDED">IS: Field not guarded against concurrent access</a></td><td>Multithreaded correctness</td></tr>
315 <tr bgcolor="#eeeeee"><td><a href="#JLM_JSR166_LOCK_MONITORENTER">JLM: Synchronization performed on Lock</a></td><td>Multithreaded correctness</td></tr>
316 <tr bgcolor="#ffffff"><td><a href="#JLM_JSR166_UTILCONCURRENT_MONITORENTER">JLM: Synchronization performed on util.concurrent instance</a></td><td>Multithreaded correctness</td></tr>
317 <tr bgcolor="#eeeeee"><td><a href="#JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">JLM: Using monitor style wait methods on util.concurrent abstraction</a></td><td>Multithreaded correctness</td></tr>
318 <tr bgcolor="#ffffff"><td><a href="#LI_LAZY_INIT_STATIC">LI: Incorrect lazy initialization of static field</a></td><td>Multithreaded correctness</td></tr>
319 <tr bgcolor="#eeeeee"><td><a href="#LI_LAZY_INIT_UPDATE_STATIC">LI: Incorrect lazy initialization and update of static field</a></td><td>Multithreaded correctness</td></tr>
320 <tr bgcolor="#ffffff"><td><a href="#ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD">ML: Synchronization on field in futile attempt to guard that field</a></td><td>Multithreaded correctness</td></tr>
321 <tr bgcolor="#eeeeee"><td><a href="#ML_SYNC_ON_UPDATED_FIELD">ML: Method synchronizes on an updated field</a></td><td>Multithreaded correctness</td></tr>
322 <tr bgcolor="#ffffff"><td><a href="#MSF_MUTABLE_SERVLET_FIELD">MSF: Mutable servlet field</a></td><td>Multithreaded correctness</td></tr>
323 <tr bgcolor="#eeeeee"><td><a href="#MWN_MISMATCHED_NOTIFY">MWN: Mismatched notify()</a></td><td>Multithreaded correctness</td></tr>
324 <tr bgcolor="#ffffff"><td><a href="#MWN_MISMATCHED_WAIT">MWN: Mismatched wait()</a></td><td>Multithreaded correctness</td></tr>
325 <tr bgcolor="#eeeeee"><td><a href="#NN_NAKED_NOTIFY">NN: Naked notify</a></td><td>Multithreaded correctness</td></tr>
326 <tr bgcolor="#ffffff"><td><a href="#NP_SYNC_AND_NULL_CHECK_FIELD">NP: Synchronize and null check on the same field.</a></td><td>Multithreaded correctness</td></tr>
327 <tr bgcolor="#eeeeee"><td><a href="#NO_NOTIFY_NOT_NOTIFYALL">No: Using notify() rather than notifyAll()</a></td><td>Multithreaded correctness</td></tr>
328 <tr bgcolor="#ffffff"><td><a href="#RS_READOBJECT_SYNC">RS: Class's readObject() method is synchronized</a></td><td>Multithreaded correctness</td></tr>
329 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED">RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused</a></td><td>Multithreaded correctness</td></tr>
330 <tr bgcolor="#ffffff"><td><a href="#RU_INVOKE_RUN">Ru: Invokes run on a thread (did you mean to start it instead?)</a></td><td>Multithreaded correctness</td></tr>
331 <tr bgcolor="#eeeeee"><td><a href="#SC_START_IN_CTOR">SC: Constructor invokes Thread.start()</a></td><td>Multithreaded correctness</td></tr>
332 <tr bgcolor="#ffffff"><td><a href="#SP_SPIN_ON_FIELD">SP: Method spins on field</a></td><td>Multithreaded correctness</td></tr>
333 <tr bgcolor="#eeeeee"><td><a href="#STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE">STCAL: Call to static Calendar</a></td><td>Multithreaded correctness</td></tr>
334 <tr bgcolor="#ffffff"><td><a href="#STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE">STCAL: Call to static DateFormat</a></td><td>Multithreaded correctness</td></tr>
335 <tr bgcolor="#eeeeee"><td><a href="#STCAL_STATIC_CALENDAR_INSTANCE">STCAL: Static Calendar field</a></td><td>Multithreaded correctness</td></tr>
336 <tr bgcolor="#ffffff"><td><a href="#STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE">STCAL: Static DateFormat</a></td><td>Multithreaded correctness</td></tr>
337 <tr bgcolor="#eeeeee"><td><a href="#SWL_SLEEP_WITH_LOCK_HELD">SWL: Method calls Thread.sleep() with a lock held</a></td><td>Multithreaded correctness</td></tr>
338 <tr bgcolor="#ffffff"><td><a href="#TLW_TWO_LOCK_WAIT">TLW: Wait with two locks held</a></td><td>Multithreaded correctness</td></tr>
339 <tr bgcolor="#eeeeee"><td><a href="#UG_SYNC_SET_UNSYNC_GET">UG: Unsynchronized get method, synchronized set method</a></td><td>Multithreaded correctness</td></tr>
340 <tr bgcolor="#ffffff"><td><a href="#UL_UNRELEASED_LOCK">UL: Method does not release lock on all paths</a></td><td>Multithreaded correctness</td></tr>
341 <tr bgcolor="#eeeeee"><td><a href="#UL_UNRELEASED_LOCK_EXCEPTION_PATH">UL: Method does not release lock on all exception paths</a></td><td>Multithreaded correctness</td></tr>
342 <tr bgcolor="#ffffff"><td><a href="#UW_UNCOND_WAIT">UW: Unconditional wait</a></td><td>Multithreaded correctness</td></tr>
343 <tr bgcolor="#eeeeee"><td><a href="#VO_VOLATILE_INCREMENT">VO: An increment to a volatile field isn't atomic</a></td><td>Multithreaded correctness</td></tr>
344 <tr bgcolor="#ffffff"><td><a href="#VO_VOLATILE_REFERENCE_TO_ARRAY">VO: A volatile reference to an array doesn't treat the array elements as volatile</a></td><td>Multithreaded correctness</td></tr>
345 <tr bgcolor="#eeeeee"><td><a href="#WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL">WL: Synchronization on getClass rather than class literal</a></td><td>Multithreaded correctness</td></tr>
346 <tr bgcolor="#ffffff"><td><a href="#WS_WRITEOBJECT_SYNC">WS: Class's writeObject() method is synchronized but nothing else is</a></td><td>Multithreaded correctness</td></tr>
347 <tr bgcolor="#eeeeee"><td><a href="#WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await() not in loop </a></td><td>Multithreaded correctness</td></tr>
348 <tr bgcolor="#ffffff"><td><a href="#WA_NOT_IN_LOOP">Wa: Wait not in loop </a></td><td>Multithreaded correctness</td></tr>
349 <tr bgcolor="#eeeeee"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive value is boxed and then immediately unboxed</a></td><td>Performance</td></tr>
350 <tr bgcolor="#ffffff"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">Bx: Primitive value is boxed then unboxed to perform primitive coercion</a></td><td>Performance</td></tr>
351 <tr bgcolor="#eeeeee"><td><a href="#BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and then immediately reboxed</a></td><td>Performance</td></tr>
352 <tr bgcolor="#ffffff"><td><a href="#DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a primitive</a></td><td>Performance</td></tr>
353 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive just to call toString</a></td><td>Performance</td></tr>
354 <tr bgcolor="#ffffff"><td><a href="#DM_FP_NUMBER_CTOR">Bx: Method invokes inefficient floating-point Number constructor; use static valueOf instead</a></td><td>Performance</td></tr>
355 <tr bgcolor="#eeeeee"><td><a href="#DM_NUMBER_CTOR">Bx: Method invokes inefficient Number constructor; use static valueOf instead</a></td><td>Performance</td></tr>
356 <tr bgcolor="#ffffff"><td><a href="#DMI_BLOCKING_METHODS_ON_URL">Dm: The equals and hashCode methods of URL are blocking</a></td><td>Performance</td></tr>
357 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTION_OF_URLS">Dm: Maps and sets of URLs can be performance hogs</a></td><td>Performance</td></tr>
358 <tr bgcolor="#ffffff"><td><a href="#DM_BOOLEAN_CTOR">Dm: Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead</a></td><td>Performance</td></tr>
359 <tr bgcolor="#eeeeee"><td><a href="#DM_GC">Dm: Explicit garbage collection; extremely dubious except in benchmarking code</a></td><td>Performance</td></tr>
360 <tr bgcolor="#ffffff"><td><a href="#DM_NEW_FOR_GETCLASS">Dm: Method allocates an object, only to get the class object</a></td><td>Performance</td></tr>
361 <tr bgcolor="#eeeeee"><td><a href="#DM_NEXTINT_VIA_NEXTDOUBLE">Dm: Use the nextInt method of Random rather than nextDouble to generate a random integer</a></td><td>Performance</td></tr>
362 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_CTOR">Dm: Method invokes inefficient new String(String) constructor</a></td><td>Performance</td></tr>
363 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_TOSTRING">Dm: Method invokes toString() method on a String</a></td><td>Performance</td></tr>
364 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_VOID_CTOR">Dm: Method invokes inefficient new String() constructor</a></td><td>Performance</td></tr>
365 <tr bgcolor="#eeeeee"><td><a href="#HSC_HUGE_SHARED_STRING_CONSTANT">HSC: Huge string constants is duplicated across multiple class files</a></td><td>Performance</td></tr>
366 <tr bgcolor="#ffffff"><td><a href="#ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses toArray() with zero-length array argument</a></td><td>Performance</td></tr>
367 <tr bgcolor="#eeeeee"><td><a href="#SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: Method concatenates strings using + in a loop</a></td><td>Performance</td></tr>
368 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a static inner class</a></td><td>Performance</td></tr>
369 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_ANON">SIC: Could be refactored into a named static inner class</a></td><td>Performance</td></tr>
370 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">SIC: Could be refactored into a static inner class</a></td><td>Performance</td></tr>
371 <tr bgcolor="#eeeeee"><td><a href="#SS_SHOULD_BE_STATIC">SS: Unread field: should this field be static?</a></td><td>Performance</td></tr>
372 <tr bgcolor="#ffffff"><td><a href="#UM_UNNECESSARY_MATH">UM: Method calls static Math class method on a constant value</a></td><td>Performance</td></tr>
373 <tr bgcolor="#eeeeee"><td><a href="#UPM_UNCALLED_PRIVATE_METHOD">UPM: Private method is never called</a></td><td>Performance</td></tr>
374 <tr bgcolor="#ffffff"><td><a href="#URF_UNREAD_FIELD">UrF: Unread field</a></td><td>Performance</td></tr>
375 <tr bgcolor="#eeeeee"><td><a href="#UUF_UNUSED_FIELD">UuF: Unused field</a></td><td>Performance</td></tr>
376 <tr bgcolor="#ffffff"><td><a href="#WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use of keySet iterator instead of entrySet iterator</a></td><td>Performance</td></tr>
377 <tr bgcolor="#eeeeee"><td><a href="#DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded constant database password</a></td><td>Security</td></tr>
378 <tr bgcolor="#ffffff"><td><a href="#DMI_EMPTY_DB_PASSWORD">Dm: Empty database password</a></td><td>Security</td></tr>
379 <tr bgcolor="#eeeeee"><td><a href="#HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP cookie formed from untrusted input</a></td><td>Security</td></tr>
380 <tr bgcolor="#ffffff"><td><a href="#HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: HTTP Response splitting vulnerability</a></td><td>Security</td></tr>
381 <tr bgcolor="#eeeeee"><td><a href="#PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute path traversal in servlet</a></td><td>Security</td></tr>
382 <tr bgcolor="#ffffff"><td><a href="#PT_RELATIVE_PATH_TRAVERSAL">PT: Relative path traversal in servlet</a></td><td>Security</td></tr>
383 <tr bgcolor="#eeeeee"><td><a href="#SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQL: Nonconstant string passed to execute method on an SQL statement</a></td><td>Security</td></tr>
384 <tr bgcolor="#ffffff"><td><a href="#SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING">SQL: A prepared statement is generated from a nonconstant String</a></td><td>Security</td></tr>
385 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JSP reflected cross site scripting vulnerability</a></td><td>Security</td></tr>
386 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_SEND_ERROR">XSS: Servlet reflected cross site scripting vulnerability in error page</a></td><td>Security</td></tr>
387 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS: Servlet reflected cross site scripting vulnerability</a></td><td>Security</td></tr>
388 <tr bgcolor="#ffffff"><td><a href="#BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Questionable cast to abstract collection </a></td><td>Dodgy code</td></tr>
389 <tr bgcolor="#eeeeee"><td><a href="#BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Questionable cast to concrete collection</a></td><td>Dodgy code</td></tr>
390 <tr bgcolor="#ffffff"><td><a href="#BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirmed cast</a></td><td>Dodgy code</td></tr>
391 <tr bgcolor="#eeeeee"><td><a href="#BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC: Unchecked/unconfirmed cast of return value from method</a></td><td>Dodgy code</td></tr>
392 <tr bgcolor="#ffffff"><td><a href="#BC_VACUOUS_INSTANCEOF">BC: instanceof will always return true</a></td><td>Dodgy code</td></tr>
393 <tr bgcolor="#eeeeee"><td><a href="#ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSHIFT: Unsigned right shift cast to short/byte</a></td><td>Dodgy code</td></tr>
394 <tr bgcolor="#ffffff"><td><a href="#CI_CONFUSED_INHERITANCE">CI: Class is final but declares protected field</a></td><td>Dodgy code</td></tr>
395 <tr bgcolor="#eeeeee"><td><a href="#DB_DUPLICATE_BRANCHES">DB: Method uses the same code for two branches</a></td><td>Dodgy code</td></tr>
396 <tr bgcolor="#ffffff"><td><a href="#DB_DUPLICATE_SWITCH_CLAUSES">DB: Method uses the same code for two switch clauses</a></td><td>Dodgy code</td></tr>
397 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE">DLS: Dead store to local variable</a></td><td>Dodgy code</td></tr>
398 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_IN_RETURN">DLS: Useless assignment in return statement</a></td><td>Dodgy code</td></tr>
399 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE_OF_NULL">DLS: Dead store of null to local variable</a></td><td>Dodgy code</td></tr>
400 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS: Dead store to local variable that shadows field</a></td><td>Dodgy code</td></tr>
401 <tr bgcolor="#eeeeee"><td><a href="#DMI_HARDCODED_ABSOLUTE_FILENAME">DMI: Code contains a hard coded reference to an absolute pathname</a></td><td>Dodgy code</td></tr>
402 <tr bgcolor="#ffffff"><td><a href="#DMI_NONSERIALIZABLE_OBJECT_WRITTEN">DMI: Non serializable object written to ObjectOutput</a></td><td>Dodgy code</td></tr>
403 <tr bgcolor="#eeeeee"><td><a href="#DMI_USELESS_SUBSTRING">DMI: Invocation of substring(0), which returns the original value</a></td><td>Dodgy code</td></tr>
404 <tr bgcolor="#ffffff"><td><a href="#DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">Dm: Thread passed where Runnable expected</a></td><td>Dodgy code</td></tr>
405 <tr bgcolor="#eeeeee"><td><a href="#EQ_DOESNT_OVERRIDE_EQUALS">Eq: Class doesn't override equals in superclass</a></td><td>Dodgy code</td></tr>
406 <tr bgcolor="#ffffff"><td><a href="#EQ_UNUSUAL">Eq: Unusual equals method </a></td><td>Dodgy code</td></tr>
407 <tr bgcolor="#eeeeee"><td><a href="#FE_FLOATING_POINT_EQUALITY">FE: Test for floating point equality</a></td><td>Dodgy code</td></tr>
408 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">FS: Non-Boolean argument formatted using %b format specifier</a></td><td>Dodgy code</td></tr>
409 <tr bgcolor="#eeeeee"><td><a href="#IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">IA: Potentially ambiguous invocation of either an inherited or outer method</a></td><td>Dodgy code</td></tr>
410 <tr bgcolor="#ffffff"><td><a href="#IC_INIT_CIRCULARITY">IC: Initialization circularity</a></td><td>Dodgy code</td></tr>
411 <tr bgcolor="#eeeeee"><td><a href="#ICAST_IDIV_CAST_TO_DOUBLE">ICAST: Integral division result cast to double or float</a></td><td>Dodgy code</td></tr>
412 <tr bgcolor="#ffffff"><td><a href="#ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">ICAST: Result of integer multiplication cast to long</a></td><td>Dodgy code</td></tr>
413 <tr bgcolor="#eeeeee"><td><a href="#IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">IM: Computation of average could overflow</a></td><td>Dodgy code</td></tr>
414 <tr bgcolor="#ffffff"><td><a href="#IM_BAD_CHECK_FOR_ODD">IM: Check for oddness that won't work for negative numbers </a></td><td>Dodgy code</td></tr>
415 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_REM_BY_1">INT: Integer remainder modulo 1</a></td><td>Dodgy code</td></tr>
416 <tr bgcolor="#ffffff"><td><a href="#INT_VACUOUS_BIT_OPERATION">INT: Vacuous bit mask operation on integer value</a></td><td>Dodgy code</td></tr>
417 <tr bgcolor="#eeeeee"><td><a href="#INT_VACUOUS_COMPARISON">INT: Vacuous comparison of integer value</a></td><td>Dodgy code</td></tr>
418 <tr bgcolor="#ffffff"><td><a href="#MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">MTIA: Class extends Servlet class and uses instance variables</a></td><td>Dodgy code</td></tr>
419 <tr bgcolor="#eeeeee"><td><a href="#MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">MTIA: Class extends Struts Action class and uses instance variables</a></td><td>Dodgy code</td></tr>
420 <tr bgcolor="#ffffff"><td><a href="#NP_DEREFERENCE_OF_READLINE_VALUE">NP: Dereference of the result of readLine() without nullcheck</a></td><td>Dodgy code</td></tr>
421 <tr bgcolor="#eeeeee"><td><a href="#NP_IMMEDIATE_DEREFERENCE_OF_READLINE">NP: Immediate dereference of the result of readLine()</a></td><td>Dodgy code</td></tr>
422 <tr bgcolor="#ffffff"><td><a href="#NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value</a></td><td>Dodgy code</td></tr>
423 <tr bgcolor="#eeeeee"><td><a href="#NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullness annotation on parameter</a></td><td>Dodgy code</td></tr>
424 <tr bgcolor="#ffffff"><td><a href="#NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Method relaxes nullness annotation on return value</a></td><td>Dodgy code</td></tr>
425 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP: Possible null pointer dereference due to return value of called method</a></td><td>Dodgy code</td></tr>
426 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP: Possible null pointer dereference on branch that might be infeasible</a></td><td>Dodgy code</td></tr>
427 <tr bgcolor="#eeeeee"><td><a href="#NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP: Parameter must be nonnull but is marked as nullable</a></td><td>Dodgy code</td></tr>
428 <tr bgcolor="#ffffff"><td><a href="#NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP: Read of unwritten public or protected field</a></td><td>Dodgy code</td></tr>
429 <tr bgcolor="#eeeeee"><td><a href="#NS_DANGEROUS_NON_SHORT_CIRCUIT">NS: Potentially dangerous use of non-short-circuit logic</a></td><td>Dodgy code</td></tr>
430 <tr bgcolor="#ffffff"><td><a href="#NS_NON_SHORT_CIRCUIT">NS: Questionable use of non-short-circuit logic</a></td><td>Dodgy code</td></tr>
431 <tr bgcolor="#eeeeee"><td><a href="#PZLA_PREFER_ZERO_LENGTH_ARRAYS">PZLA: Consider returning a zero length array rather than null</a></td><td>Dodgy code</td></tr>
432 <tr bgcolor="#ffffff"><td><a href="#QF_QUESTIONABLE_FOR_LOOP">QF: Complicated, subtle or wrong increment in for-loop </a></td><td>Dodgy code</td></tr>
433 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE">RCN: Redundant comparison of non-null value to null</a></td><td>Dodgy code</td></tr>
434 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">RCN: Redundant comparison of two null values</a></td><td>Dodgy code</td></tr>
435 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">RCN: Redundant nullcheck of value known to be non-null</a></td><td>Dodgy code</td></tr>
436 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN: Redundant nullcheck of value known to be null</a></td><td>Dodgy code</td></tr>
437 <tr bgcolor="#eeeeee"><td><a href="#REC_CATCH_EXCEPTION">REC: Exception is caught when Exception is not thrown</a></td><td>Dodgy code</td></tr>
438 <tr bgcolor="#ffffff"><td><a href="#RI_REDUNDANT_INTERFACES">RI: Class implements same interface as superclass</a></td><td>Dodgy code</td></tr>
439 <tr bgcolor="#eeeeee"><td><a href="#RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method checks to see if result of String.indexOf is positive</a></td><td>Dodgy code</td></tr>
440 <tr bgcolor="#ffffff"><td><a href="#RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method discards result of readLine after checking if it is nonnull</a></td><td>Dodgy code</td></tr>
441 <tr bgcolor="#eeeeee"><td><a href="#RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative</a></td><td>Dodgy code</td></tr>
442 <tr bgcolor="#ffffff"><td><a href="#RV_REM_OF_RANDOM_INT">RV: Remainder of 32-bit signed random integer</a></td><td>Dodgy code</td></tr>
443 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_INFERRED">RV: Method ignores return value, is this OK?</a></td><td>Dodgy code</td></tr>
444 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field</a></td><td>Dodgy code</td></tr>
445 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assignment of local variable </a></td><td>Dodgy code</td></tr>
446 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignment of local variable</a></td><td>Dodgy code</td></tr>
447 <tr bgcolor="#eeeeee"><td><a href="#SF_SWITCH_FALLTHROUGH">SF: Switch statement found where one case falls through to the next case</a></td><td>Dodgy code</td></tr>
448 <tr bgcolor="#ffffff"><td><a href="#SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case is missing</a></td><td>Dodgy code</td></tr>
449 <tr bgcolor="#eeeeee"><td><a href="#ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST: Write to static field from instance method</a></td><td>Dodgy code</td></tr>
450 <tr bgcolor="#ffffff"><td><a href="#SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">Se: Private readResolve method not inherited by subclasses</a></td><td>Dodgy code</td></tr>
451 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS">Se: Transient field of class that isn't Serializable. </a></td><td>Dodgy code</td></tr>
452 <tr bgcolor="#ffffff"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK">TQ: Value required to have type qualifier, but marked as unknown</a></td><td>Dodgy code</td></tr>
453 <tr bgcolor="#eeeeee"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value required to not have type qualifier, but marked as unknown</a></td><td>Dodgy code</td></tr>
454 <tr bgcolor="#ffffff"><td><a href="#UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow</a></td><td>Dodgy code</td></tr>
455 <tr bgcolor="#eeeeee"><td><a href="#UCF_USELESS_CONTROL_FLOW_NEXT_LINE">UCF: Useless control flow to next line</a></td><td>Dodgy code</td></tr>
456 <tr bgcolor="#ffffff"><td><a href="#URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">UrF: Unread public/protected field</a></td><td>Dodgy code</td></tr>
457 <tr bgcolor="#eeeeee"><td><a href="#UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UuF: Unused public or protected field</a></td><td>Dodgy code</td></tr>
458 <tr bgcolor="#ffffff"><td><a href="#UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">UwF: Field not initialized in constructor but dereferenced without null check</a></td><td>Dodgy code</td></tr>
459 <tr bgcolor="#eeeeee"><td><a href="#UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UwF: Unwritten public or protected field</a></td><td>Dodgy code</td></tr>
460 <tr bgcolor="#ffffff"><td><a href="#XFB_XML_FACTORY_BYPASS">XFB: Method directly allocates a specific implementation of xml interfaces</a></td><td>Dodgy code</td></tr>
461 </table>
462 <h2>Descriptions</h2>
463 <h3><a name="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS">BC: Equals method should not assume anything about the type of its argument (BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS)</a></h3>
464
465
466 <p>
467 The <code>equals(Object o)</code> method shouldn't make any assumptions
468 about the type of <code>o</code>. It should simply return
469 false if <code>o</code> is not the same type as <code>this</code>.
470 </p>
471
472
473 <h3><a name="BIT_SIGNED_CHECK">BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK)</a></h3>
474
475
476 <p> This method compares an expression such as</p>
477 <pre>((event.detail &amp; SWT.SELECTED) &gt; 0)</pre>.
478 <p>Using bit arithmetic and then comparing with the greater than operator can
479 lead to unexpected results (of course depending on the value of
480 SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate
481 for a bug. Even when SWT.SELECTED is not negative, it seems good practice
482 to use '!= 0' instead of '&gt; 0'.
483 </p>
484 <p>
485 <em>Boris Bokowski</em>
486 </p>
487
488
489 <h3><a name="CN_IDIOM">CN: Class implements Cloneable but does not define or use clone method (CN_IDIOM)</a></h3>
490
491
492 <p>
493 Class implements Cloneable but does not define or
494 use the clone method.</p>
495
496
497 <h3><a name="CN_IDIOM_NO_SUPER_CALL">CN: clone method does not call super.clone() (CN_IDIOM_NO_SUPER_CALL)</a></h3>
498
499
500 <p> This non-final class defines a clone() method that does not call super.clone().
501 If this class ("<i>A</i>") is extended by a subclass ("<i>B</i>"),
502 and the subclass <i>B</i> calls super.clone(), then it is likely that
503 <i>B</i>'s clone() method will return an object of type <i>A</i>,
504 which violates the standard contract for clone().</p>
505
506 <p> If all clone() methods call super.clone(), then they are guaranteed
507 to use Object.clone(), which always returns an object of the correct type.</p>
508
509
510 <h3><a name="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: Class defines clone() but doesn't implement Cloneable (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE)</a></h3>
511
512
513 <p> This class defines a clone() method but the class doesn't implement Cloneable.
514 There are some situations in which this is OK (e.g., you want to control how subclasses
515 can clone themselves), but just make sure that this is what you intended.
516 </p>
517
518
519 <h3><a name="CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo() method (CO_ABSTRACT_SELF)</a></h3>
520
521
522 <p> This class defines a covariant version of <code>compareTo()</code>.&nbsp;
523 To correctly override the <code>compareTo()</code> method in the
524 <code>Comparable</code> interface, the parameter of <code>compareTo()</code>
525 must have type <code>java.lang.Object</code>.</p>
526
527
528 <h3><a name="CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined (CO_SELF_NO_OBJECT)</a></h3>
529
530
531 <p> This class defines a covariant version of <code>compareTo()</code>.&nbsp;
532 To correctly override the <code>compareTo()</code> method in the
533 <code>Comparable</code> interface, the parameter of <code>compareTo()</code>
534 must have type <code>java.lang.Object</code>.</p>
535
536
537 <h3><a name="DE_MIGHT_DROP">DE: Method might drop exception (DE_MIGHT_DROP)</a></h3>
538
539
540 <p> This method might drop an exception.&nbsp; In general, exceptions
541 should be handled or reported in some way, or they should be thrown
542 out of the method.</p>
543
544
545 <h3><a name="DE_MIGHT_IGNORE">DE: Method might ignore exception (DE_MIGHT_IGNORE)</a></h3>
546
547
548 <p> This method might ignore an exception.&nbsp; In general, exceptions
549 should be handled or reported in some way, or they should be thrown
550 out of the method.</p>
551
552
553 <h3><a name="DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI: Adding elements of an entry set may fail due to reuse of Entry objects (DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS)</a></h3>
554
555
556 <p> The entrySet() method is allowed to return a view of the
557 underlying Map in which a single Entry object is reused and returned
558 during the iteration. As of Java 1.6, both IdentityHashMap
559 and EnumMap did so. When iterating through such a Map,
560 the Entry value is only valid until you advance to the next iteration.
561 If, for example, you try to pass such an entrySet to an addAll method,
562 things will go badly wrong.
563 </p>
564
565
566 <h3><a name="DMI_RANDOM_USED_ONLY_ONCE">DMI: Random object created and used only once (DMI_RANDOM_USED_ONLY_ONCE)</a></h3>
567
568
569 <p> This code creates a java.util.Random object, uses it to generate one random number, and then discards
570 the Random object. This produces mediocre quality random numbers and is inefficient.
571 If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number
572 is required invoke a method on the existing Random object to obtain it.
573 </p>
574
575 <p>If it is important that the generated Random numbers not be guessable, you <em>must</em> not create a new Random for each random
576 number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead
577 (and avoid allocating a new SecureRandom for each random number needed).
578 </p>
579
580
581 <h3><a name="DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">DMI: Don't use removeAll to clear a collection (DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION)</a></h3>
582
583
584 <p> If you want to remove all elements from a collection <code>c</code>, use <code>c.clear</code>,
585 not <code>c.removeAll(c)</code>. Calling <code>c.removeAll(c)</code> to clear a collection
586 is less clear, susceptible to errors from typos, less efficient and
587 for some collections, might throw a <code>ConcurrentModificationException</code>.
588 </p>
589
590
591 <h3><a name="DM_EXIT">Dm: Method invokes System.exit(...) (DM_EXIT)</a></h3>
592
593
594 <p> Invoking System.exit shuts down the entire Java virtual machine. This
595 should only been done when it is appropriate. Such calls make it
596 hard or impossible for your code to be invoked by other code.
597 Consider throwing a RuntimeException instead.</p>
598
599
600 <h3><a name="DM_RUN_FINALIZERS_ON_EXIT">Dm: Method invokes dangerous method runFinalizersOnExit (DM_RUN_FINALIZERS_ON_EXIT)</a></h3>
601
602
603 <p> <em>Never call System.runFinalizersOnExit
604 or Runtime.runFinalizersOnExit for any reason: they are among the most
605 dangerous methods in the Java libraries.</em> -- Joshua Bloch</p>
606
607
608 <h3><a name="ES_COMPARING_PARAMETER_STRING_WITH_EQ">ES: Comparison of String parameter using == or != (ES_COMPARING_PARAMETER_STRING_WITH_EQ)</a></h3>
609
610
611 <p>This code compares a <code>java.lang.String</code> parameter for reference
612 equality using the == or != operators. Requiring callers to
613 pass only String constants or interned strings to a method is unnecessarily
614 fragile, and rarely leads to measurable performance gains. Consider
615 using the <code>equals(Object)</code> method instead.</p>
616
617
618 <h3><a name="ES_COMPARING_STRINGS_WITH_EQ">ES: Comparison of String objects using == or != (ES_COMPARING_STRINGS_WITH_EQ)</a></h3>
619
620
621 <p>This code compares <code>java.lang.String</code> objects for reference
622 equality using the == or != operators.
623 Unless both strings are either constants in a source file, or have been
624 interned using the <code>String.intern()</code> method, the same string
625 value may be represented by two different String objects. Consider
626 using the <code>equals(Object)</code> method instead.</p>
627
628
629 <h3><a name="EQ_ABSTRACT_SELF">Eq: Abstract class defines covariant equals() method (EQ_ABSTRACT_SELF)</a></h3>
630
631
632 <p> This class defines a covariant version of <code>equals()</code>.&nbsp;
633 To correctly override the <code>equals()</code> method in
634 <code>java.lang.Object</code>, the parameter of <code>equals()</code>
635 must have type <code>java.lang.Object</code>.</p>
636
637
638 <h3><a name="EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS">Eq: Equals checks for incompatible operand (EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS)</a></h3>
639
640
641 <p> This equals method is checking to see if the argument is some incompatible type
642 (i.e., a class that is neither a supertype nor subtype of the class that defines
643 the equals method). For example, the Foo class might have an equals method
644 that looks like:
645 </p>
646 <pre>
647 public boolean equals(Object o) {
648 if (o instanceof Foo)
649 return name.equals(((Foo)o).name);
650 else if (o instanceof String)
651 return name.equals(o);
652 else return false;
653 </pre>
654
655 <p>This is considered bad practice, as it makes it very hard to implement an equals method that
656 is symmetric and transitive. Without those properties, very unexpected behavoirs are possible.
657 </p>
658
659
660 <h3><a name="EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) and uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS)</a></h3>
661
662
663 <p> This class defines a <code>compareTo(...)</code> method but inherits its
664 <code>equals()</code> method from <code>java.lang.Object</code>.
665 Generally, the value of compareTo should return zero if and only if
666 equals returns true. If this is violated, weird and unpredictable
667 failures will occur in classes such as PriorityQueue.
668 In Java 5 the PriorityQueue.remove method uses the compareTo method,
669 while in Java 6 it uses the equals method.
670
671 <p>From the JavaDoc for the compareTo method in the Comparable interface:
672 <blockquote>
673 It is strongly recommended, but not strictly required that <code>(x.compareTo(y)==0) == (x.equals(y))</code>.
674 Generally speaking, any class that implements the Comparable interface and violates this condition
675 should clearly indicate this fact. The recommended language
676 is "Note: this class has a natural ordering that is inconsistent with equals."
677 </blockquote>
678
679
680 <h3><a name="EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtypes (EQ_GETCLASS_AND_CLASS_CONSTANT)</a></h3>
681
682
683 <p> This class has an equals method that will be broken if it is inherited by subclasses.
684 It compares a class literal with the class of the argument (e.g., in class <code>Foo</code>
685 it might check if <code>Foo.class == o.getClass()</code>).
686 It is better to check if <code>this.getClass() == o.getClass()</code>.
687 </p>
688
689
690 <h3><a name="EQ_SELF_NO_OBJECT">Eq: Covariant equals() method defined (EQ_SELF_NO_OBJECT)</a></h3>
691
692
693 <p> This class defines a covariant version of <code>equals()</code>.&nbsp;
694 To correctly override the <code>equals()</code> method in
695 <code>java.lang.Object</code>, the parameter of <code>equals()</code>
696 must have type <code>java.lang.Object</code>.</p>
697
698
699 <h3><a name="FI_EMPTY">FI: Empty finalizer should be deleted (FI_EMPTY)</a></h3>
700
701
702 <p> Empty <code>finalize()</code> methods are useless, so they should
703 be deleted.</p>
704
705
706 <h3><a name="FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer (FI_EXPLICIT_INVOCATION)</a></h3>
707
708
709 <p> This method contains an explicit invocation of the <code>finalize()</code>
710 method on an object.&nbsp; Because finalizer methods are supposed to be
711 executed once, and only by the VM, this is a bad idea.</p>
712 <p>If a connected set of objects beings finalizable, then the VM will invoke the
713 finalize method on all the finalizable object, possibly at the same time in different threads.
714 Thus, it is a particularly bad idea, in the finalize method for a class X, invoke finalize
715 on objects referenced by X, because they may already be getting finalized in a separate thread.
716
717
718 <h3><a name="FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields (FI_FINALIZER_NULLS_FIELDS)</a></h3>
719
720
721 <p> This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection,
722 and the object is going to be garbage collected anyway.
723
724
725 <h3><a name="FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields (FI_FINALIZER_ONLY_NULLS_FIELDS)</a></h3>
726
727
728 <p> This finalizer does nothing except null out fields. This is completely pointless, and requires that
729 the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize
730 method.
731
732
733 <h3><a name="FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass finalizer (FI_MISSING_SUPER_CALL)</a></h3>
734
735
736 <p> This <code>finalize()</code> method does not make a call to its
737 superclass's <code>finalize()</code> method.&nbsp; So, any finalizer
738 actions defined for the superclass will not be performed.&nbsp;
739 Add a call to <code>super.finalize()</code>.</p>
740
741
742 <h3><a name="FI_NULLIFY_SUPER">FI: Finalizer nullifies superclass finalizer (FI_NULLIFY_SUPER)</a></h3>
743
744
745 <p> This empty <code>finalize()</code> method explicitly negates the
746 effect of any finalizer defined by its superclass.&nbsp; Any finalizer
747 actions defined for the superclass will not be performed.&nbsp;
748 Unless this is intended, delete this method.</p>
749
750
751 <h3><a name="FI_USELESS">FI: Finalizer does nothing but call superclass finalizer (FI_USELESS)</a></h3>
752
753
754 <p> The only thing this <code>finalize()</code> method does is call
755 the superclass's <code>finalize()</code> method, making it
756 redundant.&nbsp; Delete it.</p>
757
758
759 <h3><a name="VA_FORMAT_STRING_USES_NEWLINE">FS: Format string should use %n rather than \n (VA_FORMAT_STRING_USES_NEWLINE)</a></h3>
760
761
762 <p>
763 This format string include a newline character (\n). In format strings, it is generally
764 preferable better to use %n, which will produce the platform-specific line separator.
765 </p>
766
767
768 <h3><a name="GC_UNCHECKED_TYPE_IN_GENERIC_CALL">GC: Unchecked type in generic call (GC_UNCHECKED_TYPE_IN_GENERIC_CALL)</a></h3>
769
770
771 <p> This call to a generic collection method passes an argument
772 while compile type Object where a specific type from
773 the generic type parameters is expected.
774 Thus, neither the standard Java type system nor static analysis
775 can provide useful information on whether the
776 object being passed as a parameter is of an appropriate type.
777 </p>
778
779
780 <h3><a name="HE_EQUALS_NO_HASHCODE">HE: Class defines equals() but not hashCode() (HE_EQUALS_NO_HASHCODE)</a></h3>
781
782
783 <p> This class overrides <code>equals(Object)</code>, but does not
784 override <code>hashCode()</code>.&nbsp; Therefore, the class may violate the
785 invariant that equal objects must have equal hashcodes.</p>
786
787
788 <h3><a name="HE_EQUALS_USE_HASHCODE">HE: Class defines equals() and uses Object.hashCode() (HE_EQUALS_USE_HASHCODE)</a></h3>
789
790
791 <p> This class overrides <code>equals(Object)</code>, but does not
792 override <code>hashCode()</code>, and inherits the implementation of
793 <code>hashCode()</code> from <code>java.lang.Object</code> (which returns
794 the identity hash code, an arbitrary value assigned to the object
795 by the VM).&nbsp; Therefore, the class is very likely to violate the
796 invariant that equal objects must have equal hashcodes.</p>
797
798 <p>If you don't think instances of this class will ever be inserted into a HashMap/HashTable,
799 the recommended <code>hashCode</code> implementation to use is:</p>
800 <pre>public int hashCode() {
801 assert false : "hashCode not designed";
802 return 42; // any arbitrary constant will do
803 }</pre>
804
805
806 <h3><a name="HE_HASHCODE_NO_EQUALS">HE: Class defines hashCode() but not equals() (HE_HASHCODE_NO_EQUALS)</a></h3>
807
808
809 <p> This class defines a <code>hashCode()</code> method but not an
810 <code>equals()</code> method.&nbsp; Therefore, the class may
811 violate the invariant that equal objects must have equal hashcodes.</p>
812
813
814 <h3><a name="HE_HASHCODE_USE_OBJECT_EQUALS">HE: Class defines hashCode() and uses Object.equals() (HE_HASHCODE_USE_OBJECT_EQUALS)</a></h3>
815
816
817 <p> This class defines a <code>hashCode()</code> method but inherits its
818 <code>equals()</code> method from <code>java.lang.Object</code>
819 (which defines equality by comparing object references).&nbsp; Although
820 this will probably satisfy the contract that equal objects must have
821 equal hashcodes, it is probably not what was intended by overriding
822 the <code>hashCode()</code> method.&nbsp; (Overriding <code>hashCode()</code>
823 implies that the object's identity is based on criteria more complicated
824 than simple reference equality.)</p>
825 <p>If you don't think instances of this class will ever be inserted into a HashMap/HashTable,
826 the recommended <code>hashCode</code> implementation to use is:</p>
827 <pre>public int hashCode() {
828 assert false : "hashCode not designed";
829 return 42; // any arbitrary constant will do
830 }</pre>
831
832
833 <h3><a name="HE_INHERITS_EQUALS_USE_HASHCODE">HE: Class inherits equals() and uses Object.hashCode() (HE_INHERITS_EQUALS_USE_HASHCODE)</a></h3>
834
835
836 <p> This class inherits <code>equals(Object)</code> from an abstract
837 superclass, and <code>hashCode()</code> from
838 <code>java.lang.Object</code> (which returns
839 the identity hash code, an arbitrary value assigned to the object
840 by the VM).&nbsp; Therefore, the class is very likely to violate the
841 invariant that equal objects must have equal hashcodes.</p>
842
843 <p>If you don't want to define a hashCode method, and/or don't
844 believe the object will ever be put into a HashMap/Hashtable,
845 define the <code>hashCode()</code> method
846 to throw <code>UnsupportedOperationException</code>.</p>
847
848
849 <h3><a name="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION">IC: Superclass uses subclass during initialization (IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION)</a></h3>
850
851
852 <p> During the initialization of a class, the class makes an active use of a subclass.
853 That subclass will not yet be initialized at the time of this use.
854 For example, in the following code, <code>foo</code> will be null.</p>
855
856 <pre>
857 public class CircularClassInitialization {
858 static class InnerClassSingleton extends CircularClassInitialization {
859 static InnerClassSingleton singleton = new InnerClassSingleton();
860 }
861
862 static CircularClassInitialization foo = InnerClassSingleton.singleton;
863 }
864 </pre>
865
866
867
868 <h3><a name="IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching of IllegalMonitorStateException (IMSE_DONT_CATCH_IMSE)</a></h3>
869
870
871 <p>IllegalMonitorStateException is generally only
872 thrown in case of a design flaw in your code (calling wait or
873 notify on an object you do not hold a lock on).</p>
874
875
876 <h3><a name="ISC_INSTANTIATE_STATIC_CLASS">ISC: Needless instantiation of class that only supplies static methods (ISC_INSTANTIATE_STATIC_CLASS)</a></h3>
877
878
879 <p> This class allocates an object that is based on a class that only supplies static methods. This object
880 does not need to be created, just access the static methods directly using the class name as a qualifier.</p>
881
882
883 <h3><a name="IT_NO_SUCH_ELEMENT">It: Iterator next() method can't throw NoSuchElementException (IT_NO_SUCH_ELEMENT)</a></h3>
884
885
886 <p> This class implements the <code>java.util.Iterator</code> interface.&nbsp;
887 However, its <code>next()</code> method is not capable of throwing
888 <code>java.util.NoSuchElementException</code>.&nbsp; The <code>next()</code>
889 method should be changed so it throws <code>NoSuchElementException</code>
890 if is called when there are no more elements to return.</p>
891
892
893 <h3><a name="J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION">J2EE: Store of non serializable object into HttpSession (J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION)</a></h3>
894
895
896 <p>
897 This code seems to be storing a non-serializable object into an HttpSession.
898 If this session is passivated or migrated, an error will result.
899 </p>
900
901
902 <h3><a name="JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP: Fields of immutable classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS)</a></h3>
903
904
905 <p> The class is annotated with net.jcip.annotations.Immutable or javax.annotation.concurrent.Immutable,
906 and the rules for those annotations require that all fields are final.
907 .</p>
908
909
910 <h3><a name="NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns explicit null (NP_BOOLEAN_RETURN_NULL)</a></h3>
911
912
913 <p>
914 A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen.
915 This method can be invoked as though it returned a value of type boolean, and
916 the compiler will insert automatic unboxing of the Boolean value. If a null value is returned,
917 this will result in a NullPointerException.
918 </p>
919
920
921 <h3><a name="NP_CLONE_COULD_RETURN_NULL">NP: Clone method may return null (NP_CLONE_COULD_RETURN_NULL)</a></h3>
922
923
924 <p>
925 This clone method seems to return null in some circumstances, but clone is never
926 allowed to return a null value. If you are convinced this path is unreachable, throw an AssertionError
927 instead.
928 </p>
929
930
931 <h3><a name="NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT">NP: equals() method does not check for null argument (NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT)</a></h3>
932
933
934 <p>
935 This implementation of equals(Object) violates the contract defined
936 by java.lang.Object.equals() because it does not check for null
937 being passed as the argument. All equals() methods should return
938 false if passed a null value.
939 </p>
940
941
942 <h3><a name="NP_TOSTRING_COULD_RETURN_NULL">NP: toString method may return null (NP_TOSTRING_COULD_RETURN_NULL)</a></h3>
943
944
945 <p>
946 This toString method seems to return null in some circumstances. A liberal reading of the
947 spec could be interpreted as allowing this, but it is probably a bad idea and could cause
948 other code to break. Return the empty string or some other appropriate string rather than null.
949 </p>
950
951
952 <h3><a name="NM_CLASS_NAMING_CONVENTION">Nm: Class names should start with an upper case letter (NM_CLASS_NAMING_CONVENTION)</a></h3>
953
954
955 <p> Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).
956 </p>
957
958
959 <h3><a name="NM_CLASS_NOT_EXCEPTION">Nm: Class is not derived from an Exception, even though it is named as such (NM_CLASS_NOT_EXCEPTION)</a></h3>
960
961
962 <p> This class is not derived from another exception, but ends with 'Exception'. This will
963 be confusing to users of this class.</p>
964
965
966 <h3><a name="NM_CONFUSING">Nm: Confusing method names (NM_CONFUSING)</a></h3>
967
968
969 <p> The referenced methods have names that differ only by capitalization.</p>
970
971
972 <h3><a name="NM_FIELD_NAMING_CONVENTION">Nm: Field names should start with a lower case letter (NM_FIELD_NAMING_CONVENTION)</a></h3>
973
974
975 <p>
976 Names of fields that are not final should be in mixed case with a lowercase first letter and the first letters of subsequent words capitalized.
977 </p>
978
979
980 <h3><a name="NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER">Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER)</a></h3>
981
982
983 <p>The identifier is a word that is reserved as a keyword in later versions of Java, and your code will need to be changed
984 in order to compile it in later versions of Java.</p>
985
986
987
988 <h3><a name="NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER">Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER)</a></h3>
989
990
991 <p>This identifier is used as a keyword in later versions of Java. This code, and
992 any code that references this API,
993 will need to be changed in order to compile it in later versions of Java.</p>
994
995
996
997 <h3><a name="NM_METHOD_NAMING_CONVENTION">Nm: Method names should start with a lower case letter (NM_METHOD_NAMING_CONVENTION)</a></h3>
998
999
1000 <p>
1001 Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
1002 </p>
1003
1004
1005 <h3><a name="NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class names shouldn't shadow simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE)</a></h3>
1006
1007
1008 <p> This class/interface has a simple name that is identical to that of an implemented/extended interface, except
1009 that the interface is in a different package (e.g., <code>alpha.Foo</code> extends <code>beta.Foo</code>).
1010 This can be exceptionally confusing, create lots of situations in which you have to look at import statements
1011 to resolve references and creates many
1012 opportunities to accidently define methods that do not override methods in their superclasses.
1013 </p>
1014
1015
1016 <h3><a name="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class names shouldn't shadow simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS)</a></h3>
1017
1018
1019 <p> This class has a simple name that is identical to that of its superclass, except
1020 that its superclass is in a different package (e.g., <code>alpha.Foo</code> extends <code>beta.Foo</code>).
1021 This can be exceptionally confusing, create lots of situations in which you have to look at import statements
1022 to resolve references and creates many
1023 opportunities to accidently define methods that do not override methods in their superclasses.
1024 </p>
1025
1026
1027 <h3><a name="NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL)</a></h3>
1028
1029
1030 <p> The referenced methods have names that differ only by capitalization.
1031 This is very confusing because if the capitalization were
1032 identical then one of the methods would override the other. From the existence of other methods, it
1033 seems that the existence of both of these methods is intentional, but is sure is confusing.
1034 You should try hard to eliminate one of them, unless you are forced to have both due to frozen APIs.
1035 </p>
1036
1037
1038 <h3><a name="NM_WRONG_PACKAGE_INTENTIONAL">Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE_INTENTIONAL)</a></h3>
1039
1040
1041 <p> The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match
1042 the type of the corresponding parameter in the superclass. For example, if you have:</p>
1043
1044 <blockquote>
1045 <pre>
1046 import alpha.Foo;
1047 public class A {
1048 public int f(Foo x) { return 17; }
1049 }
1050 ----
1051 import beta.Foo;
1052 public class B extends A {
1053 public int f(Foo x) { return 42; }
1054 public int f(alpha.Foo x) { return 27; }
1055 }
1056 </pre>
1057 </blockquote>
1058
1059 <p>The <code>f(Foo)</code> method defined in class <code>B</code> doesn't
1060 override the
1061 <code>f(Foo)</code> method defined in class <code>A</code>, because the argument
1062 types are <code>Foo</code>'s from different packages.
1063 </p>
1064
1065 <p>In this case, the subclass does define a method with a signature identical to the method in the superclass,
1066 so this is presumably understood. However, such methods are exceptionally confusing. You should strongly consider
1067 removing or deprecating the method with the similar but not identical signature.
1068 </p>
1069
1070
1071 <h3><a name="ODR_OPEN_DATABASE_RESOURCE">ODR: Method may fail to close database resource (ODR_OPEN_DATABASE_RESOURCE)</a></h3>
1072
1073
1074 <p> The method creates a database resource (such as a database connection
1075 or row set), does not assign it to any
1076 fields, pass it to other methods, or return it, and does not appear to close
1077 the object on all paths out of the method.&nbsp; Failure to
1078 close database resources on all paths out of a method may
1079 result in poor performance, and could cause the application to
1080 have problems communicating with the database.
1081 </p>
1082
1083
1084 <h3><a name="ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH">ODR: Method may fail to close database resource on exception (ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH)</a></h3>
1085
1086
1087 <p> The method creates a database resource (such as a database connection
1088 or row set), does not assign it to any
1089 fields, pass it to other methods, or return it, and does not appear to close
1090 the object on all exception paths out of the method.&nbsp; Failure to
1091 close database resources on all paths out of a method may
1092 result in poor performance, and could cause the application to
1093 have problems communicating with the database.</p>
1094
1095
1096 <h3><a name="OS_OPEN_STREAM">OS: Method may fail to close stream (OS_OPEN_STREAM)</a></h3>
1097
1098
1099 <p> The method creates an IO stream object, does not assign it to any
1100 fields, pass it to other methods that might close it,
1101 or return it, and does not appear to close
1102 the stream on all paths out of the method.&nbsp; This may result in
1103 a file descriptor leak.&nbsp; It is generally a good
1104 idea to use a <code>finally</code> block to ensure that streams are
1105 closed.</p>
1106
1107
1108 <h3><a name="OS_OPEN_STREAM_EXCEPTION_PATH">OS: Method may fail to close stream on exception (OS_OPEN_STREAM_EXCEPTION_PATH)</a></h3>
1109
1110
1111 <p> The method creates an IO stream object, does not assign it to any
1112 fields, pass it to other methods, or return it, and does not appear to close
1113 it on all possible exception paths out of the method.&nbsp;
1114 This may result in a file descriptor leak.&nbsp; It is generally a good
1115 idea to use a <code>finally</code> block to ensure that streams are
1116 closed.</p>
1117
1118
1119 <h3><a name="PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">PZ: Don't reuse entry objects in iterators (PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS)</a></h3>
1120
1121
1122 <p> The entrySet() method is allowed to return a view of the
1123 underlying Map in which an Iterator and Map.Entry. This clever
1124 idea was used in several Map implementations, but introduces the possibility
1125 of nasty coding mistakes. If a map <code>m</code> returns
1126 such an iterator for an entrySet, then
1127 <code>c.addAll(m.entrySet())</code> will go badly wrong. All of
1128 the Map implementations in OpenJDK 1.7 have been rewritten to avoid this,
1129 you should to.
1130 </p>
1131
1132
1133 <h3><a name="RC_REF_COMPARISON_BAD_PRACTICE">RC: Suspicious reference comparison to constant (RC_REF_COMPARISON_BAD_PRACTICE)</a></h3>
1134
1135
1136 <p> This method compares a reference value to a constant using the == or != operator,
1137 where the correct way to compare instances of this type is generally
1138 with the equals() method.
1139 It is possible to create distinct instances that are equal but do not compare as == since
1140 they are different objects.
1141 Examples of classes which should generally
1142 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p>
1143
1144
1145 <h3><a name="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN">RC: Suspicious reference comparison of Boolean values (RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN)</a></h3>
1146
1147
1148 <p> This method compares two Boolean values using the == or != operator.
1149 Normally, there are only two Boolean values (Boolean.TRUE and Boolean.FALSE),
1150 but it is possible to create other Boolean objects using the <code>new Boolean(b)</code>
1151 constructor. It is best to avoid such objects, but if they do exist,
1152 then checking Boolean objects for equality using == or != will give results
1153 than are different than you would get using <code>.equals(...)</code>
1154 </p>
1155
1156
1157 <h3><a name="RR_NOT_CHECKED">RR: Method ignores results of InputStream.read() (RR_NOT_CHECKED)</a></h3>
1158
1159
1160 <p> This method ignores the return value of one of the variants of
1161 <code>java.io.InputStream.read()</code> which can return multiple bytes.&nbsp;
1162 If the return value is not checked, the caller will not be able to correctly
1163 handle the case where fewer bytes were read than the caller requested.&nbsp;
1164 This is a particularly insidious kind of bug, because in many programs,
1165 reads from input streams usually do read the full amount of data requested,
1166 causing the program to fail only sporadically.</p>
1167
1168
1169 <h3><a name="SR_NOT_CHECKED">RR: Method ignores results of InputStream.skip() (SR_NOT_CHECKED)</a></h3>
1170
1171
1172 <p> This method ignores the return value of
1173 <code>java.io.InputStream.skip()</code> which can skip multiple bytes.&nbsp;
1174 If the return value is not checked, the caller will not be able to correctly
1175 handle the case where fewer bytes were skipped than the caller requested.&nbsp;
1176 This is a particularly insidious kind of bug, because in many programs,
1177 skips from input streams usually do skip the full amount of data requested,
1178 causing the program to fail only sporadically. With Buffered streams, however,
1179 skip() will only skip data in the buffer, and will routinely fail to skip the
1180 requested number of bytes.</p>
1181
1182
1183 <h3><a name="RV_NEGATING_RESULT_OF_COMPARETO">RV: Negating the result of compareTo()/compare() (RV_NEGATING_RESULT_OF_COMPARETO)</a></h3>
1184
1185
1186 <p> This code negatives the return value of a compareTo or compare method.
1187 This is a questionable or bad programming practice, since if the return
1188 value is Integer.MIN_VALUE, negating the return value won't
1189 negate the sign of the result. You can achieve the same intended result
1190 by reversing the order of the operands rather than by negating the results.
1191 </p>
1192
1193
1194 <h3><a name="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE">RV: Method ignores exceptional return value (RV_RETURN_VALUE_IGNORED_BAD_PRACTICE)</a></h3>
1195
1196
1197 <p> This method returns a value that is not checked. The return value should be checked
1198 since it can indicate an unusual or unexpected function execution. For
1199 example, the <code>File.delete()</code> method returns false
1200 if the file could not be successfully deleted (rather than
1201 throwing an Exception).
1202 If you don't check the result, you won't notice if the method invocation
1203 signals unexpected behavior by returning an atypical return value.
1204 </p>
1205
1206
1207 <h3><a name="SI_INSTANCE_BEFORE_FINALS_ASSIGNED">SI: Static initializer creates instance before all static final fields assigned (SI_INSTANCE_BEFORE_FINALS_ASSIGNED)</a></h3>
1208
1209
1210 <p> The class's static initializer creates an instance of the class
1211 before all of the static final fields are assigned.</p>
1212
1213
1214 <h3><a name="SW_SWING_METHODS_INVOKED_IN_SWING_THREAD">SW: Certain swing methods needs to be invoked in Swing thread (SW_SWING_METHODS_INVOKED_IN_SWING_THREAD)</a></h3>
1215
1216
1217 <p>(<a href="http://web.archive.org/web/20090526170426/http://java.sun.com/developer/JDCTechTips/2003/tt1208.html">From JDC Tech Tip</a>): The Swing methods
1218 show(), setVisible(), and pack() will create the associated peer for the frame.
1219 With the creation of the peer, the system creates the event dispatch thread.
1220 This makes things problematic because the event dispatch thread could be notifying
1221 listeners while pack and validate are still processing. This situation could result in
1222 two threads going through the Swing component-based GUI -- it's a serious flaw that
1223 could result in deadlocks or other related threading issues. A pack call causes
1224 components to be realized. As they are being realized (that is, not necessarily
1225 visible), they could trigger listener notification on the event dispatch thread.</p>
1226
1227
1228
1229 <h3><a name="SE_BAD_FIELD">Se: Non-transient non-serializable instance field in serializable class (SE_BAD_FIELD)</a></h3>
1230
1231
1232 <p> This Serializable class defines a non-primitive instance field which is neither transient,
1233 Serializable, or <code>java.lang.Object</code>, and does not appear to implement
1234 the <code>Externalizable</code> interface or the
1235 <code>readObject()</code> and <code>writeObject()</code> methods.&nbsp;
1236 Objects of this class will not be deserialized correctly if a non-Serializable
1237 object is stored in this field.</p>
1238
1239
1240 <h3><a name="SE_BAD_FIELD_INNER_CLASS">Se: Non-serializable class has a serializable inner class (SE_BAD_FIELD_INNER_CLASS)</a></h3>
1241
1242
1243 <p> This Serializable class is an inner class of a non-serializable class.
1244 Thus, attempts to serialize it will also attempt to associate instance of the outer
1245 class with which it is associated, leading to a runtime error.
1246 </p>
1247 <p>If possible, making the inner class a static inner class should solve the
1248 problem. Making the outer class serializable might also work, but that would
1249 mean serializing an instance of the inner class would always also serialize the instance
1250 of the outer class, which it often not what you really want.
1251
1252
1253 <h3><a name="SE_BAD_FIELD_STORE">Se: Non-serializable value stored into instance field of a serializable class (SE_BAD_FIELD_STORE)</a></h3>
1254
1255
1256 <p> A non-serializable value is stored into a non-transient field
1257 of a serializable class.</p>
1258
1259
1260 <h3><a name="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE">Se: Comparator doesn't implement Serializable (SE_COMPARATOR_SHOULD_BE_SERIALIZABLE)</a></h3>
1261
1262
1263 <p> This class implements the <code>Comparator</code> interface. You
1264 should consider whether or not it should also implement the <code>Serializable</code>
1265 interface. If a comparator is used to construct an ordered collection
1266 such as a <code>TreeMap</code>, then the <code>TreeMap</code>
1267 will be serializable only if the comparator is also serializable.
1268 As most comparators have little or no state, making them serializable
1269 is generally easy and good defensive programming.
1270 </p>
1271
1272
1273 <h3><a name="SE_INNER_CLASS">Se: Serializable inner class (SE_INNER_CLASS)</a></h3>
1274
1275
1276 <p> This Serializable class is an inner class. Any attempt to serialize
1277 it will also serialize the associated outer instance. The outer instance is serializable,
1278 so this won't fail, but it might serialize a lot more data than intended.
1279 If possible, making the inner class a static inner class (also known as a nested class) should solve the
1280 problem.
1281
1282
1283 <h3><a name="SE_NONFINAL_SERIALVERSIONID">Se: serialVersionUID isn't final (SE_NONFINAL_SERIALVERSIONID)</a></h3>
1284
1285
1286 <p> This class defines a <code>serialVersionUID</code> field that is not final.&nbsp;
1287 The field should be made final
1288 if it is intended to specify
1289 the version UID for purposes of serialization.</p>
1290
1291
1292 <h3><a name="SE_NONLONG_SERIALVERSIONID">Se: serialVersionUID isn't long (SE_NONLONG_SERIALVERSIONID)</a></h3>
1293
1294
1295 <p> This class defines a <code>serialVersionUID</code> field that is not long.&nbsp;
1296 The field should be made long
1297 if it is intended to specify
1298 the version UID for purposes of serialization.</p>
1299
1300
1301 <h3><a name="SE_NONSTATIC_SERIALVERSIONID">Se: serialVersionUID isn't static (SE_NONSTATIC_SERIALVERSIONID)</a></h3>
1302
1303
1304 <p> This class defines a <code>serialVersionUID</code> field that is not static.&nbsp;
1305 The field should be made static
1306 if it is intended to specify
1307 the version UID for purposes of serialization.</p>
1308
1309
1310 <h3><a name="SE_NO_SUITABLE_CONSTRUCTOR">Se: Class is Serializable but its superclass doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR)</a></h3>
1311
1312
1313 <p> This class implements the <code>Serializable</code> interface
1314 and its superclass does not. When such an object is deserialized,
1315 the fields of the superclass need to be initialized by
1316 invoking the void constructor of the superclass.
1317 Since the superclass does not have one,
1318 serialization and deserialization will fail at runtime.</p>
1319
1320
1321 <h3><a name="SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION">Se: Class is Externalizable but doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION)</a></h3>
1322
1323
1324 <p> This class implements the <code>Externalizable</code> interface, but does
1325 not define a void constructor. When Externalizable objects are deserialized,
1326 they first need to be constructed by invoking the void
1327 constructor. Since this class does not have one,
1328 serialization and deserialization will fail at runtime.</p>
1329
1330
1331 <h3><a name="SE_READ_RESOLVE_MUST_RETURN_OBJECT">Se: The readResolve method must be declared with a return type of Object. (SE_READ_RESOLVE_MUST_RETURN_OBJECT)</a></h3>
1332
1333
1334 <p> In order for the readResolve method to be recognized by the serialization
1335 mechanism, it must be declared to have a return type of Object.
1336 </p>
1337
1338
1339 <h3><a name="SE_TRANSIENT_FIELD_NOT_RESTORED">Se: Transient field that isn't set by deserialization. (SE_TRANSIENT_FIELD_NOT_RESTORED)</a></h3>
1340
1341
1342 <p> This class contains a field that is updated at multiple places in the class, thus it seems to be part of the state of the class. However, since the field is marked as transient and not set in readObject or readResolve, it will contain the default value in any
1343 deserialized instance of the class.
1344 </p>
1345
1346
1347 <h3><a name="SE_NO_SERIALVERSIONID">SnVI: Class is Serializable, but doesn't define serialVersionUID (SE_NO_SERIALVERSIONID)</a></h3>
1348
1349
1350 <p> This class implements the <code>Serializable</code> interface, but does
1351 not define a <code>serialVersionUID</code> field.&nbsp;
1352 A change as simple as adding a reference to a .class object
1353 will add synthetic fields to the class,
1354 which will unfortunately change the implicit
1355 serialVersionUID (e.g., adding a reference to <code>String.class</code>
1356 will generate a static field <code>class$java$lang$String</code>).
1357 Also, different source code to bytecode compilers may use different
1358 naming conventions for synthetic variables generated for
1359 references to class objects or inner classes.
1360 To ensure interoperability of Serializable across versions,
1361 consider adding an explicit serialVersionUID.</p>
1362
1363
1364 <h3><a name="UI_INHERITANCE_UNSAFE_GETRESOURCE">UI: Usage of GetResource may be unsafe if class is extended (UI_INHERITANCE_UNSAFE_GETRESOURCE)</a></h3>
1365
1366
1367 <p>Calling <code>this.getClass().getResource(...)</code> could give
1368 results other than expected if this class is extended by a class in
1369 another package.</p>
1370
1371
1372 <h3><a name="BC_IMPOSSIBLE_CAST">BC: Impossible cast (BC_IMPOSSIBLE_CAST)</a></h3>
1373
1374
1375 <p>
1376 This cast will always throw a ClassCastException.
1377 FindBugs tracks type information from instanceof checks,
1378 and also uses more precise information about the types
1379 of values returned from methods and loaded from fields.
1380 Thus, it may have more precise information that just
1381 the declared type of a variable, and can use this to determine
1382 that a cast will always throw an exception at runtime.
1383
1384 </p>
1385
1386
1387 <h3><a name="BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downcast (BC_IMPOSSIBLE_DOWNCAST)</a></h3>
1388
1389
1390 <p>
1391 This cast will always throw a ClassCastException.
1392 The analysis believes it knows
1393 the precise type of the value being cast, and the attempt to
1394 downcast it to a subtype will always fail by throwing a ClassCastException.
1395 </p>
1396
1397
1398 <h3><a name="BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impossible downcast of toArray() result (BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY)</a></h3>
1399
1400
1401 <p>
1402 This code is casting the result of calling <code>toArray()</code> on a collection
1403 to a type more specific than <code>Object[]</code>, as in:</p>
1404 <pre>
1405 String[] getAsArray(Collection&lt;String&gt; c) {
1406 return (String[]) c.toArray();
1407 }
1408 </pre>
1409 <p>This will usually fail by throwing a ClassCastException. The <code>toArray()</code>
1410 of almost all collections return an <code>Object[]</code>. They can't really do anything else,
1411 since the Collection object has no reference to the declared generic type of the collection.
1412 <p>The correct way to do get an array of a specific type from a collection is to use
1413 <code>c.toArray(new String[]);</code>
1414 or <code>c.toArray(new String[c.size()]);</code> (the latter is slightly more efficient).
1415 <p>There is one common/known exception exception to this. The <code>toArray()</code>
1416 method of lists returned by <code>Arrays.asList(...)</code> will return a covariantly
1417 typed array. For example, <code>Arrays.asArray(new String[] { "a" }).toArray()</code>
1418 will return a <code>String []</code>. FindBugs attempts to detect and suppress
1419 such cases, but may miss some.
1420 </p>
1421
1422
1423 <h3><a name="BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof will always return false (BC_IMPOSSIBLE_INSTANCEOF)</a></h3>
1424
1425
1426 <p>
1427 This instanceof test will always return false. Although this is safe, make sure it isn't
1428 an indication of some misunderstanding or some other logic error.
1429 </p>
1430
1431
1432 <h3><a name="BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of signed byte value (BIT_ADD_OF_SIGNED_BYTE)</a></h3>
1433
1434
1435 <p> Adds a byte value and a value which is known to have the 8 lower bits clear.
1436 Values loaded from a byte array are sign extended to 32 bits
1437 before any any bitwise operations are performed on the value.
1438 Thus, if <code>b[0]</code> contains the value <code>0xff</code>, and
1439 <code>x</code> is initially 0, then the code
1440 <code>((x &lt;&lt; 8) + b[0])</code> will sign extend <code>0xff</code>
1441 to get <code>0xffffffff</code>, and thus give the value
1442 <code>0xffffffff</code> as the result.
1443 </p>
1444
1445 <p>In particular, the following code for packing a byte array into an int is badly wrong: </p>
1446 <pre>
1447 int result = 0;
1448 for(int i = 0; i &lt; 4; i++)
1449 result = ((result &lt;&lt; 8) + b[i]);
1450 </pre>
1451
1452 <p>The following idiom will work instead: </p>
1453 <pre>
1454 int result = 0;
1455 for(int i = 0; i &lt; 4; i++)
1456 result = ((result &lt;&lt; 8) + (b[i] &amp; 0xff));
1457 </pre>
1458
1459
1460
1461 <h3><a name="BIT_AND">BIT: Incompatible bit masks (BIT_AND)</a></h3>
1462
1463
1464 <p> This method compares an expression of the form (e &amp; C) to D,
1465 which will always compare unequal
1466 due to the specific values of constants C and D.
1467 This may indicate a logic error or typo.</p>
1468
1469
1470 <h3><a name="BIT_AND_ZZ">BIT: Check to see if ((...) & 0) == 0 (BIT_AND_ZZ)</a></h3>
1471
1472
1473 <p> This method compares an expression of the form (e &amp; 0) to 0,
1474 which will always compare equal.
1475 This may indicate a logic error or typo.</p>
1476
1477
1478 <h3><a name="BIT_IOR">BIT: Incompatible bit masks (BIT_IOR)</a></h3>
1479
1480
1481 <p> This method compares an expression of the form (e | C) to D.
1482 which will always compare unequal
1483 due to the specific values of constants C and D.
1484 This may indicate a logic error or typo.</p>
1485
1486 <p> Typically, this bug occurs because the code wants to perform
1487 a membership test in a bit set, but uses the bitwise OR
1488 operator ("|") instead of bitwise AND ("&amp;").</p>
1489
1490
1491 <h3><a name="BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of signed byte value (BIT_IOR_OF_SIGNED_BYTE)</a></h3>
1492
1493
1494 <p> Loads a byte value (e.g., a value loaded from a byte array or returned by a method
1495 with return type byte) and performs a bitwise OR with
1496 that value. Byte values are sign extended to 32 bits
1497 before any any bitwise operations are performed on the value.
1498 Thus, if <code>b[0]</code> contains the value <code>0xff</code>, and
1499 <code>x</code> is initially 0, then the code
1500 <code>((x &lt;&lt; 8) | b[0])</code> will sign extend <code>0xff</code>
1501 to get <code>0xffffffff</code>, and thus give the value
1502 <code>0xffffffff</code> as the result.
1503 </p>
1504
1505 <p>In particular, the following code for packing a byte array into an int is badly wrong: </p>
1506 <pre>
1507 int result = 0;
1508 for(int i = 0; i &lt; 4; i++)
1509 result = ((result &lt;&lt; 8) | b[i]);
1510 </pre>
1511
1512 <p>The following idiom will work instead: </p>
1513 <pre>
1514 int result = 0;
1515 for(int i = 0; i &lt; 4; i++)
1516 result = ((result &lt;&lt; 8) | (b[i] &amp; 0xff));
1517 </pre>
1518
1519
1520
1521 <h3><a name="BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK_HIGH_BIT)</a></h3>
1522
1523
1524 <p> This method compares an expression such as</p>
1525 <pre>((event.detail &amp; SWT.SELECTED) &gt; 0)</pre>.
1526 <p>Using bit arithmetic and then comparing with the greater than operator can
1527 lead to unexpected results (of course depending on the value of
1528 SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate
1529 for a bug. Even when SWT.SELECTED is not negative, it seems good practice
1530 to use '!= 0' instead of '&gt; 0'.
1531 </p>
1532 <p>
1533 <em>Boris Bokowski</em>
1534 </p>
1535
1536
1537 <h3><a name="BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class overrides a method implemented in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER)</a></h3>
1538
1539
1540 <p> This method overrides a method found in a parent class, where that class is an Adapter that implements
1541 a listener defined in the java.awt.event or javax.swing.event package. As a result, this method will not
1542 get called when the event occurs.</p>
1543
1544
1545 <h3><a name="ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int shifted by an amount not in the range -31..31 (ICAST_BAD_SHIFT_AMOUNT)</a></h3>
1546
1547
1548 <p>
1549 The code performs shift of a 32 bit int by a constant amount outside
1550 the range -31..31.
1551 The effect of this is to use the lower 5 bits of the integer
1552 value to decide how much to shift by (e.g., shifting by 40 bits is the same as shifting by 8 bits,
1553 and shifting by 32 bits is the same as shifting by zero bits). This probably isn't what was expected,
1554 and it is at least confusing.
1555 </p>
1556
1557
1558 <h3><a name="BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">Bx: Primitive value is unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR)</a></h3>
1559
1560
1561 <p>A wrapped primitive value is unboxed and converted to another primitive type as part of the
1562 evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> operator). The
1563 semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrapped
1564 numeric values, the values are unboxed and converted/coerced to their common type (e.g,
1565 if <code>e1</code> is of type <code>Integer</code>
1566 and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unboxed,
1567 converted to a floating point value, and boxed. See JLS Section 15.25.
1568 </p>
1569
1570
1571 <h3><a name="CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns Integer.MIN_VALUE (CO_COMPARETO_RESULTS_MIN_VALUE)</a></h3>
1572
1573
1574 <p> In some situation, this compareTo or compare method returns
1575 the constant Integer.MIN_VALUE, which is an exceptionally bad practice.
1576 The only thing that matters about the return value of compareTo is the sign of the result.
1577 But people will sometimes negate the return value of compareTo, expecting that this will negate
1578 the sign of the result. And it will, except in the case where the value returned is Integer.MIN_VALUE.
1579 So just return -1 rather than Integer.MIN_VALUE.
1580
1581
1582 <h3><a name="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in return statement (DLS_DEAD_LOCAL_INCREMENT_IN_RETURN)</a></h3>
1583
1584
1585 <p>This statement has a return such as <code>return x++;</code>.
1586 A postfix increment/decrement does not impact the value of the expression,
1587 so this increment/decrement has no effect.
1588 Please verify that this statement does the right thing.
1589 </p>
1590
1591
1592 <h3><a name="DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead store of class literal (DLS_DEAD_STORE_OF_CLASS_LITERAL)</a></h3>
1593
1594
1595 <p>
1596 This instruction assigns a class literal to a variable and then never uses it.
1597 <a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">The behavior of this differs in Java 1.4 and in Java 5.</a>
1598 In Java 1.4 and earlier, a reference to <code>Foo.class</code> would force the static initializer
1599 for <code>Foo</code> to be executed, if it has not been executed already.
1600 In Java 5 and later, it does not.
1601 </p>
1602 <p>See Sun's <a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">article on Java SE compatibility</a>
1603 for more details and examples, and suggestions on how to force class initialization in Java 5.
1604 </p>
1605
1606
1607 <h3><a name="DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten increment (DLS_OVERWRITTEN_INCREMENT)</a></h3>
1608
1609
1610 <p>
1611 The code performs an increment operation (e.g., <code>i++</code>) and then
1612 immediately overwrites it. For example, <code>i = i++</code> immediately
1613 overwrites the incremented value with the original value.
1614 </p>
1615
1616
1617 <h3><a name="DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed method arguments (DMI_ARGUMENTS_WRONG_ORDER)</a></h3>
1618
1619
1620 <p> The arguments to this method call seem to be in the wrong order.
1621 For example, a call <code>Preconditions.checkNotNull("message", message)</code>
1622 has reserved arguments: the value to be checked is the first argument.
1623 </p>
1624
1625
1626 <h3><a name="DMI_BAD_MONTH">DMI: Bad constant value for month (DMI_BAD_MONTH)</a></h3>
1627
1628
1629 <p>
1630 This code passes a constant month
1631 value outside the expected range of 0..11 to a method.
1632 </p>
1633
1634
1635 <h3><a name="DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI: BigDecimal constructed from double that isn't represented precisely (DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE)</a></h3>
1636
1637
1638 <p>
1639 This code creates a BigDecimal from a double value that doesn't translate well to a
1640 decimal number.
1641 For example, one might assume that writing new BigDecimal(0.1) in Java creates a BigDecimal which is exactly equal to 0.1 (an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625.
1642 You probably want to use the BigDecimal.valueOf(double d) method, which uses the String representation
1643 of the double to create the BigDecimal (e.g., BigDecimal.valueOf(0.1) gives 0.1).
1644 </p>
1645
1646
1647
1648 <h3><a name="DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT)</a></h3>
1649
1650
1651 <p>
1652 The hasNext() method invokes the next() method. This is almost certainly wrong,
1653 since the hasNext() method is not supposed to change the state of the iterator,
1654 and the next method is supposed to change the state of the iterator.
1655 </p>
1656
1657
1658 <h3><a name="DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES">DMI: Collections should not contain themselves (DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES)</a></h3>
1659
1660
1661 <p> This call to a generic collection's method would only make sense if a collection contained
1662 itself (e.g., if <code>s.contains(s)</code> were true). This is unlikely to be true and would cause
1663 problems if it were true (such as the computation of the hash code resulting in infinite recursion).
1664 It is likely that the wrong value is being passed as a parameter.
1665 </p>
1666
1667
1668 <h3><a name="DMI_DOH">DMI: D'oh! A nonsensical method invocation (DMI_DOH)</a></h3>
1669
1670
1671 <p>
1672 This partical method invocation doesn't make sense, for reasons that should be apparent from inspection.
1673 </p>
1674
1675
1676
1677 <h3><a name="DMI_INVOKING_HASHCODE_ON_ARRAY">DMI: Invocation of hashCode on an array (DMI_INVOKING_HASHCODE_ON_ARRAY)</a></h3>
1678
1679
1680 <p>
1681 The code invokes hashCode on an array. Calling hashCode on
1682 an array returns the same value as System.identityHashCode, and ingores
1683 the contents and length of the array. If you need a hashCode that
1684 depends on the contents of an array <code>a</code>,
1685 use <code>java.util.Arrays.hashCode(a)</code>.
1686
1687 </p>
1688
1689
1690 <h3><a name="DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">DMI: Double.longBitsToDouble invoked on an int (DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT)</a></h3>
1691
1692
1693 <p> The Double.longBitsToDouble method is invoked, but a 32 bit int value is passed
1694 as an argument. This almostly certainly is not intended and is unlikely
1695 to give the intended result.
1696 </p>
1697
1698
1699 <h3><a name="DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuous call to collections (DMI_VACUOUS_SELF_COLLECTION_CALL)</a></h3>
1700
1701
1702 <p> This call doesn't make sense. For any collection <code>c</code>, calling <code>c.containsAll(c)</code> should
1703 always be true, and <code>c.retainAll(c)</code> should have no effect.
1704 </p>
1705
1706
1707 <h3><a name="DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION">Dm: Can't use reflection to check for presence of annotation without runtime retention (DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION)</a></h3>
1708
1709
1710 <p> Unless an annotation has itself been annotated with @Retention(RetentionPolicy.RUNTIME), the annotation can't be observed using reflection
1711 (e.g., by using the isAnnotationPresent method).
1712 .</p>
1713
1714
1715 <h3><a name="DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR">Dm: Futile attempt to change max pool size of ScheduledThreadPoolExecutor (DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR)</a></h3>
1716
1717
1718 <p>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html">Javadoc</a>)
1719 While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect.
1720 </p>
1721
1722
1723
1724 <h3><a name="DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS">Dm: Creation of ScheduledThreadPoolExecutor with zero core threads (DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS)</a></h3>
1725
1726
1727 <p>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html#ScheduledThreadPoolExecutor(int)">Javadoc</a>)
1728 A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored.
1729 </p>
1730
1731
1732
1733 <h3><a name="DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Useless/vacuous call to EasyMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD)</a></h3>
1734
1735
1736 <p>This call doesn't pass any objects to the EasyMock method, so the call doesn't do anything.
1737 </p>
1738
1739
1740
1741 <h3><a name="EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonarray (EC_ARRAY_AND_NONARRAY)</a></h3>
1742
1743
1744 <p>
1745 This method invokes the .equals(Object o) to compare an array and a reference that doesn't seem
1746 to be an array. If things being compared are of different types, they are guaranteed to be unequal
1747 and the comparison is almost certainly an error. Even if they are both arrays, the equals method
1748 on arrays only determines of the two arrays are the same object.
1749 To compare the
1750 contents of the arrays, use java.util.Arrays.equals(Object[], Object[]).
1751 </p>
1752
1753
1754 <h3><a name="EC_BAD_ARRAY_COMPARE">EC: Invocation of equals() on an array, which is equivalent to == (EC_BAD_ARRAY_COMPARE)</a></h3>
1755
1756
1757 <p>
1758 This method invokes the .equals(Object o) method on an array. Since arrays do not override the equals
1759 method of Object, calling equals on an array is the same as comparing their addresses. To compare the
1760 contents of the arrays, use <code>java.util.Arrays.equals(Object[], Object[])</code>.
1761 To compare the addresses of the arrays, it would be
1762 less confusing to explicitly check pointer equality using <code>==</code>.
1763 </p>
1764
1765
1766 <h3><a name="EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(...) used to compare incompatible arrays (EC_INCOMPATIBLE_ARRAY_COMPARE)</a></h3>
1767
1768
1769 <p>
1770 This method invokes the .equals(Object o) to compare two arrays, but the arrays of
1771 of incompatible types (e.g., String[] and StringBuffer[], or String[] and int[]).
1772 They will never be equal. In addition, when equals(...) is used to compare arrays it
1773 only checks to see if they are the same array, and ignores the contents of the arrays.
1774 </p>
1775
1776
1777 <h3><a name="EC_NULL_ARG">EC: Call to equals(null) (EC_NULL_ARG)</a></h3>
1778
1779
1780 <p> This method calls equals(Object), passing a null value as
1781 the argument. According to the contract of the equals() method,
1782 this call should always return <code>false</code>.</p>
1783
1784
1785 <h3><a name="EC_UNRELATED_CLASS_AND_INTERFACE">EC: Call to equals() comparing unrelated class and interface (EC_UNRELATED_CLASS_AND_INTERFACE)</a></h3>
1786
1787
1788 <p>
1789 This method calls equals(Object) on two references, one of which is a class
1790 and the other an interface, where neither the class nor any of its
1791 non-abstract subclasses implement the interface.
1792 Therefore, the objects being compared
1793 are unlikely to be members of the same class at runtime
1794 (unless some application classes were not analyzed, or dynamic class
1795 loading can occur at runtime).
1796 According to the contract of equals(),
1797 objects of different
1798 classes should always compare as unequal; therefore, according to the
1799 contract defined by java.lang.Object.equals(Object),
1800 the result of this comparison will always be false at runtime.
1801 </p>
1802
1803
1804 <h3><a name="EC_UNRELATED_INTERFACES">EC: Call to equals() comparing different interface types (EC_UNRELATED_INTERFACES)</a></h3>
1805
1806
1807 <p> This method calls equals(Object) on two references of unrelated
1808 interface types, where neither is a subtype of the other,
1809 and there are no known non-abstract classes which implement both interfaces.
1810 Therefore, the objects being compared
1811 are unlikely to be members of the same class at runtime
1812 (unless some application classes were not analyzed, or dynamic class
1813 loading can occur at runtime).
1814 According to the contract of equals(),
1815 objects of different
1816 classes should always compare as unequal; therefore, according to the
1817 contract defined by java.lang.Object.equals(Object),
1818 the result of this comparison will always be false at runtime.
1819 </p>
1820
1821
1822 <h3><a name="EC_UNRELATED_TYPES">EC: Call to equals() comparing different types (EC_UNRELATED_TYPES)</a></h3>
1823
1824
1825 <p> This method calls equals(Object) on two references of different
1826 class types with no common subclasses.
1827 Therefore, the objects being compared
1828 are unlikely to be members of the same class at runtime
1829 (unless some application classes were not analyzed, or dynamic class
1830 loading can occur at runtime).
1831 According to the contract of equals(),
1832 objects of different
1833 classes should always compare as unequal; therefore, according to the
1834 contract defined by java.lang.Object.equals(Object),
1835 the result of this comparison will always be false at runtime.
1836 </p>
1837
1838
1839 <h3><a name="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">EC: Using pointer equality to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY)</a></h3>
1840
1841
1842 <p> This method uses using pointer equality to compare two references that seem to be of
1843 different types. The result of this comparison will always be false at runtime.
1844 </p>
1845
1846
1847 <h3><a name="EQ_ALWAYS_FALSE">Eq: equals method always returns false (EQ_ALWAYS_FALSE)</a></h3>
1848
1849
1850 <p> This class defines an equals method that always returns false. This means that an object is not equal to itself, and it is impossible to create useful Maps or Sets of this class. More fundamentally, it means
1851 that equals is not reflexive, one of the requirements of the equals method.</p>
1852 <p>The likely intended semantics are object identity: that an object is equal to itself. This is the behavior inherited from class <code>Object</code>. If you need to override an equals inherited from a different
1853 superclass, you can use use:</p>
1854 <pre>
1855 public boolean equals(Object o) { return this == o; }
1856 </pre>
1857
1858
1859 <h3><a name="EQ_ALWAYS_TRUE">Eq: equals method always returns true (EQ_ALWAYS_TRUE)</a></h3>
1860
1861
1862 <p> This class defines an equals method that always returns true. This is imaginative, but not very smart.
1863 Plus, it means that the equals method is not symmetric.
1864 </p>
1865
1866
1867 <h3><a name="EQ_COMPARING_CLASS_NAMES">Eq: equals method compares class names rather than class objects (EQ_COMPARING_CLASS_NAMES)</a></h3>
1868
1869
1870 <p> This method checks to see if two objects are the same class by checking to see if the names
1871 of their classes are equal. You can have different classes with the same name if they are loaded by
1872 different class loaders. Just check to see if the class objects are the same.
1873 </p>
1874
1875
1876 <h3><a name="EQ_DONT_DEFINE_EQUALS_FOR_ENUM">Eq: Covariant equals() method defined for enum (EQ_DONT_DEFINE_EQUALS_FOR_ENUM)</a></h3>
1877
1878
1879 <p> This class defines an enumeration, and equality on enumerations are defined
1880 using object identity. Defining a covariant equals method for an enumeration
1881 value is exceptionally bad practice, since it would likely result
1882 in having two different enumeration values that compare as equals using
1883 the covariant enum method, and as not equal when compared normally.
1884 Don't do it.
1885 </p>
1886
1887
1888 <h3><a name="EQ_OTHER_NO_OBJECT">Eq: equals() method defined that doesn't override equals(Object) (EQ_OTHER_NO_OBJECT)</a></h3>
1889
1890
1891 <p> This class defines an <code>equals()</code>
1892 method, that doesn't override the normal <code>equals(Object)</code> method
1893 defined in the base <code>java.lang.Object</code> class.&nbsp; Instead, it
1894 inherits an <code>equals(Object)</code> method from a superclass.
1895 The class should probably define a <code>boolean equals(Object)</code> method.
1896 </p>
1897
1898
1899 <h3><a name="EQ_OTHER_USE_OBJECT">Eq: equals() method defined that doesn't override Object.equals(Object) (EQ_OTHER_USE_OBJECT)</a></h3>
1900
1901
1902 <p> This class defines an <code>equals()</code>
1903 method, that doesn't override the normal <code>equals(Object)</code> method
1904 defined in the base <code>java.lang.Object</code> class.&nbsp;
1905 The class should probably define a <code>boolean equals(Object)</code> method.
1906 </p>
1907
1908
1909 <h3><a name="EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC">Eq: equals method overrides equals in superclass and may not be symmetric (EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC)</a></h3>
1910
1911
1912 <p> This class defines an equals method that overrides an equals method in a superclass. Both equals methods
1913 methods use <code>instanceof</code> in the determination of whether two objects are equal. This is fraught with peril,
1914 since it is important that the equals method is symmetrical (in other words, <code>a.equals(b) == b.equals(a)</code>).
1915 If B is a subtype of A, and A's equals method checks that the argument is an instanceof A, and B's equals method
1916 checks that the argument is an instanceof B, it is quite likely that the equivalence relation defined by these
1917 methods is not symmetric.
1918 </p>
1919
1920
1921 <h3><a name="EQ_SELF_USE_OBJECT">Eq: Covariant equals() method defined, Object.equals(Object) inherited (EQ_SELF_USE_OBJECT)</a></h3>
1922
1923
1924 <p> This class defines a covariant version of the <code>equals()</code>
1925 method, but inherits the normal <code>equals(Object)</code> method
1926 defined in the base <code>java.lang.Object</code> class.&nbsp;
1927 The class should probably define a <code>boolean equals(Object)</code> method.
1928 </p>
1929
1930
1931 <h3><a name="FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER">FE: Doomed test for equality to NaN (FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER)</a></h3>
1932
1933
1934 <p>
1935 This code checks to see if a floating point value is equal to the special
1936 Not A Number value (e.g., <code>if (x == Double.NaN)</code>). However,
1937 because of the special semantics of <code>NaN</code>, no value
1938 is equal to <code>Nan</code>, including <code>NaN</code>. Thus,
1939 <code>x == Double.NaN</code> always evaluates to false.
1940
1941 To check to see if a value contained in <code>x</code>
1942 is the special Not A Number value, use
1943 <code>Double.isNaN(x)</code> (or <code>Float.isNaN(x)</code> if
1944 <code>x</code> is floating point precision).
1945 </p>
1946
1947
1948 <h3><a name="VA_FORMAT_STRING_BAD_ARGUMENT">FS: Format string placeholder incompatible with passed argument (VA_FORMAT_STRING_BAD_ARGUMENT)</a></h3>
1949
1950
1951 <p>
1952 The format string placeholder is incompatible with the corresponding
1953 argument. For example,
1954 <code>
1955 System.out.println("%d\n", "hello");
1956 </code>
1957 <p>The %d placeholder requires a numeric argument, but a string value is
1958 passed instead.
1959 A runtime exception will occur when
1960 this statement is executed.
1961 </p>
1962
1963
1964 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION">FS: The type of a supplied argument doesn't match format specifier (VA_FORMAT_STRING_BAD_CONVERSION)</a></h3>
1965
1966
1967 <p>
1968 One of the arguments is uncompatible with the corresponding format string specifier.
1969 As a result, this will generate a runtime exception when executed.
1970 For example, <code>String.format("%d", "1")</code> will generate an exception, since
1971 the String "1" is incompatible with the format specifier %d.
1972 </p>
1973
1974
1975 <h3><a name="VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED">FS: MessageFormat supplied where printf style format expected (VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED)</a></h3>
1976
1977
1978 <p>
1979 A method is called that expects a Java printf format string and a list of arguments.
1980 However, the format string doesn't contain any format specifiers (e.g., %s) but
1981 does contain message format elements (e.g., {0}). It is likely
1982 that the code is supplying a MessageFormat string when a printf-style format string
1983 is required. At runtime, all of the arguments will be ignored
1984 and the format string will be returned exactly as provided without any formatting.
1985 </p>
1986
1987
1988 <h3><a name="VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED">FS: More arguments are passed than are actually used in the format string (VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED)</a></h3>
1989
1990
1991 <p>
1992 A format-string method with a variable number of arguments is called,
1993 but more arguments are passed than are actually used by the format string.
1994 This won't cause a runtime exception, but the code may be silently omitting
1995 information that was intended to be included in the formatted string.
1996 </p>
1997
1998
1999 <h3><a name="VA_FORMAT_STRING_ILLEGAL">FS: Illegal format string (VA_FORMAT_STRING_ILLEGAL)</a></h3>
2000
2001
2002 <p>
2003 The format string is syntactically invalid,
2004 and a runtime exception will occur when
2005 this statement is executed.
2006 </p>
2007
2008
2009 <h3><a name="VA_FORMAT_STRING_MISSING_ARGUMENT">FS: Format string references missing argument (VA_FORMAT_STRING_MISSING_ARGUMENT)</a></h3>
2010
2011
2012 <p>
2013 Not enough arguments are passed to satisfy a placeholder in the format string.
2014 A runtime exception will occur when
2015 this statement is executed.
2016 </p>
2017
2018
2019 <h3><a name="VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT">FS: No previous argument for format string (VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT)</a></h3>
2020
2021
2022 <p>
2023 The format string specifies a relative index to request that the argument for the previous format specifier
2024 be reused. However, there is no previous argument.
2025 For example,
2026 </p>
2027 <p><code>formatter.format("%&lt;s %s", "a", "b")</code>
2028 </p>
2029 <p>would throw a MissingFormatArgumentException when executed.
2030 </p>
2031
2032
2033 <h3><a name="GC_UNRELATED_TYPES">GC: No relationship between generic parameter and method argument (GC_UNRELATED_TYPES)</a></h3>
2034
2035
2036 <p> This call to a generic collection method contains an argument
2037 with an incompatible class from that of the collection's parameter
2038 (i.e., the type of the argument is neither a supertype nor a subtype
2039 of the corresponding generic type argument).
2040 Therefore, it is unlikely that the collection contains any objects
2041 that are equal to the method argument used here.
2042 Most likely, the wrong value is being passed to the method.</p>
2043 <p>In general, instances of two unrelated classes are not equal.
2044 For example, if the <code>Foo</code> and <code>Bar</code> classes
2045 are not related by subtyping, then an instance of <code>Foo</code>
2046 should not be equal to an instance of <code>Bar</code>.
2047 Among other issues, doing so will likely result in an equals method
2048 that is not symmetrical. For example, if you define the <code>Foo</code> class
2049 so that a <code>Foo</code> can be equal to a <code>String</code>,
2050 your equals method isn't symmetrical since a <code>String</code> can only be equal
2051 to a <code>String</code>.
2052 </p>
2053 <p>In rare cases, people do define nonsymmetrical equals methods and still manage to make
2054 their code work. Although none of the APIs document or guarantee it, it is typically
2055 the case that if you check if a <code>Collection&lt;String&gt;</code> contains
2056 a <code>Foo</code>, the equals method of argument (e.g., the equals method of the
2057 <code>Foo</code> class) used to perform the equality checks.
2058 </p>
2059
2060
2061 <h3><a name="HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS">HE: Signature declares use of unhashable class in hashed construct (HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS)</a></h3>
2062
2063
2064 <p> A method, field or class declares a generic signature where a non-hashable class
2065 is used in context where a hashable class is required.
2066 A class that declares an equals method but inherits a hashCode() method
2067 from Object is unhashable, since it doesn't fulfill the requirement that
2068 equal objects have equal hashCodes.
2069 </p>
2070
2071
2072 <h3><a name="HE_USE_OF_UNHASHABLE_CLASS">HE: Use of class without a hashCode() method in a hashed data structure (HE_USE_OF_UNHASHABLE_CLASS)</a></h3>
2073
2074
2075 <p> A class defines an equals(Object) method but not a hashCode() method,
2076 and thus doesn't fulfill the requirement that equal objects have equal hashCodes.
2077 An instance of this class is used in a hash data structure, making the need to
2078 fix this problem of highest importance.
2079
2080
2081 <h3><a name="ICAST_INT_2_LONG_AS_INSTANT">ICAST: int value converted to long and used as absolute time (ICAST_INT_2_LONG_AS_INSTANT)</a></h3>
2082
2083
2084 <p>
2085 This code converts a 32-bit int value to a 64-bit long value, and then
2086 passes that value for a method parameter that requires an absolute time value.
2087 An absolute time value is the number
2088 of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
2089 For example, the following method, intended to convert seconds since the epoc into a Date, is badly
2090 broken:</p>
2091 <pre>
2092 Date getDate(int seconds) { return new Date(seconds * 1000); }
2093 </pre>
2094 <p>The multiplication is done using 32-bit arithmetic, and then converted to a 64-bit value.
2095 When a 32-bit value is converted to 64-bits and used to express an absolute time
2096 value, only dates in December 1969 and January 1970 can be represented.</p>
2097
2098 <p>Correct implementations for the above method are:</p>
2099
2100 <pre>
2101 // Fails for dates after 2037
2102 Date getDate(int seconds) { return new Date(seconds * 1000L); }
2103
2104 // better, works for all dates
2105 Date getDate(long seconds) { return new Date(seconds * 1000); }
2106 </pre>
2107
2108
2109 <h3><a name="ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL">ICAST: Integral value cast to double and then passed to Math.ceil (ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL)</a></h3>
2110
2111
2112 <p>
2113 This code converts an integral value (e.g., int or long)
2114 to a double precision
2115 floating point number and then
2116 passing the result to the Math.ceil() function, which rounds a double to
2117 the next higher integer value. This operation should always be a no-op,
2118 since the converting an integer to a double should give a number with no fractional part.
2119 It is likely that the operation that generated the value to be passed
2120 to Math.ceil was intended to be performed using double precision
2121 floating point arithmetic.
2122 </p>
2123
2124
2125
2126 <h3><a name="ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND">ICAST: int value cast to float and then passed to Math.round (ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND)</a></h3>
2127
2128
2129 <p>
2130 This code converts an int value to a float precision
2131 floating point number and then
2132 passing the result to the Math.round() function, which returns the int/long closest
2133 to the argument. This operation should always be a no-op,
2134 since the converting an integer to a float should give a number with no fractional part.
2135 It is likely that the operation that generated the value to be passed
2136 to Math.round was intended to be performed using
2137 floating point arithmetic.
2138 </p>
2139
2140
2141
2142 <h3><a name="IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD">IJU: JUnit assertion in run method will not be noticed by JUnit (IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD)</a></h3>
2143
2144
2145 <p> A JUnit assertion is performed in a run method. Failed JUnit assertions
2146 just result in exceptions being thrown.
2147 Thus, if this exception occurs in a thread other than the thread that invokes
2148 the test method, the exception will terminate the thread but not result
2149 in the test failing.
2150 </p>
2151
2152
2153 <h3><a name="IJU_BAD_SUITE_METHOD">IJU: TestCase declares a bad suite method (IJU_BAD_SUITE_METHOD)</a></h3>
2154
2155
2156 <p> Class is a JUnit TestCase and defines a suite() method.
2157 However, the suite method needs to be declared as either</p>
2158 <pre>public static junit.framework.Test suite()</pre>
2159 or
2160 <pre>public static junit.framework.TestSuite suite()</pre>
2161
2162
2163 <h3><a name="IJU_NO_TESTS">IJU: TestCase has no tests (IJU_NO_TESTS)</a></h3>
2164
2165
2166 <p> Class is a JUnit TestCase but has not implemented any test methods</p>
2167
2168
2169 <h3><a name="IJU_SETUP_NO_SUPER">IJU: TestCase defines setUp that doesn't call super.setUp() (IJU_SETUP_NO_SUPER)</a></h3>
2170
2171
2172 <p> Class is a JUnit TestCase and implements the setUp method. The setUp method should call
2173 super.setUp(), but doesn't.</p>
2174
2175
2176 <h3><a name="IJU_SUITE_NOT_STATIC">IJU: TestCase implements a non-static suite method (IJU_SUITE_NOT_STATIC)</a></h3>
2177
2178
2179 <p> Class is a JUnit TestCase and implements the suite() method.
2180 The suite method should be declared as being static, but isn't.</p>
2181
2182
2183 <h3><a name="IJU_TEARDOWN_NO_SUPER">IJU: TestCase defines tearDown that doesn't call super.tearDown() (IJU_TEARDOWN_NO_SUPER)</a></h3>
2184
2185
2186 <p> Class is a JUnit TestCase and implements the tearDown method. The tearDown method should call
2187 super.tearDown(), but doesn't.</p>
2188
2189
2190 <h3><a name="IL_CONTAINER_ADDED_TO_ITSELF">IL: A collection is added to itself (IL_CONTAINER_ADDED_TO_ITSELF)</a></h3>
2191
2192
2193 <p>A collection is added to itself. As a result, computing the hashCode of this
2194 set will throw a StackOverflowException.
2195 </p>
2196
2197
2198 <h3><a name="IL_INFINITE_LOOP">IL: An apparent infinite loop (IL_INFINITE_LOOP)</a></h3>
2199
2200
2201 <p>This loop doesn't seem to have a way to terminate (other than by perhaps
2202 throwing an exception).</p>
2203
2204
2205 <h3><a name="IL_INFINITE_RECURSIVE_LOOP">IL: An apparent infinite recursive loop (IL_INFINITE_RECURSIVE_LOOP)</a></h3>
2206
2207
2208 <p>This method unconditionally invokes itself. This would seem to indicate
2209 an infinite recursive loop that will result in a stack overflow.</p>
2210
2211
2212 <h3><a name="IM_MULTIPLYING_RESULT_OF_IREM">IM: Integer multiply of result of integer remainder (IM_MULTIPLYING_RESULT_OF_IREM)</a></h3>
2213
2214
2215 <p>
2216 The code multiplies the result of an integer remaining by an integer constant.
2217 Be sure you don't have your operator precedence confused. For example
2218 i % 60 * 1000 is (i % 60) * 1000, not i % (60 * 1000).
2219 </p>
2220
2221
2222 <h3><a name="INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad comparison of int value with long constant (INT_BAD_COMPARISON_WITH_INT_VALUE)</a></h3>
2223
2224
2225 <p> This code compares an int value with a long constant that is outside
2226 the range of values that can be represented as an int value.
2227 This comparison is vacuous and possibily to be incorrect.
2228 </p>
2229
2230
2231 <h3><a name="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT: Bad comparison of nonnegative value with negative constant (INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE)</a></h3>
2232
2233
2234 <p> This code compares a value that is guaranteed to be non-negative with a negative constant.
2235 </p>
2236
2237
2238 <h3><a name="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE)</a></h3>
2239
2240
2241 <p> Signed bytes can only have a value in the range -128 to 127. Comparing
2242 a signed byte with a value outside that range is vacuous and likely to be incorrect.
2243 To convert a signed byte <code>b</code> to an unsigned value in the range 0..255,
2244 use <code>0xff &amp; b</code>
2245 </p>
2246
2247
2248 <h3><a name="IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">IO: Doomed attempt to append to an object output stream (IO_APPENDING_TO_OBJECT_OUTPUT_STREAM)</a></h3>
2249
2250
2251 <p>
2252 This code opens a file in append mode and then wraps the result in an object output stream.
2253 This won't allow you to append to an existing object output stream stored in a file. If you want to be
2254 able to append to an object output stream, you need to keep the object output stream open.
2255 </p>
2256 <p>The only situation in which opening a file in append mode and the writing an object output stream
2257 could work is if on reading the file you plan to open it in random access mode and seek to the byte offset
2258 where the append started.
2259 </p>
2260
2261 <p>
2262 TODO: example.
2263 </p>
2264
2265
2266 <h3><a name="IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">IP: A parameter is dead upon entry to a method but overwritten (IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN)</a></h3>
2267
2268
2269 <p>
2270 The initial value of this parameter is ignored, and the parameter
2271 is overwritten here. This often indicates a mistaken belief that
2272 the write to the parameter will be conveyed back to
2273 the caller.
2274 </p>
2275
2276
2277 <h3><a name="MF_CLASS_MASKS_FIELD">MF: Class defines field that masks a superclass field (MF_CLASS_MASKS_FIELD)</a></h3>
2278
2279
2280 <p> This class defines a field with the same name as a visible
2281 instance field in a superclass. This is confusing, and
2282 may indicate an error if methods update or access one of
2283 the fields when they wanted the other.</p>
2284
2285
2286 <h3><a name="MF_METHOD_MASKS_FIELD">MF: Method defines a variable that obscures a field (MF_METHOD_MASKS_FIELD)</a></h3>
2287
2288
2289 <p> This method defines a local variable with the same name as a field
2290 in this class or a superclass. This may cause the method to
2291 read an uninitialized value from the field, leave the field uninitialized,
2292 or both.</p>
2293
2294
2295 <h3><a name="NP_ALWAYS_NULL">NP: Null pointer dereference (NP_ALWAYS_NULL)</a></h3>
2296
2297
2298 <p> A null pointer is dereferenced here.&nbsp; This will lead to a
2299 <code>NullPointerException</code> when the code is executed.</p>
2300
2301
2302 <h3><a name="NP_ALWAYS_NULL_EXCEPTION">NP: Null pointer dereference in method on exception path (NP_ALWAYS_NULL_EXCEPTION)</a></h3>
2303
2304
2305 <p> A pointer which is null on an exception path is dereferenced here.&nbsp;
2306 This will lead to a <code>NullPointerException</code> when the code is executed.&nbsp;
2307 Note that because FindBugs currently does not prune infeasible exception paths,
2308 this may be a false warning.</p>
2309
2310 <p> Also note that FindBugs considers the default case of a switch statement to
2311 be an exception path, since the default case is often infeasible.</p>
2312
2313
2314 <h3><a name="NP_ARGUMENT_MIGHT_BE_NULL">NP: Method does not check for null argument (NP_ARGUMENT_MIGHT_BE_NULL)</a></h3>
2315
2316
2317 <p>
2318 A parameter to this method has been identified as a value that should
2319 always be checked to see whether or not it is null, but it is being dereferenced
2320 without a preceding null check.
2321 </p>
2322
2323
2324 <h3><a name="NP_CLOSING_NULL">NP: close() invoked on a value that is always null (NP_CLOSING_NULL)</a></h3>
2325
2326
2327 <p> close() is being invoked on a value that is always null. If this statement is executed,
2328 a null pointer exception will occur. But the big risk here you never close
2329 something that should be closed.
2330
2331
2332 <h3><a name="NP_GUARANTEED_DEREF">NP: Null value is guaranteed to be dereferenced (NP_GUARANTEED_DEREF)</a></h3>
2333
2334
2335 <p>
2336 There is a statement or branch that if executed guarantees that
2337 a value is null at this point, and that
2338 value that is guaranteed to be dereferenced
2339 (except on forward paths involving runtime exceptions).
2340 </p>
2341 <p>Note that a check such as
2342 <code>if (x == null) throw new NullPointerException();</code>
2343 is treated as a dereference of <code>x</code>.
2344
2345
2346 <h3><a name="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: Value is null and guaranteed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH)</a></h3>
2347
2348
2349 <p>
2350 There is a statement or branch on an exception path
2351 that if executed guarantees that
2352 a value is null at this point, and that
2353 value that is guaranteed to be dereferenced
2354 (except on forward paths involving runtime exceptions).
2355 </p>
2356
2357
2358 <h3><a name="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP: Nonnull field is not initialized (NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR)</a></h3>
2359
2360
2361 <p> The field is marked as nonnull, but isn't written to by the constructor.
2362 The field might be initialized elsewhere during constructor, or might always
2363 be initialized before use.
2364 </p>
2365
2366
2367 <h3><a name="NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a nonnull parameter (NP_NONNULL_PARAM_VIOLATION)</a></h3>
2368
2369
2370 <p>
2371 This method passes a null value as the parameter of a method which
2372 must be nonnull. Either this parameter has been explicitly marked
2373 as @Nonnull, or analysis has determined that this parameter is
2374 always dereferenced.
2375 </p>
2376
2377
2378 <h3><a name="NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is declared @NonNull (NP_NONNULL_RETURN_VIOLATION)</a></h3>
2379
2380
2381 <p>
2382 This method may return a null value, but the method (or a superclass method
2383 which it overrides) is declared to return @NonNull.
2384 </p>
2385
2386
2387 <h3><a name="NP_NULL_INSTANCEOF">NP: A known null value is checked to see if it is an instance of a type (NP_NULL_INSTANCEOF)</a></h3>
2388
2389
2390 <p>
2391 This instanceof test will always return false, since the value being checked is guaranteed to be null.
2392 Although this is safe, make sure it isn't
2393 an indication of some misunderstanding or some other logic error.
2394 </p>
2395
2396
2397 <h3><a name="NP_NULL_ON_SOME_PATH">NP: Possible null pointer dereference (NP_NULL_ON_SOME_PATH)</a></h3>
2398
2399
2400 <p> There is a branch of statement that, <em>if executed,</em> guarantees that
2401 a null value will be dereferenced, which
2402 would generate a <code>NullPointerException</code> when the code is executed.
2403 Of course, the problem might be that the branch or statement is infeasible and that
2404 the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.
2405 </p>
2406
2407
2408 <h3><a name="NP_NULL_ON_SOME_PATH_EXCEPTION">NP: Possible null pointer dereference in method on exception path (NP_NULL_ON_SOME_PATH_EXCEPTION)</a></h3>
2409
2410
2411 <p> A reference value which is null on some exception control path is
2412 dereferenced here.&nbsp; This may lead to a <code>NullPointerException</code>
2413 when the code is executed.&nbsp;
2414 Note that because FindBugs currently does not prune infeasible exception paths,
2415 this may be a false warning.</p>
2416
2417 <p> Also note that FindBugs considers the default case of a switch statement to
2418 be an exception path, since the default case is often infeasible.</p>
2419
2420
2421 <h3><a name="NP_NULL_PARAM_DEREF">NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF)</a></h3>
2422
2423
2424 <p>
2425 This method call passes a null value for a nonnull method parameter.
2426 Either the parameter is annotated as a parameter that should
2427 always be nonnull, or analysis has shown that it will always be
2428 dereferenced.
2429 </p>
2430
2431
2432 <h3><a name="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS)</a></h3>
2433
2434
2435 <p>
2436 A possibly-null value is passed at a call site where all known
2437 target methods require the parameter to be nonnull.
2438 Either the parameter is annotated as a parameter that should
2439 always be nonnull, or analysis has shown that it will always be
2440 dereferenced.
2441 </p>
2442
2443
2444 <h3><a name="NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virtual method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL)</a></h3>
2445
2446
2447 <p>
2448 A possibly-null value is passed to a nonnull method parameter.
2449 Either the parameter is annotated as a parameter that should
2450 always be nonnull, or analysis has shown that it will always be
2451 dereferenced.
2452 </p>
2453
2454
2455 <h3><a name="NP_STORE_INTO_NONNULL_FIELD">NP: Store of null value into field annotated NonNull (NP_STORE_INTO_NONNULL_FIELD)</a></h3>
2456
2457
2458 <p> A value that could be null is stored into a field that has been annotated as NonNull. </p>
2459
2460
2461 <h3><a name="NP_UNWRITTEN_FIELD">NP: Read of unwritten field (NP_UNWRITTEN_FIELD)</a></h3>
2462
2463
2464 <p> The program is dereferencing a field that does not seem to ever have a non-null value written to it.
2465 Unless the field is initialized via some mechanism not seen by the analysis,
2466 dereferencing this value will generate a null pointer exception.
2467 </p>
2468
2469
2470 <h3><a name="NM_BAD_EQUAL">Nm: Class defines equal(Object); should it be equals(Object)? (NM_BAD_EQUAL)</a></h3>
2471
2472
2473 <p> This class defines a method <code>equal(Object)</code>.&nbsp; This method does
2474 not override the <code>equals(Object)</code> method in <code>java.lang.Object</code>,
2475 which is probably what was intended.</p>
2476
2477
2478 <h3><a name="NM_LCASE_HASHCODE">Nm: Class defines hashcode(); should it be hashCode()? (NM_LCASE_HASHCODE)</a></h3>
2479
2480
2481 <p> This class defines a method called <code>hashcode()</code>.&nbsp; This method
2482 does not override the <code>hashCode()</code> method in <code>java.lang.Object</code>,
2483 which is probably what was intended.</p>
2484
2485
2486 <h3><a name="NM_LCASE_TOSTRING">Nm: Class defines tostring(); should it be toString()? (NM_LCASE_TOSTRING)</a></h3>
2487
2488
2489 <p> This class defines a method called <code>tostring()</code>.&nbsp; This method
2490 does not override the <code>toString()</code> method in <code>java.lang.Object</code>,
2491 which is probably what was intended.</p>
2492
2493
2494 <h3><a name="NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor confusion (NM_METHOD_CONSTRUCTOR_CONFUSION)</a></h3>
2495
2496
2497 <p> This regular method has the same name as the class it is defined in. It is likely that this was intended to be a constructor.
2498 If it was intended to be a constructor, remove the declaration of a void return value.
2499 If you had accidently defined this method, realized the mistake, defined a proper constructor
2500 but can't get rid of this method due to backwards compatibility, deprecate the method.
2501 </p>
2502
2503
2504 <h3><a name="NM_VERY_CONFUSING">Nm: Very confusing method names (NM_VERY_CONFUSING)</a></h3>
2505
2506
2507 <p> The referenced methods have names that differ only by capitalization.
2508 This is very confusing because if the capitalization were
2509 identical then one of the methods would override the other.
2510 </p>
2511
2512
2513 <h3><a name="NM_WRONG_PACKAGE">Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE)</a></h3>
2514
2515
2516 <p> The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match
2517 the type of the corresponding parameter in the superclass. For example, if you have:</p>
2518
2519 <blockquote>
2520 <pre>
2521 import alpha.Foo;
2522 public class A {
2523 public int f(Foo x) { return 17; }
2524 }
2525 ----
2526 import beta.Foo;
2527 public class B extends A {
2528 public int f(Foo x) { return 42; }
2529 }
2530 </pre>
2531 </blockquote>
2532
2533 <p>The <code>f(Foo)</code> method defined in class <code>B</code> doesn't
2534 override the
2535 <code>f(Foo)</code> method defined in class <code>A</code>, because the argument
2536 types are <code>Foo</code>'s from different packages.
2537 </p>
2538
2539
2540 <h3><a name="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean literal in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT)</a></h3>
2541
2542
2543 <p>
2544 This method assigns a literal boolean value (true or false) to a boolean variable inside
2545 an if or while expression. Most probably this was supposed to be a boolean comparison using
2546 ==, not an assignment using =.
2547 </p>
2548
2549
2550 <h3><a name="RC_REF_COMPARISON">RC: Suspicious reference comparison (RC_REF_COMPARISON)</a></h3>
2551
2552
2553 <p> This method compares two reference values using the == or != operator,
2554 where the correct way to compare instances of this type is generally
2555 with the equals() method.
2556 It is possible to create distinct instances that are equal but do not compare as == since
2557 they are different objects.
2558 Examples of classes which should generally
2559 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p>
2560
2561
2562 <h3><a name="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE">RCN: Nullcheck of value previously dereferenced (RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE)</a></h3>
2563
2564
2565 <p> A value is checked here to see whether it is null, but this value can't
2566 be null because it was previously dereferenced and if it were null a null pointer
2567 exception would have occurred at the earlier dereference.
2568 Essentially, this code and the previous dereference
2569 disagree as to whether this value is allowed to be null. Either the check is redundant
2570 or the previous dereference is erroneous.</p>
2571
2572
2573 <h3><a name="RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">RE: Invalid syntax for regular expression (RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION)</a></h3>
2574
2575
2576 <p>
2577 The code here uses a regular expression that is invalid according to the syntax
2578 for regular expressions. This statement will throw a PatternSyntaxException when
2579 executed.
2580 </p>
2581
2582
2583 <h3><a name="RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION">RE: File.separator used for regular expression (RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION)</a></h3>
2584
2585
2586 <p>
2587 The code here uses <code>File.separator</code>
2588 where a regular expression is required. This will fail on Windows
2589 platforms, where the <code>File.separator</code> is a backslash, which is interpreted in a
2590 regular expression as an escape character. Amoung other options, you can just use
2591 <code>File.separatorChar=='\\' ? "\\\\" : File.separator</code> instead of
2592 <code>File.separator</code>
2593
2594 </p>
2595
2596
2597 <h3><a name="RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or "|" used for regular expression (RE_POSSIBLE_UNINTENDED_PATTERN)</a></h3>
2598
2599
2600 <p>
2601 A String function is being invoked and "." or "|" is being passed
2602 to a parameter that takes a regular expression as an argument. Is this what you intended?
2603 For example
2604 <li>s.replaceAll(".", "/") will return a String in which <em>every</em> character has been replaced by a '/' character
2605 <li>s.split(".") <em>always</em> returns a zero length array of String
2606 <li>"ab|cd".replaceAll("|", "/") will return "/a/b/|/c/d/"
2607 <li>"ab|cd".split("|") will return array with six (!) elements: [, a, b, |, c, d]
2608 </p>
2609
2610
2611 <h3><a name="RV_01_TO_INT">RV: Random value from 0 to 1 is coerced to the integer 0 (RV_01_TO_INT)</a></h3>
2612
2613
2614 <p>A random value from 0 to 1 is being coerced to the integer value 0. You probably
2615 want to multiple the random value by something else before coercing it to an integer, or use the <code>Random.nextInt(n)</code> method.
2616 </p>
2617
2618
2619 <h3><a name="RV_ABSOLUTE_VALUE_OF_HASHCODE">RV: Bad attempt to compute absolute value of signed 32-bit hashcode (RV_ABSOLUTE_VALUE_OF_HASHCODE)</a></h3>
2620
2621
2622 <p> This code generates a hashcode and then computes
2623 the absolute value of that hashcode. If the hashcode
2624 is <code>Integer.MIN_VALUE</code>, then the result will be negative as well (since
2625 <code>Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE</code>).
2626 </p>
2627 <p>One out of 2^32 strings have a hashCode of Integer.MIN_VALUE,
2628 including "polygenelubricants" "GydZG_" and ""DESIGNING WORKHOUSES".
2629 </p>
2630
2631
2632 <h3><a name="RV_ABSOLUTE_VALUE_OF_RANDOM_INT">RV: Bad attempt to compute absolute value of signed random integer (RV_ABSOLUTE_VALUE_OF_RANDOM_INT)</a></h3>
2633
2634
2635 <p> This code generates a random signed integer and then computes
2636 the absolute value of that random integer. If the number returned by the random number
2637 generator is <code>Integer.MIN_VALUE</code>, then the result will be negative as well (since
2638 <code>Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE</code>). (Same problem arised for long values as well).
2639 </p>
2640
2641
2642 <h3><a name="RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE">RV: Code checks for specific values returned by compareTo (RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE)</a></h3>
2643
2644
2645 <p> This code invoked a compareTo or compare method, and checks to see if the return value is a specific value,
2646 such as 1 or -1. When invoking these methods, you should only check the sign of the result, not for any specific
2647 non-zero value. While many or most compareTo and compare methods only return -1, 0 or 1, some of them
2648 will return other values.
2649
2650
2651 <h3><a name="RV_EXCEPTION_NOT_THROWN">RV: Exception created and dropped rather than thrown (RV_EXCEPTION_NOT_THROWN)</a></h3>
2652
2653
2654 <p> This code creates an exception (or error) object, but doesn't do anything with it. For example,
2655 something like </p>
2656 <blockquote>
2657 <pre>
2658 if (x &lt; 0)
2659 new IllegalArgumentException("x must be nonnegative");
2660 </pre>
2661 </blockquote>
2662 <p>It was probably the intent of the programmer to throw the created exception:</p>
2663 <blockquote>
2664 <pre>
2665 if (x &lt; 0)
2666 throw new IllegalArgumentException("x must be nonnegative");
2667 </pre>
2668 </blockquote>
2669
2670
2671 <h3><a name="RV_RETURN_VALUE_IGNORED">RV: Method ignores return value (RV_RETURN_VALUE_IGNORED)</a></h3>
2672
2673
2674 <p> The return value of this method should be checked. One common
2675 cause of this warning is to invoke a method on an immutable object,
2676 thinking that it updates the object. For example, in the following code
2677 fragment,</p>
2678 <blockquote>
2679 <pre>
2680 String dateString = getHeaderField(name);
2681 dateString.trim();
2682 </pre>
2683 </blockquote>
2684 <p>the programmer seems to be thinking that the trim() method will update
2685 the String referenced by dateString. But since Strings are immutable, the trim()
2686 function returns a new String value, which is being ignored here. The code
2687 should be corrected to: </p>
2688 <blockquote>
2689 <pre>
2690 String dateString = getHeaderField(name);
2691 dateString = dateString.trim();
2692 </pre>
2693 </blockquote>
2694
2695
2696 <h3><a name="RpC_REPEATED_CONDITIONAL_TEST">RpC: Repeated conditional tests (RpC_REPEATED_CONDITIONAL_TEST)</a></h3>
2697
2698
2699 <p>The code contains a conditional test is performed twice, one right after the other
2700 (e.g., <code>x == 0 || x == 0</code>). Perhaps the second occurrence is intended to be something else
2701 (e.g., <code>x == 0 || y == 0</code>).
2702 </p>
2703
2704
2705 <h3><a name="SA_FIELD_SELF_ASSIGNMENT">SA: Self assignment of field (SA_FIELD_SELF_ASSIGNMENT)</a></h3>
2706
2707
2708 <p> This method contains a self assignment of a field; e.g.
2709 </p>
2710 <pre>
2711 int x;
2712 public void foo() {
2713 x = x;
2714 }
2715 </pre>
2716 <p>Such assignments are useless, and may indicate a logic error or typo.</p>
2717
2718
2719 <h3><a name="SA_FIELD_SELF_COMPARISON">SA: Self comparison of field with itself (SA_FIELD_SELF_COMPARISON)</a></h3>
2720
2721
2722 <p> This method compares a field with itself, and may indicate a typo or
2723 a logic error. Make sure that you are comparing the right things.
2724 </p>
2725
2726
2727 <h3><a name="SA_FIELD_SELF_COMPUTATION">SA: Nonsensical self computation involving a field (e.g., x & x) (SA_FIELD_SELF_COMPUTATION)</a></h3>
2728
2729
2730 <p> This method performs a nonsensical computation of a field with another
2731 reference to the same field (e.g., x&x or x-x). Because of the nature
2732 of the computation, this operation doesn't seem to make sense,
2733 and may indicate a typo or
2734 a logic error. Double check the computation.
2735 </p>
2736
2737
2738 <h3><a name="SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">SA: Self assignment of local rather than assignment to field (SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD)</a></h3>
2739
2740
2741 <p> This method contains a self assignment of a local variable, and there
2742 is a field with an identical name.
2743 assignment appears to have been ; e.g.</p>
2744 <pre>
2745 int foo;
2746 public void setFoo(int foo) {
2747 foo = foo;
2748 }
2749 </pre>
2750 <p>The assignment is useless. Did you mean to assign to the field instead?</p>
2751
2752
2753 <h3><a name="SA_LOCAL_SELF_COMPARISON">SA: Self comparison of value with itself (SA_LOCAL_SELF_COMPARISON)</a></h3>
2754
2755
2756 <p> This method compares a local variable with itself, and may indicate a typo or
2757 a logic error. Make sure that you are comparing the right things.
2758 </p>
2759
2760
2761 <h3><a name="SA_LOCAL_SELF_COMPUTATION">SA: Nonsensical self computation involving a variable (e.g., x & x) (SA_LOCAL_SELF_COMPUTATION)</a></h3>
2762
2763
2764 <p> This method performs a nonsensical computation of a local variable with another
2765 reference to the same variable (e.g., x&x or x-x). Because of the nature
2766 of the computation, this operation doesn't seem to make sense,
2767 and may indicate a typo or
2768 a logic error. Double check the computation.
2769 </p>
2770
2771
2772 <h3><a name="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">SF: Dead store due to switch statement fall through (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH)</a></h3>
2773
2774
2775 <p> A value stored in the previous switch case is overwritten here due to a switch fall through. It is likely that
2776 you forgot to put a break or return at the end of the previous case.
2777 </p>
2778
2779
2780 <h3><a name="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW">SF: Dead store due to switch statement fall through to throw (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW)</a></h3>
2781
2782
2783 <p> A value stored in the previous switch case is ignored here due to a switch fall through to a place where
2784 an exception is thrown. It is likely that
2785 you forgot to put a break or return at the end of the previous case.
2786 </p>
2787
2788
2789 <h3><a name="SIC_THREADLOCAL_DEADLY_EMBRACE">SIC: Deadly embrace of non-static inner class and thread local (SIC_THREADLOCAL_DEADLY_EMBRACE)</a></h3>
2790
2791
2792 <p> This class is an inner class, but should probably be a static inner class.
2793 As it is, there is a serious danger of a deadly embrace between the inner class
2794 and the thread local in the outer class. Because the inner class isn't static,
2795 it retains a reference to the outer class.
2796 If the thread local contains a reference to an instance of the inner
2797 class, the inner and outer instance will both be reachable
2798 and not eligible for garbage collection.
2799 </p>
2800
2801
2802 <h3><a name="SIO_SUPERFLUOUS_INSTANCEOF">SIO: Unnecessary type check done using instanceof operator (SIO_SUPERFLUOUS_INSTANCEOF)</a></h3>
2803
2804
2805 <p> Type check performed using the instanceof operator where it can be statically determined whether the object
2806 is of the type requested. </p>
2807
2808
2809 <h3><a name="SQL_BAD_PREPARED_STATEMENT_ACCESS">SQL: Method attempts to access a prepared statement parameter with index 0 (SQL_BAD_PREPARED_STATEMENT_ACCESS)</a></h3>
2810
2811
2812 <p> A call to a setXXX method of a prepared statement was made where the
2813 parameter index is 0. As parameter indexes start at index 1, this is always a mistake.</p>
2814
2815
2816 <h3><a name="SQL_BAD_RESULTSET_ACCESS">SQL: Method attempts to access a result set field with index 0 (SQL_BAD_RESULTSET_ACCESS)</a></h3>
2817
2818
2819 <p> A call to getXXX or updateXXX methods of a result set was made where the
2820 field index is 0. As ResultSet fields start at index 1, this is always a mistake.</p>
2821
2822
2823 <h3><a name="STI_INTERRUPTED_ON_CURRENTTHREAD">STI: Unneeded use of currentThread() call, to call interrupted() (STI_INTERRUPTED_ON_CURRENTTHREAD)</a></h3>
2824
2825
2826 <p>
2827 This method invokes the Thread.currentThread() call, just to call the interrupted() method. As interrupted() is a
2828 static method, is more simple and clear to use Thread.interrupted().
2829 </p>
2830
2831
2832 <h3><a name="STI_INTERRUPTED_ON_UNKNOWNTHREAD">STI: Static Thread.interrupted() method invoked on thread instance (STI_INTERRUPTED_ON_UNKNOWNTHREAD)</a></h3>
2833
2834
2835 <p>
2836 This method invokes the Thread.interrupted() method on a Thread object that appears to be a Thread object that is
2837 not the current thread. As the interrupted() method is static, the interrupted method will be called on a different
2838 object than the one the author intended.
2839 </p>
2840
2841
2842 <h3><a name="SE_METHOD_MUST_BE_PRIVATE">Se: Method must be private in order for serialization to work (SE_METHOD_MUST_BE_PRIVATE)</a></h3>
2843
2844
2845 <p> This class implements the <code>Serializable</code> interface, and defines a method
2846 for custom serialization/deserialization. But since that method isn't declared private,
2847 it will be silently ignored by the serialization/deserialization API.</p>
2848
2849
2850 <h3><a name="SE_READ_RESOLVE_IS_STATIC">Se: The readResolve method must not be declared as a static method. (SE_READ_RESOLVE_IS_STATIC)</a></h3>
2851
2852
2853 <p> In order for the readResolve method to be recognized by the serialization
2854 mechanism, it must not be declared as a static method.
2855 </p>
2856
2857
2858 <h3><a name="TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">TQ: Value annotated as carrying a type qualifier used where a value that must not carry that qualifier is required (TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED)</a></h3>
2859
2860
2861 <p>
2862 A value specified as carrying a type qualifier annotation is
2863 consumed in a location or locations requiring that the value not
2864 carry that annotation.
2865 </p>
2866
2867 <p>
2868 More precisely, a value annotated with a type qualifier specifying when=ALWAYS
2869 is guaranteed to reach a use or uses where the same type qualifier specifies when=NEVER.
2870 </p>
2871
2872 <p>
2873 For example, say that @NonNegative is a nickname for
2874 the type qualifier annotation @Negative(when=When.NEVER).
2875 The following code will generate this warning because
2876 the return statement requires a @NonNegative value,
2877 but receives one that is marked as @Negative.
2878 </p>
2879 <blockquote>
2880 <pre>
2881 public @NonNegative Integer example(@Negative Integer value) {
2882 return value;
2883 }
2884 </pre>
2885 </blockquote>
2886
2887
2888 <h3><a name="TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS">TQ: Comparing values with incompatible type qualifiers (TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS)</a></h3>
2889
2890
2891 <p>
2892 A value specified as carrying a type qualifier annotation is
2893 compared with a value that doesn't ever carry that qualifier.
2894 </p>
2895
2896 <p>
2897 More precisely, a value annotated with a type qualifier specifying when=ALWAYS
2898 is compared with a value that where the same type qualifier specifies when=NEVER.
2899 </p>
2900
2901 <p>
2902 For example, say that @NonNegative is a nickname for
2903 the type qualifier annotation @Negative(when=When.NEVER).
2904 The following code will generate this warning because
2905 the return statement requires a @NonNegative value,
2906 but receives one that is marked as @Negative.
2907 </p>
2908 <blockquote>
2909 <pre>
2910 public boolean example(@Negative Integer value1, @NonNegative Integer value2) {
2911 return value1.equals(value2);
2912 }
2913 </pre>
2914 </blockquote>
2915
2916
2917 <h3><a name="TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">TQ: Value that might not carry a type qualifier is always used in a way requires that type qualifier (TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK)</a></h3>
2918
2919
2920 <p>
2921 A value that is annotated as possibility not being an instance of
2922 the values denoted by the type qualifier, and the value is guaranteed to be used
2923 in a way that requires values denoted by that type qualifier.
2924 </p>
2925
2926
2927 <h3><a name="TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value that might carry a type qualifier is always used in a way prohibits it from having that type qualifier (TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK)</a></h3>
2928
2929
2930 <p>
2931 A value that is annotated as possibility being an instance of
2932 the values denoted by the type qualifier, and the value is guaranteed to be used
2933 in a way that prohibits values denoted by that type qualifier.
2934 </p>
2935
2936
2937 <h3><a name="TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">TQ: Value annotated as never carrying a type qualifier used where value carrying that qualifier is required (TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED)</a></h3>
2938
2939
2940 <p>
2941 A value specified as not carrying a type qualifier annotation is guaranteed
2942 to be consumed in a location or locations requiring that the value does
2943 carry that annotation.
2944 </p>
2945
2946 <p>
2947 More precisely, a value annotated with a type qualifier specifying when=NEVER
2948 is guaranteed to reach a use or uses where the same type qualifier specifies when=ALWAYS.
2949 </p>
2950
2951 <p>
2952 TODO: example
2953 </p>
2954
2955
2956 <h3><a name="TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED">TQ: Value without a type qualifier used where a value is required to have that qualifier (TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED)</a></h3>
2957
2958
2959 <p>
2960 A value is being used in a way that requires the value be annotation with a type qualifier.
2961 The type qualifier is strict, so the tool rejects any values that do not have
2962 the appropriate annotation.
2963 </p>
2964
2965 <p>
2966 To coerce a value to have a strict annotation, define an identity function where the return value is annotated
2967 with the strict annotation.
2968 This is the only way to turn a non-annotated value into a value with a strict type qualifier annotation.
2969 </p>
2970
2971
2972
2973 <h3><a name="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">UMAC: Uncallable method defined in anonymous class (UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS)</a></h3>
2974
2975
2976 <p> This anonymous class defined a method that is not directly invoked and does not override
2977 a method in a superclass. Since methods in other classes cannot directly invoke methods
2978 declared in an anonymous class, it seems that this method is uncallable. The method
2979 might simply be dead code, but it is also possible that the method is intended to
2980 override a method declared in a superclass, and due to an typo or other error the method does not,
2981 in fact, override the method it is intended to.
2982 </p>
2983
2984
2985 <h3><a name="UR_UNINIT_READ">UR: Uninitialized read of field in constructor (UR_UNINIT_READ)</a></h3>
2986
2987
2988 <p> This constructor reads a field which has not yet been assigned a value.&nbsp;
2989 This is often caused when the programmer mistakenly uses the field instead
2990 of one of the constructor's parameters.</p>
2991
2992
2993 <h3><a name="UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR">UR: Uninitialized read of field method called from constructor of superclass (UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR)</a></h3>
2994
2995
2996 <p> This method is invoked in the constructor of of the superclass. At this point,
2997 the fields of the class have not yet initialized.</p>
2998 <p>To make this more concrete, consider the following classes:</p>
2999 <pre>abstract class A {
3000 int hashCode;
3001 abstract Object getValue();
3002 A() {
3003 hashCode = getValue().hashCode();
3004 }
3005 }
3006 class B extends A {
3007 Object value;
3008 B(Object v) {
3009 this.value = v;
3010 }
3011 Object getValue() {
3012 return value;
3013 }
3014 }</pre>
3015 <p>When a <code>B</code> is constructed,
3016 the constructor for the <code>A</code> class is invoked
3017 <em>before</em> the constructor for <code>B</code> sets <code>value</code>.
3018 Thus, when the constructor for <code>A</code> invokes <code>getValue</code>,
3019 an uninitialized value is read for <code>value</code>
3020 </p>
3021
3022
3023 <h3><a name="DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">USELESS_STRING: Invocation of toString on an unnamed array (DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY)</a></h3>
3024
3025
3026 <p>
3027 The code invokes toString on an (anonymous) array. Calling toString on an array generates a fairly useless result
3028 such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable
3029 String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.
3030 </p>
3031
3032
3033 <h3><a name="DMI_INVOKING_TOSTRING_ON_ARRAY">USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ARRAY)</a></h3>
3034
3035
3036 <p>
3037 The code invokes toString on an array, which will generate a fairly useless result
3038 such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable
3039 String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.
3040 </p>
3041
3042
3043 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">USELESS_STRING: Array formatted in useless way using format string (VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY)</a></h3>
3044
3045
3046 <p>
3047 One of the arguments being formatted with a format string is an array. This will be formatted
3048 using a fairly useless format, such as [I@304282, which doesn't actually show the contents
3049 of the array.
3050 Consider wrapping the array using <code>Arrays.asList(...)</code> before handling it off to a formatted.
3051 </p>
3052
3053
3054 <h3><a name="UWF_NULL_FIELD">UwF: Field only ever set to null (UWF_NULL_FIELD)</a></h3>
3055
3056
3057 <p> All writes to this field are of the constant value null, and thus
3058 all reads of the field will return null.
3059 Check for errors, or remove it if it is useless.</p>
3060
3061
3062 <h3><a name="UWF_UNWRITTEN_FIELD">UwF: Unwritten field (UWF_UNWRITTEN_FIELD)</a></h3>
3063
3064
3065 <p> This field is never written.&nbsp; All reads of it will return the default
3066 value. Check for errors (should it have been initialized?), or remove it if it is useless.</p>
3067
3068
3069 <h3><a name="VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">VA: Primitive array passed to function expecting a variable number of object arguments (VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG)</a></h3>
3070
3071
3072 <p>
3073 This code passes a primitive array to a function that takes a variable number of object arguments.
3074 This creates an array of length one to hold the primitive array and passes it to the function.
3075 </p>
3076
3077
3078 <h3><a name="LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">LG: Potential lost logger changes due to weak reference in OpenJDK (LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE)</a></h3>
3079
3080
3081 <p>OpenJDK introduces a potential incompatibility.
3082 In particular, the java.util.logging.Logger behavior has
3083 changed. Instead of using strong references, it now uses weak references
3084 internally. That's a reasonable change, but unfortunately some code relies on
3085 the old behavior - when changing logger configuration, it simply drops the
3086 logger reference. That means that the garbage collector is free to reclaim
3087 that memory, which means that the logger configuration is lost. For example,
3088 consider:
3089 </p>
3090
3091 <pre>public static void initLogging() throws Exception {
3092 Logger logger = Logger.getLogger("edu.umd.cs");
3093 logger.addHandler(new FileHandler()); // call to change logger configuration
3094 logger.setUseParentHandlers(false); // another call to change logger configuration
3095 }</pre>
3096
3097 <p>The logger reference is lost at the end of the method (it doesn't
3098 escape the method), so if you have a garbage collection cycle just
3099 after the call to initLogging, the logger configuration is lost
3100 (because Logger only keeps weak references).</p>
3101
3102 <pre>public static void main(String[] args) throws Exception {
3103 initLogging(); // adds a file handler to the logger
3104 System.gc(); // logger configuration lost
3105 Logger.getLogger("edu.umd.cs").info("Some message"); // this isn't logged to the file as expected
3106 }</pre>
3107 <p><em>Ulf Ochsenfahrt and Eric Fellheimer</em></p>
3108
3109
3110 <h3><a name="OBL_UNSATISFIED_OBLIGATION">OBL: Method may fail to clean up stream or resource (OBL_UNSATISFIED_OBLIGATION)</a></h3>
3111
3112
3113 <p>
3114 This method may fail to clean up (close, dispose of) a stream,
3115 database object, or other
3116 resource requiring an explicit cleanup operation.
3117 </p>
3118
3119 <p>
3120 In general, if a method opens a stream or other resource,
3121 the method should use a try/finally block to ensure that
3122 the stream or resource is cleaned up before the method
3123 returns.
3124 </p>
3125
3126 <p>
3127 This bug pattern is essentially the same as the
3128 OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE
3129 bug patterns, but is based on a different
3130 (and hopefully better) static analysis technique.
3131 We are interested is getting feedback about the
3132 usefulness of this bug pattern.
3133 To send feedback, either:
3134 </p>
3135 <ul>
3136 <li>send email to findbugs@cs.umd.edu</li>
3137 <li>file a bug report: <a href="http://findbugs.sourceforge.net/reportingBugs.html">http://findbugs.sourceforge.net/reportingBugs.html</a></li>
3138 </ul>
3139
3140 <p>
3141 In particular,
3142 the false-positive suppression heuristics for this
3143 bug pattern have not been extensively tuned, so
3144 reports about false positives are helpful to us.
3145 </p>
3146
3147 <p>
3148 See Weimer and Necula, <i>Finding and Preventing Run-Time Error Handling Mistakes</i>, for
3149 a description of the analysis technique.
3150 </p>
3151
3152
3153 <h3><a name="OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">OBL: Method may fail to clean up stream or resource on checked exception (OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE)</a></h3>
3154
3155
3156 <p>
3157 This method may fail to clean up (close, dispose of) a stream,
3158 database object, or other
3159 resource requiring an explicit cleanup operation.
3160 </p>
3161
3162 <p>
3163 In general, if a method opens a stream or other resource,
3164 the method should use a try/finally block to ensure that
3165 the stream or resource is cleaned up before the method
3166 returns.
3167 </p>
3168
3169 <p>
3170 This bug pattern is essentially the same as the
3171 OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE
3172 bug patterns, but is based on a different
3173 (and hopefully better) static analysis technique.
3174 We are interested is getting feedback about the
3175 usefulness of this bug pattern.
3176 To send feedback, either:
3177 </p>
3178 <ul>
3179 <li>send email to findbugs@cs.umd.edu</li>
3180 <li>file a bug report: <a href="http://findbugs.sourceforge.net/reportingBugs.html">http://findbugs.sourceforge.net/reportingBugs.html</a></li>
3181 </ul>
3182
3183 <p>
3184 In particular,
3185 the false-positive suppression heuristics for this
3186 bug pattern have not been extensively tuned, so
3187 reports about false positives are helpful to us.
3188 </p>
3189
3190 <p>
3191 See Weimer and Necula, <i>Finding and Preventing Run-Time Error Handling Mistakes</i>, for
3192 a description of the analysis technique.
3193 </p>
3194
3195
3196 <h3><a name="DM_CONVERT_CASE">Dm: Consider using Locale parameterized version of invoked method (DM_CONVERT_CASE)</a></h3>
3197
3198
3199 <p> A String is being converted to upper or lowercase, using the platform's default encoding. This may
3200 result in improper conversions when used with international characters. Use the </p>
3201 <ul>
3202 <li>String.toUpperCase( Locale l )</li>
3203 <li>String.toLowerCase( Locale l )</li>
3204 </ul>
3205 <p>versions instead.</p>
3206
3207
3208 <h3><a name="DM_DEFAULT_ENCODING">Dm: Reliance on default encoding (DM_DEFAULT_ENCODING)</a></h3>
3209
3210
3211 <p> Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. </p>
3212
3213
3214 <h3><a name="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">DP: Classloaders should only be created inside doPrivileged block (DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED)</a></h3>
3215
3216
3217 <p> This code creates a classloader, which needs permission if a security manage is installed.
3218 If this code might be invoked by code that does not
3219 have security permissions, then the classloader creation needs to occur inside a doPrivileged block.</p>
3220
3221
3222 <h3><a name="DP_DO_INSIDE_DO_PRIVILEGED">DP: Method invoked that should be only be invoked inside a doPrivileged block (DP_DO_INSIDE_DO_PRIVILEGED)</a></h3>
3223
3224
3225 <p> This code invokes a method that requires a security permission check.
3226 If this code will be granted security permissions, but might be invoked by code that does not
3227 have security permissions, then the invocation needs to occur inside a doPrivileged block.</p>
3228
3229
3230 <h3><a name="EI_EXPOSE_REP">EI: May expose internal representation by returning reference to mutable object (EI_EXPOSE_REP)</a></h3>
3231
3232
3233 <p> Returning a reference to a mutable object value stored in one of the object's fields
3234 exposes the internal representation of the object.&nbsp;
3235 If instances
3236 are accessed by untrusted code, and unchecked changes to
3237 the mutable object would compromise security or other
3238 important properties, you will need to do something different.
3239 Returning a new copy of the object is better approach in many situations.</p>
3240
3241
3242 <h3><a name="EI_EXPOSE_REP2">EI2: May expose internal representation by incorporating reference to mutable object (EI_EXPOSE_REP2)</a></h3>
3243
3244
3245 <p> This code stores a reference to an externally mutable object into the
3246 internal representation of the object.&nbsp;
3247 If instances
3248 are accessed by untrusted code, and unchecked changes to
3249 the mutable object would compromise security or other
3250 important properties, you will need to do something different.
3251 Storing a copy of the object is better approach in many situations.</p>
3252
3253
3254 <h3><a name="FI_PUBLIC_SHOULD_BE_PROTECTED">FI: Finalizer should be protected, not public (FI_PUBLIC_SHOULD_BE_PROTECTED)</a></h3>
3255
3256
3257 <p> A class's <code>finalize()</code> method should have protected access,
3258 not public.</p>
3259
3260
3261 <h3><a name="EI_EXPOSE_STATIC_REP2">MS: May expose internal static state by storing a mutable object into a static field (EI_EXPOSE_STATIC_REP2)</a></h3>
3262
3263
3264 <p> This code stores a reference to an externally mutable object into a static
3265 field.
3266 If unchecked changes to
3267 the mutable object would compromise security or other
3268 important properties, you will need to do something different.
3269 Storing a copy of the object is better approach in many situations.</p>
3270
3271
3272 <h3><a name="MS_CANNOT_BE_FINAL">MS: Field isn't final and can't be protected from malicious code (MS_CANNOT_BE_FINAL)</a></h3>
3273
3274
3275 <p>
3276 A mutable static field could be changed by malicious code or
3277 by accident from another package.
3278 Unfortunately, the way the field is used doesn't allow
3279 any easy fix to this problem.</p>
3280
3281
3282 <h3><a name="MS_EXPOSE_REP">MS: Public static method may expose internal representation by returning array (MS_EXPOSE_REP)</a></h3>
3283
3284
3285 <p> A public static method returns a reference to
3286 an array that is part of the static state of the class.
3287 Any code that calls this method can freely modify
3288 the underlying array.
3289 One fix is to return a copy of the array.</p>
3290
3291
3292 <h3><a name="MS_FINAL_PKGPROTECT">MS: Field should be both final and package protected (MS_FINAL_PKGPROTECT)</a></h3>
3293
3294
3295 <p>
3296 A mutable static field could be changed by malicious code or
3297 by accident from another package.
3298 The field could be made package protected and/or made final
3299 to avoid
3300 this vulnerability.</p>
3301
3302
3303 <h3><a name="MS_MUTABLE_ARRAY">MS: Field is a mutable array (MS_MUTABLE_ARRAY)</a></h3>
3304
3305
3306 <p> A final static field references an array
3307 and can be accessed by malicious code or
3308 by accident from another package.
3309 This code can freely modify the contents of the array.</p>
3310
3311
3312 <h3><a name="MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable (MS_MUTABLE_HASHTABLE)</a></h3>
3313
3314
3315 <p>A final static field references a Hashtable
3316 and can be accessed by malicious code or
3317 by accident from another package.
3318 This code can freely modify the contents of the Hashtable.</p>
3319
3320
3321 <h3><a name="MS_OOI_PKGPROTECT">MS: Field should be moved out of an interface and made package protected (MS_OOI_PKGPROTECT)</a></h3>
3322
3323
3324 <p>
3325 A final static field that is
3326 defined in an interface references a mutable
3327 object such as an array or hashtable.
3328 This mutable object could
3329 be changed by malicious code or
3330 by accident from another package.
3331 To solve this, the field needs to be moved to a class
3332 and made package protected
3333 to avoid
3334 this vulnerability.</p>
3335
3336
3337 <h3><a name="MS_PKGPROTECT">MS: Field should be package protected (MS_PKGPROTECT)</a></h3>
3338
3339
3340 <p> A mutable static field could be changed by malicious code or
3341 by accident.
3342 The field could be made package protected to avoid
3343 this vulnerability.</p>
3344
3345
3346 <h3><a name="MS_SHOULD_BE_FINAL">MS: Field isn't final but should be (MS_SHOULD_BE_FINAL)</a></h3>
3347
3348
3349 <p>
3350 This static field public but not final, and
3351 could be changed by malicious code or
3352 by accident from another package.
3353 The field could be made final to avoid
3354 this vulnerability.</p>
3355
3356
3357 <h3><a name="MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS: Field isn't final but should be refactored to be so (MS_SHOULD_BE_REFACTORED_TO_BE_FINAL)</a></h3>
3358
3359
3360 <p>
3361 This static field public but not final, and
3362 could be changed by malicious code or
3363 by accident from another package.
3364 The field could be made final to avoid
3365 this vulnerability. However, the static initializer contains more than one write
3366 to the field, so doing so will require some refactoring.
3367 </p>
3368
3369
3370 <h3><a name="AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION">AT: Sequence of calls to concurrent abstraction may not be atomic (AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION)</a></h3>
3371
3372
3373 <p>This code contains a sequence of calls to a concurrent abstraction
3374 (such as a concurrent hash map).
3375 These calls will not be executed atomically.
3376
3377
3378 <h3><a name="DC_DOUBLECHECK">DC: Possible double check of field (DC_DOUBLECHECK)</a></h3>
3379
3380
3381 <p> This method may contain an instance of double-checked locking.&nbsp;
3382 This idiom is not correct according to the semantics of the Java memory
3383 model.&nbsp; For more information, see the web page
3384 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html"
3385 >http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</p>
3386
3387
3388 <h3><a name="DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean (DL_SYNCHRONIZATION_ON_BOOLEAN)</a></h3>
3389
3390
3391 <p> The code synchronizes on a boxed primitive constant, such as an Boolean.</p>
3392 <pre>
3393 private static Boolean inited = Boolean.FALSE;
3394 ...
3395 synchronized(inited) {
3396 if (!inited) {
3397 init();
3398 inited = Boolean.TRUE;
3399 }
3400 }
3401 ...
3402 </pre>
3403 <p>Since there normally exist only two Boolean objects, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness
3404 and possible deadlock</p>
3405 <p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
3406
3407
3408 <h3><a name="DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: Synchronization on boxed primitive (DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE)</a></h3>
3409
3410
3411 <p> The code synchronizes on a boxed primitive constant, such as an Integer.</p>
3412 <pre>
3413 private static Integer count = 0;
3414 ...
3415 synchronized(count) {
3416 count++;
3417 }
3418 ...
3419 </pre>
3420 <p>Since Integer objects can be cached and shared,
3421 this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness
3422 and possible deadlock</p>
3423 <p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
3424
3425
3426 <h3><a name="DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: Synchronization on interned String (DL_SYNCHRONIZATION_ON_SHARED_CONSTANT)</a></h3>
3427
3428
3429 <p> The code synchronizes on interned String.</p>
3430 <pre>
3431 private static String LOCK = "LOCK";
3432 ...
3433 synchronized(LOCK) { ...}
3434 ...
3435 </pre>
3436 <p>Constant Strings are interned and shared across all other classes loaded by the JVM. Thus, this could
3437 is locking on something that other code might also be locking. This could result in very strange and hard to diagnose
3438 blocking and deadlock behavior. See <a href="http://www.javalobby.org/java/forums/t96352.html">http://www.javalobby.org/java/forums/t96352.html</a> and <a href="http://jira.codehaus.org/browse/JETTY-352">http://jira.codehaus.org/browse/JETTY-352</a>.
3439 </p>
3440 <p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
3441
3442
3443 <h3><a name="DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE">DL: Synchronization on boxed primitive values (DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE)</a></h3>
3444
3445
3446 <p> The code synchronizes on an apparently unshared boxed primitive,
3447 such as an Integer.</p>
3448 <pre>
3449 private static final Integer fileLock = new Integer(1);
3450 ...
3451 synchronized(fileLock) {
3452 .. do something ..
3453 }
3454 ...
3455 </pre>
3456 <p>It would be much better, in this code, to redeclare fileLock as</p>
3457 <pre>
3458 private static final Object fileLock = new Object();
3459 </pre>
3460 <p>
3461 The existing code might be OK, but it is confusing and a
3462 future refactoring, such as the "Remove Boxing" refactoring in IntelliJ,
3463 might replace this with the use of an interned Integer object shared
3464 throughout the JVM, leading to very confusing behavior and potential deadlock.
3465 </p>
3466
3467
3468 <h3><a name="DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wait() called on Condition (DM_MONITOR_WAIT_ON_CONDITION)</a></h3>
3469
3470
3471 <p>
3472 This method calls <code>wait()</code> on a
3473 <code>java.util.concurrent.locks.Condition</code> object.&nbsp;
3474 Waiting for a <code>Condition</code> should be done using one of the <code>await()</code>
3475 methods defined by the <code>Condition</code> interface.
3476 </p>
3477
3478
3479 <h3><a name="DM_USELESS_THREAD">Dm: A thread was created using the default empty run method (DM_USELESS_THREAD)</a></h3>
3480
3481
3482 <p>This method creates a thread without specifying a run method either by deriving from the Thread class, or
3483 by passing a Runnable object. This thread, then, does nothing but waste time.
3484 </p>
3485
3486
3487 <h3><a name="ESync_EMPTY_SYNC">ESync: Empty synchronized block (ESync_EMPTY_SYNC)</a></h3>
3488
3489
3490 <p> The code contains an empty synchronized block:</p>
3491 <pre>
3492 synchronized() {}
3493 </pre>
3494 <p>Empty synchronized blocks are far more subtle and hard to use correctly
3495 than most people recognize, and empty synchronized blocks
3496 are almost never a better solution
3497 than less contrived solutions.
3498 </p>
3499
3500
3501 <h3><a name="IS2_INCONSISTENT_SYNC">IS: Inconsistent synchronization (IS2_INCONSISTENT_SYNC)</a></h3>
3502
3503
3504 <p> The fields of this class appear to be accessed inconsistently with respect
3505 to synchronization.&nbsp; This bug report indicates that the bug pattern detector
3506 judged that
3507 </p>
3508 <ul>
3509 <li> The class contains a mix of locked and unlocked accesses,</li>
3510 <li> The class is <b>not</b> annotated as javax.annotation.concurrent.NotThreadSafe,</li>
3511 <li> At least one locked access was performed by one of the class's own methods, and</li>
3512 <li> The number of unsynchronized field accesses (reads and writes) was no more than
3513 one third of all accesses, with writes being weighed twice as high as reads</li>
3514 </ul>
3515
3516 <p> A typical bug matching this bug pattern is forgetting to synchronize
3517 one of the methods in a class that is intended to be thread-safe.</p>
3518
3519 <p> You can select the nodes labeled "Unsynchronized access" to show the
3520 code locations where the detector believed that a field was accessed
3521 without synchronization.</p>
3522
3523 <p> Note that there are various sources of inaccuracy in this detector;
3524 for example, the detector cannot statically detect all situations in which
3525 a lock is held.&nbsp; Also, even when the detector is accurate in
3526 distinguishing locked vs. unlocked accesses, the code in question may still
3527 be correct.</p>
3528
3529
3530
3531 <h3><a name="IS_FIELD_NOT_GUARDED">IS: Field not guarded against concurrent access (IS_FIELD_NOT_GUARDED)</a></h3>
3532
3533
3534 <p> This field is annotated with net.jcip.annotations.GuardedBy or javax.annotation.concurrent.GuardedBy,
3535 but can be accessed in a way that seems to violate those annotations.</p>
3536
3537
3538 <h3><a name="JLM_JSR166_LOCK_MONITORENTER">JLM: Synchronization performed on Lock (JLM_JSR166_LOCK_MONITORENTER)</a></h3>
3539
3540
3541 <p> This method performs synchronization an object that implements
3542 java.util.concurrent.locks.Lock. Such an object is locked/unlocked
3543 using
3544 <code>acquire()</code>/<code>release()</code> rather
3545 than using the <code>synchronized (...)</code> construct.
3546 </p>
3547
3548
3549 <h3><a name="JLM_JSR166_UTILCONCURRENT_MONITORENTER">JLM: Synchronization performed on util.concurrent instance (JLM_JSR166_UTILCONCURRENT_MONITORENTER)</a></h3>
3550
3551
3552 <p> This method performs synchronization an object that is an instance of
3553 a class from the java.util.concurrent package (or its subclasses). Instances
3554 of these classes have their own concurrency control mechanisms that are orthogonal to
3555 the synchronization provided by the Java keyword <code>synchronized</code>. For example,
3556 synchronizing on an <code>AtomicBoolean</code> will not prevent other threads
3557 from modifying the <code>AtomicBoolean</code>.</p>
3558 <p>Such code may be correct, but should be carefully reviewed and documented,
3559 and may confuse people who have to maintain the code at a later date.
3560 </p>
3561
3562
3563 <h3><a name="JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">JLM: Using monitor style wait methods on util.concurrent abstraction (JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT)</a></h3>
3564
3565
3566 <p> This method calls
3567 <code>wait()</code>,
3568 <code>notify()</code> or
3569 <code>notifyAll()()</code>
3570 on an object that also provides an
3571 <code>await()</code>,
3572 <code>signal()</code>,
3573 <code>signalAll()</code> method (such as util.concurrent Condition objects).
3574 This probably isn't what you want, and even if you do want it, you should consider changing
3575 your design, as other developers will find it exceptionally confusing.
3576 </p>
3577
3578
3579 <h3><a name="LI_LAZY_INIT_STATIC">LI: Incorrect lazy initialization of static field (LI_LAZY_INIT_STATIC)</a></h3>
3580
3581
3582 <p> This method contains an unsynchronized lazy initialization of a non-volatile static field.
3583 Because the compiler or processor may reorder instructions,
3584 threads are not guaranteed to see a completely initialized object,
3585 <em>if the method can be called by multiple threads</em>.
3586 You can make the field volatile to correct the problem.
3587 For more information, see the
3588 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/">Java Memory Model web site</a>.
3589 </p>
3590
3591
3592 <h3><a name="LI_LAZY_INIT_UPDATE_STATIC">LI: Incorrect lazy initialization and update of static field (LI_LAZY_INIT_UPDATE_STATIC)</a></h3>
3593
3594
3595 <p> This method contains an unsynchronized lazy initialization of a static field.
3596 After the field is set, the object stored into that location is further updated or accessed.
3597 The setting of the field is visible to other threads as soon as it is set. If the
3598 futher accesses in the method that set the field serve to initialize the object, then
3599 you have a <em>very serious</em> multithreading bug, unless something else prevents
3600 any other thread from accessing the stored object until it is fully initialized.
3601 </p>
3602 <p>Even if you feel confident that the method is never called by multiple
3603 threads, it might be better to not set the static field until the value
3604 you are setting it to is fully populated/initialized.
3605
3606
3607 <h3><a name="ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD">ML: Synchronization on field in futile attempt to guard that field (ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD)</a></h3>
3608
3609
3610 <p> This method synchronizes on a field in what appears to be an attempt
3611 to guard against simultaneous updates to that field. But guarding a field
3612 gets a lock on the referenced object, not on the field. This may not
3613 provide the mutual exclusion you need, and other threads might
3614 be obtaining locks on the referenced objects (for other purposes). An example
3615 of this pattern would be:</p>
3616 <pre>
3617 private Long myNtfSeqNbrCounter = new Long(0);
3618 private Long getNotificationSequenceNumber() {
3619 Long result = null;
3620 synchronized(myNtfSeqNbrCounter) {
3621 result = new Long(myNtfSeqNbrCounter.longValue() + 1);
3622 myNtfSeqNbrCounter = new Long(result.longValue());
3623 }
3624 return result;
3625 }
3626 </pre>
3627
3628
3629 <h3><a name="ML_SYNC_ON_UPDATED_FIELD">ML: Method synchronizes on an updated field (ML_SYNC_ON_UPDATED_FIELD)</a></h3>
3630
3631
3632 <p> This method synchronizes on an object
3633 referenced from a mutable field.
3634 This is unlikely to have useful semantics, since different
3635 threads may be synchronizing on different objects.</p>
3636
3637
3638 <h3><a name="MSF_MUTABLE_SERVLET_FIELD">MSF: Mutable servlet field (MSF_MUTABLE_SERVLET_FIELD)</a></h3>
3639
3640
3641 <p>A web server generally only creates one instance of servlet or jsp class (i.e., treats
3642 the class as a Singleton),
3643 and will
3644 have multiple threads invoke methods on that instance to service multiple
3645 simultaneous requests.
3646 Thus, having a mutable instance field generally creates race conditions.
3647
3648
3649 <h3><a name="MWN_MISMATCHED_NOTIFY">MWN: Mismatched notify() (MWN_MISMATCHED_NOTIFY)</a></h3>
3650
3651
3652 <p> This method calls Object.notify() or Object.notifyAll() without obviously holding a lock
3653 on the object.&nbsp; Calling notify() or notifyAll() without a lock held will result in
3654 an <code>IllegalMonitorStateException</code> being thrown.</p>
3655
3656
3657 <h3><a name="MWN_MISMATCHED_WAIT">MWN: Mismatched wait() (MWN_MISMATCHED_WAIT)</a></h3>
3658
3659
3660 <p> This method calls Object.wait() without obviously holding a lock
3661 on the object.&nbsp; Calling wait() without a lock held will result in
3662 an <code>IllegalMonitorStateException</code> being thrown.</p>
3663
3664
3665 <h3><a name="NN_NAKED_NOTIFY">NN: Naked notify (NN_NAKED_NOTIFY)</a></h3>
3666
3667
3668 <p> A call to <code>notify()</code> or <code>notifyAll()</code>
3669 was made without any (apparent) accompanying
3670 modification to mutable object state.&nbsp; In general, calling a notify
3671 method on a monitor is done because some condition another thread is
3672 waiting for has become true.&nbsp; However, for the condition to be meaningful,
3673 it must involve a heap object that is visible to both threads.</p>
3674
3675 <p> This bug does not necessarily indicate an error, since the change to
3676 mutable object state may have taken place in a method which then called
3677 the method containing the notification.</p>
3678
3679
3680 <h3><a name="NP_SYNC_AND_NULL_CHECK_FIELD">NP: Synchronize and null check on the same field. (NP_SYNC_AND_NULL_CHECK_FIELD)</a></h3>
3681
3682
3683 <p>Since the field is synchronized on, it seems not likely to be null.
3684 If it is null and then synchronized on a NullPointerException will be
3685 thrown and the check would be pointless. Better to synchronize on
3686 another field.</p>
3687
3688
3689
3690 <h3><a name="NO_NOTIFY_NOT_NOTIFYALL">No: Using notify() rather than notifyAll() (NO_NOTIFY_NOT_NOTIFYALL)</a></h3>
3691
3692
3693 <p> This method calls <code>notify()</code> rather than <code>notifyAll()</code>.&nbsp;
3694 Java monitors are often used for multiple conditions.&nbsp; Calling <code>notify()</code>
3695 only wakes up one thread, meaning that the thread woken up might not be the
3696 one waiting for the condition that the caller just satisfied.</p>
3697
3698
3699 <h3><a name="RS_READOBJECT_SYNC">RS: Class's readObject() method is synchronized (RS_READOBJECT_SYNC)</a></h3>
3700
3701
3702 <p> This serializable class defines a <code>readObject()</code> which is
3703 synchronized.&nbsp; By definition, an object created by deserialization
3704 is only reachable by one thread, and thus there is no need for
3705 <code>readObject()</code> to be synchronized.&nbsp; If the <code>readObject()</code>
3706 method itself is causing the object to become visible to another thread,
3707 that is an example of very dubious coding style.</p>
3708
3709
3710 <h3><a name="RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED">RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused (RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED)</a></h3>
3711
3712
3713 The <code>putIfAbsent</code> method is typically used to ensure that a
3714 single value is associated with a given key (the first value for which put
3715 if absent succeeds).
3716 If you ignore the return value and retain a reference to the value passed in,
3717 you run the risk of retaining a value that is not the one that is associated with the key in the map.
3718 If it matters which one you use and you use the one that isn't stored in the map,
3719 your program will behave incorrectly.
3720
3721
3722 <h3><a name="RU_INVOKE_RUN">Ru: Invokes run on a thread (did you mean to start it instead?) (RU_INVOKE_RUN)</a></h3>
3723
3724
3725 <p> This method explicitly invokes <code>run()</code> on an object.&nbsp;
3726 In general, classes implement the <code>Runnable</code> interface because
3727 they are going to have their <code>run()</code> method invoked in a new thread,
3728 in which case <code>Thread.start()</code> is the right method to call.</p>
3729
3730
3731 <h3><a name="SC_START_IN_CTOR">SC: Constructor invokes Thread.start() (SC_START_IN_CTOR)</a></h3>
3732
3733
3734 <p> The constructor starts a thread. This is likely to be wrong if
3735 the class is ever extended/subclassed, since the thread will be started
3736 before the subclass constructor is started.</p>
3737
3738
3739 <h3><a name="SP_SPIN_ON_FIELD">SP: Method spins on field (SP_SPIN_ON_FIELD)</a></h3>
3740
3741
3742 <p> This method spins in a loop which reads a field.&nbsp; The compiler
3743 may legally hoist the read out of the loop, turning the code into an
3744 infinite loop.&nbsp; The class should be changed so it uses proper
3745 synchronization (including wait and notify calls).</p>
3746
3747
3748 <h3><a name="STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE">STCAL: Call to static Calendar (STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE)</a></h3>
3749
3750
3751 <p>Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use.
3752 The detector has found a call to an instance of Calendar that has been obtained via a static
3753 field. This looks suspicous.</p>
3754 <p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
3755 and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
3756
3757
3758 <h3><a name="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE">STCAL: Call to static DateFormat (STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE)</a></h3>
3759
3760
3761 <p>As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use.
3762 The detector has found a call to an instance of DateFormat that has been obtained via a static
3763 field. This looks suspicous.</p>
3764 <p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
3765 and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
3766
3767
3768 <h3><a name="STCAL_STATIC_CALENDAR_INSTANCE">STCAL: Static Calendar field (STCAL_STATIC_CALENDAR_INSTANCE)</a></h3>
3769
3770
3771 <p>Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use.
3772 Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the
3773 application. Under 1.4 problems seem to surface less often than under Java 5 where you will probably see
3774 random ArrayIndexOutOfBoundsExceptions or IndexOutOfBoundsExceptions in sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate().</p>
3775 <p>You may also experience serialization problems.</p>
3776 <p>Using an instance field is recommended.</p>
3777 <p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
3778 and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
3779
3780
3781 <h3><a name="STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE">STCAL: Static DateFormat (STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE)</a></h3>
3782
3783
3784 <p>As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use.
3785 Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the
3786 application.</p>
3787 <p>You may also experience serialization problems.</p>
3788 <p>Using an instance field is recommended.</p>
3789 <p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
3790 and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
3791
3792
3793 <h3><a name="SWL_SLEEP_WITH_LOCK_HELD">SWL: Method calls Thread.sleep() with a lock held (SWL_SLEEP_WITH_LOCK_HELD)</a></h3>
3794
3795
3796 <p>
3797 This method calls Thread.sleep() with a lock held. This may result
3798 in very poor performance and scalability, or a deadlock, since other threads may
3799 be waiting to acquire the lock. It is a much better idea to call
3800 wait() on the lock, which releases the lock and allows other threads
3801 to run.
3802 </p>
3803
3804
3805 <h3><a name="TLW_TWO_LOCK_WAIT">TLW: Wait with two locks held (TLW_TWO_LOCK_WAIT)</a></h3>
3806
3807
3808 <p> Waiting on a monitor while two locks are held may cause
3809 deadlock.
3810 &nbsp;
3811 Performing a wait only releases the lock on the object
3812 being waited on, not any other locks.
3813 &nbsp;
3814 This not necessarily a bug, but is worth examining
3815 closely.</p>
3816
3817
3818 <h3><a name="UG_SYNC_SET_UNSYNC_GET">UG: Unsynchronized get method, synchronized set method (UG_SYNC_SET_UNSYNC_GET)</a></h3>
3819
3820
3821 <p> This class contains similarly-named get and set
3822 methods where the set method is synchronized and the get method is not.&nbsp;
3823 This may result in incorrect behavior at runtime, as callers of the get
3824 method will not necessarily see a consistent state for the object.&nbsp;
3825 The get method should be made synchronized.</p>
3826
3827
3828 <h3><a name="UL_UNRELEASED_LOCK">UL: Method does not release lock on all paths (UL_UNRELEASED_LOCK)</a></h3>
3829
3830
3831 <p> This method acquires a JSR-166 (<code>java.util.concurrent</code>) lock,
3832 but does not release it on all paths out of the method. In general, the correct idiom
3833 for using a JSR-166 lock is:
3834 </p>
3835 <pre>
3836 Lock l = ...;
3837 l.lock();
3838 try {
3839 // do something
3840 } finally {
3841 l.unlock();
3842 }
3843 </pre>
3844
3845
3846 <h3><a name="UL_UNRELEASED_LOCK_EXCEPTION_PATH">UL: Method does not release lock on all exception paths (UL_UNRELEASED_LOCK_EXCEPTION_PATH)</a></h3>
3847
3848
3849 <p> This method acquires a JSR-166 (<code>java.util.concurrent</code>) lock,
3850 but does not release it on all exception paths out of the method. In general, the correct idiom
3851 for using a JSR-166 lock is:
3852 </p>
3853 <pre>
3854 Lock l = ...;
3855 l.lock();
3856 try {
3857 // do something
3858 } finally {
3859 l.unlock();
3860 }
3861 </pre>
3862
3863
3864 <h3><a name="UW_UNCOND_WAIT">UW: Unconditional wait (UW_UNCOND_WAIT)</a></h3>
3865
3866
3867 <p> This method contains a call to <code>java.lang.Object.wait()</code> which
3868 is not guarded by conditional control flow.&nbsp; The code should
3869 verify that condition it intends to wait for is not already satisfied
3870 before calling wait; any previous notifications will be ignored.
3871 </p>
3872
3873
3874 <h3><a name="VO_VOLATILE_INCREMENT">VO: An increment to a volatile field isn't atomic (VO_VOLATILE_INCREMENT)</a></h3>
3875
3876
3877 <p>This code increments a volatile field. Increments of volatile fields aren't
3878 atomic. If more than one thread is incrementing the field at the same time,
3879 increments could be lost.
3880 </p>
3881
3882
3883 <h3><a name="VO_VOLATILE_REFERENCE_TO_ARRAY">VO: A volatile reference to an array doesn't treat the array elements as volatile (VO_VOLATILE_REFERENCE_TO_ARRAY)</a></h3>
3884
3885
3886 <p>This declares a volatile reference to an array, which might not be what
3887 you want. With a volatile reference to an array, reads and writes of
3888 the reference to the array are treated as volatile, but the array elements
3889 are non-volatile. To get volatile array elements, you will need to use
3890 one of the atomic array classes in java.util.concurrent (provided
3891 in Java 5.0).</p>
3892
3893
3894 <h3><a name="WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL">WL: Synchronization on getClass rather than class literal (WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL)</a></h3>
3895
3896
3897 <p>
3898 This instance method synchronizes on <code>this.getClass()</code>. If this class is subclassed,
3899 subclasses will synchronize on the class object for the subclass, which isn't likely what was intended.
3900 For example, consider this code from java.awt.Label:</p>
3901 <pre>
3902 private static final String base = "label";
3903 private static int nameCounter = 0;
3904 String constructComponentName() {
3905 synchronized (getClass()) {
3906 return base + nameCounter++;
3907 }
3908 }
3909 </pre>
3910 <p>Subclasses of <code>Label</code> won't synchronize on the same subclass, giving rise to a datarace.
3911 Instead, this code should be synchronizing on <code>Label.class</code></p>
3912 <pre>
3913 private static final String base = "label";
3914 private static int nameCounter = 0;
3915 String constructComponentName() {
3916 synchronized (Label.class) {
3917 return base + nameCounter++;
3918 }
3919 }
3920 </pre>
3921 <p>Bug pattern contributed by Jason Mehrens</p>
3922
3923
3924 <h3><a name="WS_WRITEOBJECT_SYNC">WS: Class's writeObject() method is synchronized but nothing else is (WS_WRITEOBJECT_SYNC)</a></h3>
3925
3926
3927 <p> This class has a <code>writeObject()</code> method which is synchronized;
3928 however, no other method of the class is synchronized.</p>
3929
3930
3931 <h3><a name="WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await() not in loop (WA_AWAIT_NOT_IN_LOOP)</a></h3>
3932
3933
3934 <p> This method contains a call to <code>java.util.concurrent.await()</code>
3935 (or variants)
3936 which is not in a loop.&nbsp; If the object is used for multiple conditions,
3937 the condition the caller intended to wait for might not be the one
3938 that actually occurred.</p>
3939
3940
3941 <h3><a name="WA_NOT_IN_LOOP">Wa: Wait not in loop (WA_NOT_IN_LOOP)</a></h3>
3942
3943
3944 <p> This method contains a call to <code>java.lang.Object.wait()</code>
3945 which is not in a loop.&nbsp; If the monitor is used for multiple conditions,
3946 the condition the caller intended to wait for might not be the one
3947 that actually occurred.</p>
3948
3949
3950 <h3><a name="BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive value is boxed and then immediately unboxed (BX_BOXING_IMMEDIATELY_UNBOXED)</a></h3>
3951
3952
3953 <p>A primitive is boxed, and then immediately unboxed. This probably is due to a manual
3954 boxing in a place where an unboxed value is required, thus forcing the compiler
3955 to immediately undo the work of the boxing.
3956 </p>
3957
3958
3959 <h3><a name="BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">Bx: Primitive value is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION)</a></h3>
3960
3961
3962 <p>A primitive boxed value constructed and then immediately converted into a different primitive type
3963 (e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coercion (e.g., <code>(int) d</code>).</p>
3964
3965
3966 <h3><a name="BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and then immediately reboxed (BX_UNBOXING_IMMEDIATELY_REBOXED)</a></h3>
3967
3968
3969 <p>A boxed value is unboxed and then immediately reboxed.
3970 </p>
3971
3972
3973 <h3><a name="DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a primitive (DM_BOXED_PRIMITIVE_FOR_PARSING)</a></h3>
3974
3975
3976 <p>A boxed primitive is created from a String, just to extract the unboxed primitive value.
3977 It is more efficient to just call the static parseXXX method.</p>
3978
3979
3980 <h3><a name="DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive just to call toString (DM_BOXED_PRIMITIVE_TOSTRING)</a></h3>
3981
3982
3983 <p>A boxed primitive is allocated just to call toString(). It is more effective to just use the static
3984 form of toString which takes the primitive value. So,</p>
3985 <table>
3986 <tr><th>Replace...</th><th>With this...</th></tr>
3987 <tr><td>new Integer(1).toString()</td><td>Integer.toString(1)</td></tr>
3988 <tr><td>new Long(1).toString()</td><td>Long.toString(1)</td></tr>
3989 <tr><td>new Float(1.0).toString()</td><td>Float.toString(1.0)</td></tr>
3990 <tr><td>new Double(1.0).toString()</td><td>Double.toString(1.0)</td></tr>
3991 <tr><td>new Byte(1).toString()</td><td>Byte.toString(1)</td></tr>
3992 <tr><td>new Short(1).toString()</td><td>Short.toString(1)</td></tr>
3993 <tr><td>new Boolean(true).toString()</td><td>Boolean.toString(true)</td></tr>
3994 </table>
3995
3996
3997 <h3><a name="DM_FP_NUMBER_CTOR">Bx: Method invokes inefficient floating-point Number constructor; use static valueOf instead (DM_FP_NUMBER_CTOR)</a></h3>
3998
3999
4000 <p>
4001 Using <code>new Double(double)</code> is guaranteed to always result in a new object whereas
4002 <code>Double.valueOf(double)</code> allows caching of values to be done by the compiler, class library, or JVM.
4003 Using of cached values avoids object allocation and the code will be faster.
4004 </p>
4005 <p>
4006 Unless the class must be compatible with JVMs predating Java 1.5,
4007 use either autoboxing or the <code>valueOf()</code> method when creating instances of <code>Double</code> and <code>Float</code>.
4008 </p>
4009
4010
4011 <h3><a name="DM_NUMBER_CTOR">Bx: Method invokes inefficient Number constructor; use static valueOf instead (DM_NUMBER_CTOR)</a></h3>
4012
4013
4014 <p>
4015 Using <code>new Integer(int)</code> is guaranteed to always result in a new object whereas
4016 <code>Integer.valueOf(int)</code> allows caching of values to be done by the compiler, class library, or JVM.
4017 Using of cached values avoids object allocation and the code will be faster.
4018 </p>
4019 <p>
4020 Values between -128 and 127 are guaranteed to have corresponding cached instances
4021 and using <code>valueOf</code> is approximately 3.5 times faster than using constructor.
4022 For values outside the constant range the performance of both styles is the same.
4023 </p>
4024 <p>
4025 Unless the class must be compatible with JVMs predating Java 1.5,
4026 use either autoboxing or the <code>valueOf()</code> method when creating instances of
4027 <code>Long</code>, <code>Integer</code>, <code>Short</code>, <code>Character</code>, and <code>Byte</code>.
4028 </p>
4029
4030
4031 <h3><a name="DMI_BLOCKING_METHODS_ON_URL">Dm: The equals and hashCode methods of URL are blocking (DMI_BLOCKING_METHODS_ON_URL)</a></h3>
4032
4033
4034 <p> The equals and hashCode
4035 method of URL perform domain name resolution, this can result in a big performance hit.
4036 See <a href="http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html">http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html</a> for more information.
4037 Consider using <code>java.net.URI</code> instead.
4038 </p>
4039
4040
4041 <h3><a name="DMI_COLLECTION_OF_URLS">Dm: Maps and sets of URLs can be performance hogs (DMI_COLLECTION_OF_URLS)</a></h3>
4042
4043
4044 <p> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode
4045 method of URL perform domain name resolution, this can result in a big performance hit.
4046 See <a href="http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html">http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html</a> for more information.
4047 Consider using <code>java.net.URI</code> instead.
4048 </p>
4049
4050
4051 <h3><a name="DM_BOOLEAN_CTOR">Dm: Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead (DM_BOOLEAN_CTOR)</a></h3>
4052
4053
4054 <p> Creating new instances of <code>java.lang.Boolean</code> wastes
4055 memory, since <code>Boolean</code> objects are immutable and there are
4056 only two useful values of this type.&nbsp; Use the <code>Boolean.valueOf()</code>
4057 method (or Java 1.5 autoboxing) to create <code>Boolean</code> objects instead.</p>
4058
4059
4060 <h3><a name="DM_GC">Dm: Explicit garbage collection; extremely dubious except in benchmarking code (DM_GC)</a></h3>
4061
4062
4063 <p> Code explicitly invokes garbage collection.
4064 Except for specific use in benchmarking, this is very dubious.</p>
4065 <p>In the past, situations where people have explicitly invoked
4066 the garbage collector in routines such as close or finalize methods
4067 has led to huge performance black holes. Garbage collection
4068 can be expensive. Any situation that forces hundreds or thousands
4069 of garbage collections will bring the machine to a crawl.</p>
4070
4071
4072 <h3><a name="DM_NEW_FOR_GETCLASS">Dm: Method allocates an object, only to get the class object (DM_NEW_FOR_GETCLASS)</a></h3>
4073
4074
4075 <p>This method allocates an object just to call getClass() on it, in order to
4076 retrieve the Class object for it. It is simpler to just access the .class property of the class.</p>
4077
4078
4079 <h3><a name="DM_NEXTINT_VIA_NEXTDOUBLE">Dm: Use the nextInt method of Random rather than nextDouble to generate a random integer (DM_NEXTINT_VIA_NEXTDOUBLE)</a></h3>
4080
4081
4082 <p>If <code>r</code> is a <code>java.util.Random</code>, you can generate a random number from <code>0</code> to <code>n-1</code>
4083 using <code>r.nextInt(n)</code>, rather than using <code>(int)(r.nextDouble() * n)</code>.
4084 </p>
4085 <p>The argument to nextInt must be positive. If, for example, you want to generate a random
4086 value from -99 to 0, use <code>-r.nextInt(100)</code>.
4087 </p>
4088
4089
4090 <h3><a name="DM_STRING_CTOR">Dm: Method invokes inefficient new String(String) constructor (DM_STRING_CTOR)</a></h3>
4091
4092
4093 <p> Using the <code>java.lang.String(String)</code> constructor wastes memory
4094 because the object so constructed will be functionally indistinguishable
4095 from the <code>String</code> passed as a parameter.&nbsp; Just use the
4096 argument <code>String</code> directly.</p>
4097
4098
4099 <h3><a name="DM_STRING_TOSTRING">Dm: Method invokes toString() method on a String (DM_STRING_TOSTRING)</a></h3>
4100
4101
4102 <p> Calling <code>String.toString()</code> is just a redundant operation.
4103 Just use the String.</p>
4104
4105
4106 <h3><a name="DM_STRING_VOID_CTOR">Dm: Method invokes inefficient new String() constructor (DM_STRING_VOID_CTOR)</a></h3>
4107
4108
4109 <p> Creating a new <code>java.lang.String</code> object using the
4110 no-argument constructor wastes memory because the object so created will
4111 be functionally indistinguishable from the empty string constant
4112 <code>""</code>.&nbsp; Java guarantees that identical string constants
4113 will be represented by the same <code>String</code> object.&nbsp; Therefore,
4114 you should just use the empty string constant directly.</p>
4115
4116
4117 <h3><a name="HSC_HUGE_SHARED_STRING_CONSTANT">HSC: Huge string constants is duplicated across multiple class files (HSC_HUGE_SHARED_STRING_CONSTANT)</a></h3>
4118
4119
4120 <p>
4121 A large String constant is duplicated across multiple class files.
4122 This is likely because a final field is initialized to a String constant, and the Java language
4123 mandates that all references to a final field from other classes be inlined into
4124 that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6447475">JDK bug 6447475</a>
4125 for a description of an occurrence of this bug in the JDK and how resolving it reduced
4126 the size of the JDK by 1 megabyte.
4127 </p>
4128
4129
4130 <h3><a name="ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses toArray() with zero-length array argument (ITA_INEFFICIENT_TO_ARRAY)</a></h3>
4131
4132
4133 <p> This method uses the toArray() method of a collection derived class, and passes
4134 in a zero-length prototype array argument. It is more efficient to use
4135 <code>myCollection.toArray(new Foo[myCollection.size()])</code>
4136 If the array passed in is big enough to store all of the
4137 elements of the collection, then it is populated and returned
4138 directly. This avoids the need to create a second array
4139 (by reflection) to return as the result.</p>
4140
4141
4142 <h3><a name="SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: Method concatenates strings using + in a loop (SBSC_USE_STRINGBUFFER_CONCATENATION)</a></h3>
4143
4144
4145 <p> The method seems to be building a String using concatenation in a loop.
4146 In each iteration, the String is converted to a StringBuffer/StringBuilder,
4147 appended to, and converted back to a String.
4148 This can lead to a cost quadratic in the number of iterations,
4149 as the growing string is recopied in each iteration. </p>
4150
4151 <p>Better performance can be obtained by using
4152 a StringBuffer (or StringBuilder in Java 1.5) explicitly.</p>
4153
4154 <p> For example:</p>
4155 <pre>
4156 // This is bad
4157 String s = "";
4158 for (int i = 0; i &lt; field.length; ++i) {
4159 s = s + field[i];
4160 }
4161
4162 // This is better
4163 StringBuffer buf = new StringBuffer();
4164 for (int i = 0; i &lt; field.length; ++i) {
4165 buf.append(field[i]);
4166 }
4167 String s = buf.toString();
4168 </pre>
4169
4170
4171 <h3><a name="SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a static inner class (SIC_INNER_SHOULD_BE_STATIC)</a></h3>
4172
4173
4174 <p> This class is an inner class, but does not use its embedded reference
4175 to the object which created it.&nbsp; This reference makes the instances
4176 of the class larger, and may keep the reference to the creator object
4177 alive longer than necessary.&nbsp; If possible, the class should be
4178 made static.
4179 </p>
4180
4181
4182 <h3><a name="SIC_INNER_SHOULD_BE_STATIC_ANON">SIC: Could be refactored into a named static inner class (SIC_INNER_SHOULD_BE_STATIC_ANON)</a></h3>
4183
4184
4185 <p> This class is an inner class, but does not use its embedded reference
4186 to the object which created it.&nbsp; This reference makes the instances
4187 of the class larger, and may keep the reference to the creator object
4188 alive longer than necessary.&nbsp; If possible, the class should be
4189 made into a <em>static</em> inner class. Since anonymous inner
4190 classes cannot be marked as static, doing this will require refactoring
4191 the inner class so that it is a named inner class.</p>
4192
4193
4194 <h3><a name="SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">SIC: Could be refactored into a static inner class (SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS)</a></h3>
4195
4196
4197 <p> This class is an inner class, but does not use its embedded reference
4198 to the object which created it except during construction of the
4199 inner object.&nbsp; This reference makes the instances
4200 of the class larger, and may keep the reference to the creator object
4201 alive longer than necessary.&nbsp; If possible, the class should be
4202 made into a <em>static</em> inner class. Since the reference to the
4203 outer object is required during construction of the inner instance,
4204 the inner class will need to be refactored so as to
4205 pass a reference to the outer instance to the constructor
4206 for the inner class.</p>
4207
4208
4209 <h3><a name="SS_SHOULD_BE_STATIC">SS: Unread field: should this field be static? (SS_SHOULD_BE_STATIC)</a></h3>
4210
4211
4212 <p> This class contains an instance final field that
4213 is initialized to a compile-time static value.
4214 Consider making the field static.</p>
4215
4216
4217 <h3><a name="UM_UNNECESSARY_MATH">UM: Method calls static Math class method on a constant value (UM_UNNECESSARY_MATH)</a></h3>
4218
4219
4220 <p> This method uses a static method from java.lang.Math on a constant value. This method's
4221 result in this case, can be determined statically, and is faster and sometimes more accurate to
4222 just use the constant. Methods detected are:
4223 </p>
4224 <table>
4225 <tr>
4226 <th>Method</th> <th>Parameter</th>
4227 </tr>
4228 <tr>
4229 <td>abs</td> <td>-any-</td>
4230 </tr>
4231 <tr>
4232 <td>acos</td> <td>0.0 or 1.0</td>
4233 </tr>
4234 <tr>
4235 <td>asin</td> <td>0.0 or 1.0</td>
4236 </tr>
4237 <tr>
4238 <td>atan</td> <td>0.0 or 1.0</td>
4239 </tr>
4240 <tr>
4241 <td>atan2</td> <td>0.0</td>
4242 </tr>
4243 <tr>
4244 <td>cbrt</td> <td>0.0 or 1.0</td>
4245 </tr>
4246 <tr>
4247 <td>ceil</td> <td>-any-</td>
4248 </tr>
4249 <tr>
4250 <td>cos</td> <td>0.0</td>
4251 </tr>
4252 <tr>
4253 <td>cosh</td> <td>0.0</td>
4254 </tr>
4255 <tr>
4256 <td>exp</td> <td>0.0 or 1.0</td>
4257 </tr>
4258 <tr>
4259 <td>expm1</td> <td>0.0</td>
4260 </tr>
4261 <tr>
4262 <td>floor</td> <td>-any-</td>
4263 </tr>
4264 <tr>
4265 <td>log</td> <td>0.0 or 1.0</td>
4266 </tr>
4267 <tr>
4268 <td>log10</td> <td>0.0 or 1.0</td>
4269 </tr>
4270 <tr>
4271 <td>rint</td> <td>-any-</td>
4272 </tr>
4273 <tr>
4274 <td>round</td> <td>-any-</td>
4275 </tr>
4276 <tr>
4277 <td>sin</td> <td>0.0</td>
4278 </tr>
4279 <tr>
4280 <td>sinh</td> <td>0.0</td>
4281 </tr>
4282 <tr>
4283 <td>sqrt</td> <td>0.0 or 1.0</td>
4284 </tr>
4285 <tr>
4286 <td>tan</td> <td>0.0</td>
4287 </tr>
4288 <tr>
4289 <td>tanh</td> <td>0.0</td>
4290 </tr>
4291 <tr>
4292 <td>toDegrees</td> <td>0.0 or 1.0</td>
4293 </tr>
4294 <tr>
4295 <td>toRadians</td> <td>0.0</td>
4296 </tr>
4297 </table>
4298
4299
4300 <h3><a name="UPM_UNCALLED_PRIVATE_METHOD">UPM: Private method is never called (UPM_UNCALLED_PRIVATE_METHOD)</a></h3>
4301
4302
4303 <p> This private method is never called. Although it is
4304 possible that the method will be invoked through reflection,
4305 it is more likely that the method is never used, and should be
4306 removed.
4307 </p>
4308
4309
4310 <h3><a name="URF_UNREAD_FIELD">UrF: Unread field (URF_UNREAD_FIELD)</a></h3>
4311
4312
4313 <p> This field is never read.&nbsp; Consider removing it from the class.</p>
4314
4315
4316 <h3><a name="UUF_UNUSED_FIELD">UuF: Unused field (UUF_UNUSED_FIELD)</a></h3>
4317
4318
4319 <p> This field is never used.&nbsp; Consider removing it from the class.</p>
4320
4321
4322 <h3><a name="WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use of keySet iterator instead of entrySet iterator (WMI_WRONG_MAP_ITERATOR)</a></h3>
4323
4324
4325 <p> This method accesses the value of a Map entry, using a key that was retrieved from
4326 a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the
4327 Map.get(key) lookup.</p>
4328
4329
4330 <h3><a name="DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded constant database password (DMI_CONSTANT_DB_PASSWORD)</a></h3>
4331
4332
4333 <p>This code creates a database connect using a hardcoded, constant password. Anyone with access to either the source code or the compiled code can
4334 easily learn the password.
4335 </p>
4336
4337
4338
4339 <h3><a name="DMI_EMPTY_DB_PASSWORD">Dm: Empty database password (DMI_EMPTY_DB_PASSWORD)</a></h3>
4340
4341
4342 <p>This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password.
4343 </p>
4344
4345
4346
4347 <h3><a name="HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP cookie formed from untrusted input (HRS_REQUEST_PARAMETER_TO_COOKIE)</a></h3>
4348
4349
4350 <p>This code constructs an HTTP Cookie using an untrusted HTTP parameter. If this cookie is added to an HTTP response, it will allow a HTTP response splitting
4351 vulnerability. See <a href="http://en.wikipedia.org/wiki/HTTP_response_splitting">http://en.wikipedia.org/wiki/HTTP_response_splitting</a>
4352 for more information.</p>
4353 <p>FindBugs looks only for the most blatant, obvious cases of HTTP response splitting.
4354 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4355 vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously
4356 consider using a commercial static analysis or pen-testing tool.
4357 </p>
4358
4359
4360
4361 <h3><a name="HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: HTTP Response splitting vulnerability (HRS_REQUEST_PARAMETER_TO_HTTP_HEADER)</a></h3>
4362
4363
4364 <p>This code directly writes an HTTP parameter to an HTTP header, which allows for a HTTP response splitting
4365 vulnerability. See <a href="http://en.wikipedia.org/wiki/HTTP_response_splitting">http://en.wikipedia.org/wiki/HTTP_response_splitting</a>
4366 for more information.</p>
4367 <p>FindBugs looks only for the most blatant, obvious cases of HTTP response splitting.
4368 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4369 vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously
4370 consider using a commercial static analysis or pen-testing tool.
4371 </p>
4372
4373
4374
4375 <h3><a name="PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute path traversal in servlet (PT_ABSOLUTE_PATH_TRAVERSAL)</a></h3>
4376
4377
4378 <p>The software uses an HTTP request parameter to construct a pathname that should be within a restricted directory,
4379 but it does not properly neutralize absolute path sequences such as "/abs/path" that can resolve to a location that is outside of that directory.
4380
4381 See <a href="http://cwe.mitre.org/data/definitions/36.html">http://cwe.mitre.org/data/definitions/36.html</a>
4382 for more information.</p>
4383 <p>FindBugs looks only for the most blatant, obvious cases of absolute path traversal.
4384 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4385 vulnerabilities that FindBugs doesn't report. If you are concerned about absolute path traversal, you should seriously
4386 consider using a commercial static analysis or pen-testing tool.
4387 </p>
4388
4389
4390
4391 <h3><a name="PT_RELATIVE_PATH_TRAVERSAL">PT: Relative path traversal in servlet (PT_RELATIVE_PATH_TRAVERSAL)</a></h3>
4392
4393
4394 <p>The software uses an HTTP request parameter to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.
4395
4396 See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org/data/definitions/23.html</a>
4397 for more information.</p>
4398 <p>FindBugs looks only for the most blatant, obvious cases of relative path traversal.
4399 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4400 vulnerabilities that FindBugs doesn't report. If you are concerned about relative path traversal, you should seriously
4401 consider using a commercial static analysis or pen-testing tool.
4402 </p>
4403
4404
4405
4406 <h3><a name="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQL: Nonconstant string passed to execute method on an SQL statement (SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE)</a></h3>
4407
4408
4409 <p>The method invokes the execute method on an SQL statement with a String that seems
4410 to be dynamically generated. Consider using
4411 a prepared statement instead. It is more efficient and less vulnerable to
4412 SQL injection attacks.
4413 </p>
4414
4415
4416 <h3><a name="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING">SQL: A prepared statement is generated from a nonconstant String (SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING)</a></h3>
4417
4418
4419 <p>The code creates an SQL prepared statement from a nonconstant String.
4420 If unchecked, tainted data from a user is used in building this String, SQL injection could
4421 be used to make the prepared statement do something unexpected and undesirable.
4422 </p>
4423
4424
4425 <h3><a name="XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JSP reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_JSP_WRITER)</a></h3>
4426
4427
4428 <p>This code directly writes an HTTP parameter to JSP output, which allows for a cross site scripting
4429 vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
4430 for more information.</p>
4431 <p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
4432 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
4433 vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
4434 consider using a commercial static analysis or pen-testing tool.
4435 </p>
4436
4437
4438 <h3><a name="XSS_REQUEST_PARAMETER_TO_SEND_ERROR">XSS: Servlet reflected cross site scripting vulnerability in error page (XSS_REQUEST_PARAMETER_TO_SEND_ERROR)</a></h3>
4439
4440
4441 <p>This code directly writes an HTTP parameter to a Server error page (using HttpServletResponse.sendError). Echoing this untrusted input allows
4442 for a reflected cross site scripting
4443 vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
4444 for more information.</p>
4445 <p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
4446 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
4447 vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
4448 consider using a commercial static analysis or pen-testing tool.
4449 </p>
4450
4451
4452
4453 <h3><a name="XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS: Servlet reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER)</a></h3>
4454
4455
4456 <p>This code directly writes an HTTP parameter to Servlet output, which allows for a reflected cross site scripting
4457 vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
4458 for more information.</p>
4459 <p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
4460 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
4461 vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
4462 consider using a commercial static analysis or pen-testing tool.
4463 </p>
4464
4465
4466
4467 <h3><a name="BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Questionable cast to abstract collection (BC_BAD_CAST_TO_ABSTRACT_COLLECTION)</a></h3>
4468
4469
4470 <p>
4471 This code casts a Collection to an abstract collection
4472 (such as <code>List</code>, <code>Set</code>, or <code>Map</code>).
4473 Ensure that you are guaranteed that the object is of the type
4474 you are casting to. If all you need is to be able
4475 to iterate through a collection, you don't need to cast it to a Set or List.
4476 </p>
4477
4478
4479 <h3><a name="BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Questionable cast to concrete collection (BC_BAD_CAST_TO_CONCRETE_COLLECTION)</a></h3>
4480
4481
4482 <p>
4483 This code casts an abstract collection (such as a Collection, List, or Set)
4484 to a specific concrete implementation (such as an ArrayList or HashSet).
4485 This might not be correct, and it may make your code fragile, since
4486 it makes it harder to switch to other concrete implementations at a future
4487 point. Unless you have a particular reason to do so, just use the abstract
4488 collection class.
4489 </p>
4490
4491
4492 <h3><a name="BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirmed cast (BC_UNCONFIRMED_CAST)</a></h3>
4493
4494
4495 <p>
4496 This cast is unchecked, and not all instances of the type casted from can be cast to
4497 the type it is being cast to. Check that your program logic ensures that this
4498 cast will not fail.
4499 </p>
4500
4501
4502 <h3><a name="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC: Unchecked/unconfirmed cast of return value from method (BC_UNCONFIRMED_CAST_OF_RETURN_VALUE)</a></h3>
4503
4504
4505 <p>
4506 This code performs an unchecked cast of the return value of a method.
4507 The code might be calling the method in such a way that the cast is guaranteed to be
4508 safe, but FindBugs is unable to verify that the cast is safe. Check that your program logic ensures that this
4509 cast will not fail.
4510 </p>
4511
4512
4513 <h3><a name="BC_VACUOUS_INSTANCEOF">BC: instanceof will always return true (BC_VACUOUS_INSTANCEOF)</a></h3>
4514
4515
4516 <p>
4517 This instanceof test will always return true (unless the value being tested is null).
4518 Although this is safe, make sure it isn't
4519 an indication of some misunderstanding or some other logic error.
4520 If you really want to test the value for being null, perhaps it would be clearer to do
4521 better to do a null test rather than an instanceof test.
4522 </p>
4523
4524
4525 <h3><a name="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSHIFT: Unsigned right shift cast to short/byte (ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT)</a></h3>
4526
4527
4528 <p>
4529 The code performs an unsigned right shift, whose result is then
4530 cast to a short or byte, which discards the upper bits of the result.
4531 Since the upper bits are discarded, there may be no difference between
4532 a signed and unsigned right shift (depending upon the size of the shift).
4533 </p>
4534
4535
4536 <h3><a name="CI_CONFUSED_INHERITANCE">CI: Class is final but declares protected field (CI_CONFUSED_INHERITANCE)</a></h3>
4537
4538
4539 <p>
4540 This class is declared to be final, but declares fields to be protected. Since the class
4541 is final, it can not be derived from, and the use of protected is confusing. The access
4542 modifier for the field should be changed to private or public to represent the true
4543 use for the field.
4544 </p>
4545
4546
4547 <h3><a name="DB_DUPLICATE_BRANCHES">DB: Method uses the same code for two branches (DB_DUPLICATE_BRANCHES)</a></h3>
4548
4549
4550 <p>
4551 This method uses the same code to implement two branches of a conditional branch.
4552 Check to ensure that this isn't a coding mistake.
4553 </p>
4554
4555
4556 <h3><a name="DB_DUPLICATE_SWITCH_CLAUSES">DB: Method uses the same code for two switch clauses (DB_DUPLICATE_SWITCH_CLAUSES)</a></h3>
4557
4558
4559 <p>
4560 This method uses the same code to implement two clauses of a switch statement.
4561 This could be a case of duplicate code, but it might also indicate
4562 a coding mistake.
4563 </p>
4564
4565
4566 <h3><a name="DLS_DEAD_LOCAL_STORE">DLS: Dead store to local variable (DLS_DEAD_LOCAL_STORE)</a></h3>
4567
4568
4569 <p>
4570 This instruction assigns a value to a local variable,
4571 but the value is not read or used in any subsequent instruction.
4572 Often, this indicates an error, because the value computed is never
4573 used.
4574 </p>
4575 <p>
4576 Note that Sun's javac compiler often generates dead stores for
4577 final local variables. Because FindBugs is a bytecode-based tool,
4578 there is no easy way to eliminate these false positives.
4579 </p>
4580
4581
4582 <h3><a name="DLS_DEAD_LOCAL_STORE_IN_RETURN">DLS: Useless assignment in return statement (DLS_DEAD_LOCAL_STORE_IN_RETURN)</a></h3>
4583
4584
4585 <p>
4586 This statement assigns to a local variable in a return statement. This assignment
4587 has effect. Please verify that this statement does the right thing.
4588 </p>
4589
4590
4591 <h3><a name="DLS_DEAD_LOCAL_STORE_OF_NULL">DLS: Dead store of null to local variable (DLS_DEAD_LOCAL_STORE_OF_NULL)</a></h3>
4592
4593
4594 <p>The code stores null into a local variable, and the stored value is not
4595 read. This store may have been introduced to assist the garbage collector, but
4596 as of Java SE 6.0, this is no longer needed or useful.
4597 </p>
4598
4599
4600 <h3><a name="DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS: Dead store to local variable that shadows field (DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD)</a></h3>
4601
4602
4603 <p>
4604 This instruction assigns a value to a local variable,
4605 but the value is not read or used in any subsequent instruction.
4606 Often, this indicates an error, because the value computed is never
4607 used. There is a field with the same name as the local variable. Did you
4608 mean to assign to that variable instead?
4609 </p>
4610
4611
4612 <h3><a name="DMI_HARDCODED_ABSOLUTE_FILENAME">DMI: Code contains a hard coded reference to an absolute pathname (DMI_HARDCODED_ABSOLUTE_FILENAME)</a></h3>
4613
4614
4615 <p>This code constructs a File object using a hard coded to an absolute pathname
4616 (e.g., <code>new File("/home/dannyc/workspace/j2ee/src/share/com/sun/enterprise/deployment");</code>
4617 </p>
4618
4619
4620 <h3><a name="DMI_NONSERIALIZABLE_OBJECT_WRITTEN">DMI: Non serializable object written to ObjectOutput (DMI_NONSERIALIZABLE_OBJECT_WRITTEN)</a></h3>
4621
4622
4623 <p>
4624 This code seems to be passing a non-serializable object to the ObjectOutput.writeObject method.
4625 If the object is, indeed, non-serializable, an error will result.
4626 </p>
4627
4628
4629 <h3><a name="DMI_USELESS_SUBSTRING">DMI: Invocation of substring(0), which returns the original value (DMI_USELESS_SUBSTRING)</a></h3>
4630
4631
4632 <p>
4633 This code invokes substring(0) on a String, which returns the original value.
4634 </p>
4635
4636
4637 <h3><a name="DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">Dm: Thread passed where Runnable expected (DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED)</a></h3>
4638
4639
4640 <p> A Thread object is passed as a parameter to a method where
4641 a Runnable is expected. This is rather unusual, and may indicate a logic error
4642 or cause unexpected behavior.
4643 </p>
4644
4645
4646 <h3><a name="EQ_DOESNT_OVERRIDE_EQUALS">Eq: Class doesn't override equals in superclass (EQ_DOESNT_OVERRIDE_EQUALS)</a></h3>
4647
4648
4649 <p> This class extends a class that defines an equals method and adds fields, but doesn't
4650 define an equals method itself. Thus, equality on instances of this class will
4651 ignore the identity of the subclass and the added fields. Be sure this is what is intended,
4652 and that you don't need to override the equals method. Even if you don't need to override
4653 the equals method, consider overriding it anyway to document the fact
4654 that the equals method for the subclass just return the result of
4655 invoking super.equals(o).
4656 </p>
4657
4658
4659 <h3><a name="EQ_UNUSUAL">Eq: Unusual equals method (EQ_UNUSUAL)</a></h3>
4660
4661
4662 <p> This class doesn't do any of the patterns we recognize for checking that the type of the argument
4663 is compatible with the type of the <code>this</code> object. There might not be anything wrong with
4664 this code, but it is worth reviewing.
4665 </p>
4666
4667
4668 <h3><a name="FE_FLOATING_POINT_EQUALITY">FE: Test for floating point equality (FE_FLOATING_POINT_EQUALITY)</a></h3>
4669
4670
4671 <p>
4672 This operation compares two floating point values for equality.
4673 Because floating point calculations may involve rounding,
4674 calculated float and double values may not be accurate.
4675 For values that must be precise, such as monetary values,
4676 consider using a fixed-precision type such as BigDecimal.
4677 For values that need not be precise, consider comparing for equality
4678 within some range, for example:
4679 <code>if ( Math.abs(x - y) &lt; .0000001 )</code>.
4680 See the Java Language Specification, section 4.2.4.
4681 </p>
4682
4683
4684 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">FS: Non-Boolean argument formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN)</a></h3>
4685
4686
4687 <p>
4688 An argument not of type Boolean is being formatted with a %b format specifier. This won't throw an
4689 exception; instead, it will print true for any nonnull value, and false for null.
4690 This feature of format strings is strange, and may not be what you intended.
4691 </p>
4692
4693
4694 <h3><a name="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">IA: Potentially ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD)</a></h3>
4695
4696
4697 <p>
4698 An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class.
4699 For example, you invoke <code>foo(17)</code>, which is defined in both a superclass and in an outer method.
4700 By the Java semantics,
4701 it will be resolved to invoke the inherited method, but this may not be want
4702 you intend.
4703 </p>
4704 <p>If you really intend to invoke the inherited method,
4705 invoke it by invoking the method on super (e.g., invoke super.foo(17)), and
4706 thus it will be clear to other readers of your code and to FindBugs
4707 that you want to invoke the inherited method, not the method in the outer class.
4708 </p>
4709 <p>If you call <code>this.foo(17)</code>, then the inherited method will be invoked. However, since FindBugs only looks at
4710 classfiles, it
4711 can't tell the difference between an invocation of <code>this.foo(17)</code> and <code>foo(17)</code>, it will still
4712 complain about a potential ambiguous invocation.
4713 </p>
4714
4715
4716 <h3><a name="IC_INIT_CIRCULARITY">IC: Initialization circularity (IC_INIT_CIRCULARITY)</a></h3>
4717
4718
4719 <p> A circularity was detected in the static initializers of the two
4720 classes referenced by the bug instance.&nbsp; Many kinds of unexpected
4721 behavior may arise from such circularity.</p>
4722
4723
4724 <h3><a name="ICAST_IDIV_CAST_TO_DOUBLE">ICAST: Integral division result cast to double or float (ICAST_IDIV_CAST_TO_DOUBLE)</a></h3>
4725
4726
4727 <p>
4728 This code casts the result of an integral division (e.g., int or long division)
4729 operation to double or
4730 float.
4731 Doing division on integers truncates the result
4732 to the integer value closest to zero. The fact that the result
4733 was cast to double suggests that this precision should have been retained.
4734 What was probably meant was to cast one or both of the operands to
4735 double <em>before</em> performing the division. Here is an example:
4736 </p>
4737 <blockquote>
4738 <pre>
4739 int x = 2;
4740 int y = 5;
4741 // Wrong: yields result 0.0
4742 double value1 = x / y;
4743
4744 // Right: yields result 0.4
4745 double value2 = x / (double) y;
4746 </pre>
4747 </blockquote>
4748
4749
4750 <h3><a name="ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">ICAST: Result of integer multiplication cast to long (ICAST_INTEGER_MULTIPLY_CAST_TO_LONG)</a></h3>
4751
4752
4753 <p>
4754 This code performs integer multiply and then converts the result to a long,
4755 as in:</p>
4756 <pre>
4757 long convertDaysToMilliseconds(int days) { return 1000*3600*24*days; }
4758 </pre>
4759 <p>
4760 If the multiplication is done using long arithmetic, you can avoid
4761 the possibility that the result will overflow. For example, you
4762 could fix the above code to:</p>
4763 <pre>
4764 long convertDaysToMilliseconds(int days) { return 1000L*3600*24*days; }
4765 </pre>
4766 or
4767 <pre>
4768 static final long MILLISECONDS_PER_DAY = 24L*3600*1000;
4769 long convertDaysToMilliseconds(int days) { return days * MILLISECONDS_PER_DAY; }
4770 </pre>
4771
4772
4773 <h3><a name="IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">IM: Computation of average could overflow (IM_AVERAGE_COMPUTATION_COULD_OVERFLOW)</a></h3>
4774
4775
4776 <p>The code computes the average of two integers using either division or signed right shift,
4777 and then uses the result as the index of an array.
4778 If the values being averaged are very large, this can overflow (resulting in the computation
4779 of a negative average). Assuming that the result is intended to be nonnegative, you
4780 can use an unsigned right shift instead. In other words, rather that using <code>(low+high)/2</code>,
4781 use <code>(low+high) &gt;&gt;&gt; 1</code>
4782 </p>
4783 <p>This bug exists in many earlier implementations of binary search and merge sort.
4784 Martin Buchholz <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6412541">found and fixed it</a>
4785 in the JDK libraries, and Joshua Bloch
4786 <a href="http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html">widely
4787 publicized the bug pattern</a>.
4788 </p>
4789
4790
4791 <h3><a name="IM_BAD_CHECK_FOR_ODD">IM: Check for oddness that won't work for negative numbers (IM_BAD_CHECK_FOR_ODD)</a></h3>
4792
4793
4794 <p>
4795 The code uses x % 2 == 1 to check to see if a value is odd, but this won't work
4796 for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check
4797 for oddness, consider using x &amp; 1 == 1, or x % 2 != 0.
4798 </p>
4799
4800
4801 <h3><a name="INT_BAD_REM_BY_1">INT: Integer remainder modulo 1 (INT_BAD_REM_BY_1)</a></h3>
4802
4803
4804 <p> Any expression (exp % 1) is guaranteed to always return zero.
4805 Did you mean (exp &amp; 1) or (exp % 2) instead?
4806 </p>
4807
4808
4809 <h3><a name="INT_VACUOUS_BIT_OPERATION">INT: Vacuous bit mask operation on integer value (INT_VACUOUS_BIT_OPERATION)</a></h3>
4810
4811
4812 <p> This is an integer bit operation (and, or, or exclusive or) that doesn't do any useful work
4813 (e.g., <code>v & 0xffffffff</code>).
4814
4815 </p>
4816
4817
4818 <h3><a name="INT_VACUOUS_COMPARISON">INT: Vacuous comparison of integer value (INT_VACUOUS_COMPARISON)</a></h3>
4819
4820
4821 <p> There is an integer comparison that always returns
4822 the same value (e.g., x &lt;= Integer.MAX_VALUE).
4823 </p>
4824
4825
4826 <h3><a name="MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">MTIA: Class extends Servlet class and uses instance variables (MTIA_SUSPECT_SERVLET_INSTANCE_FIELD)</a></h3>
4827
4828
4829 <p>
4830 This class extends from a Servlet class, and uses an instance member variable. Since only
4831 one instance of a Servlet class is created by the J2EE framework, and used in a
4832 multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider
4833 only using method local variables.
4834 </p>
4835
4836
4837 <h3><a name="MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">MTIA: Class extends Struts Action class and uses instance variables (MTIA_SUSPECT_STRUTS_INSTANCE_FIELD)</a></h3>
4838
4839
4840 <p>
4841 This class extends from a Struts Action class, and uses an instance member variable. Since only
4842 one instance of a struts Action class is created by the Struts framework, and used in a
4843 multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider
4844 only using method local variables. Only instance fields that are written outside of a monitor
4845 are reported.
4846 </p>
4847
4848
4849 <h3><a name="NP_DEREFERENCE_OF_READLINE_VALUE">NP: Dereference of the result of readLine() without nullcheck (NP_DEREFERENCE_OF_READLINE_VALUE)</a></h3>
4850
4851
4852 <p> The result of invoking readLine() is dereferenced without checking to see if the result is null. If there are no more lines of text
4853 to read, readLine() will return null and dereferencing that will generate a null pointer exception.
4854 </p>
4855
4856
4857 <h3><a name="NP_IMMEDIATE_DEREFERENCE_OF_READLINE">NP: Immediate dereference of the result of readLine() (NP_IMMEDIATE_DEREFERENCE_OF_READLINE)</a></h3>
4858
4859
4860 <p> The result of invoking readLine() is immediately dereferenced. If there are no more lines of text
4861 to read, readLine() will return null and dereferencing that will generate a null pointer exception.
4862 </p>
4863
4864
4865 <h3><a name="NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value (NP_LOAD_OF_KNOWN_NULL_VALUE)</a></h3>
4866
4867
4868 <p> The variable referenced at this point is known to be null due to an earlier
4869 check against null. Although this is valid, it might be a mistake (perhaps you
4870 intended to refer to a different variable, or perhaps the earlier check to see if the
4871 variable is null should have been a check to see if it was nonnull).
4872 </p>
4873
4874
4875 <h3><a name="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullness annotation on parameter (NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION)</a></h3>
4876
4877 <p>
4878 A method should always implement the contract of a method it overrides. Thus, if a method takes a parameter
4879 that is marked as @Nullable, you shouldn't override that method in a subclass with a method where that parameter is @Nonnull.
4880 Doing so violates the contract that the method should handle a null parameter.
4881 </p>
4882
4883 <h3><a name="NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Method relaxes nullness annotation on return value (NP_METHOD_RETURN_RELAXING_ANNOTATION)</a></h3>
4884
4885 <p>
4886 A method should always implement the contract of a method it overrides. Thus, if a method takes is annotated
4887 as returning a @Nonnull value,
4888 you shouldn't override that method in a subclass with a method annotated as returning a @Nullable or @CheckForNull value.
4889 Doing so violates the contract that the method shouldn't return null.
4890 </p>
4891
4892 <h3><a name="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP: Possible null pointer dereference due to return value of called method (NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE)</a></h3>
4893
4894
4895 <p> The return value from a method is dereferenced without a null check,
4896 and the return value of that method is one that should generally be checked
4897 for null. This may lead to a <code>NullPointerException</code> when the code is executed.
4898 </p>
4899
4900
4901 <h3><a name="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP: Possible null pointer dereference on branch that might be infeasible (NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE)</a></h3>
4902
4903
4904 <p> There is a branch of statement that, <em>if executed,</em> guarantees that
4905 a null value will be dereferenced, which
4906 would generate a <code>NullPointerException</code> when the code is executed.
4907 Of course, the problem might be that the branch or statement is infeasible and that
4908 the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.
4909 Due to the fact that this value had been previously tested for nullness,
4910 this is a definite possibility.
4911 </p>
4912
4913
4914 <h3><a name="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP: Parameter must be nonnull but is marked as nullable (NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE)</a></h3>
4915
4916
4917 <p> This parameter is always used in a way that requires it to be nonnull,
4918 but the parameter is explicitly annotated as being Nullable. Either the use
4919 of the parameter or the annotation is wrong.
4920 </p>
4921
4922
4923 <h3><a name="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP: Read of unwritten public or protected field (NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD)</a></h3>
4924
4925
4926 <p> The program is dereferencing a public or protected
4927 field that does not seem to ever have a non-null value written to it.
4928 Unless the field is initialized via some mechanism not seen by the analysis,
4929 dereferencing this value will generate a null pointer exception.
4930 </p>
4931
4932
4933 <h3><a name="NS_DANGEROUS_NON_SHORT_CIRCUIT">NS: Potentially dangerous use of non-short-circuit logic (NS_DANGEROUS_NON_SHORT_CIRCUIT)</a></h3>
4934
4935
4936 <p> This code seems to be using non-short-circuit logic (e.g., &amp;
4937 or |)
4938 rather than short-circuit logic (&amp;&amp; or ||). In addition,
4939 it seem possible that, depending on the value of the left hand side, you might not
4940 want to evaluate the right hand side (because it would have side effects, could cause an exception
4941 or could be expensive.</p>
4942 <p>
4943 Non-short-circuit logic causes both sides of the expression
4944 to be evaluated even when the result can be inferred from
4945 knowing the left-hand side. This can be less efficient and
4946 can result in errors if the left-hand side guards cases
4947 when evaluating the right-hand side can generate an error.
4948 </p>
4949
4950 <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.22.2">the Java
4951 Language Specification</a> for details
4952
4953 </p>
4954
4955
4956 <h3><a name="NS_NON_SHORT_CIRCUIT">NS: Questionable use of non-short-circuit logic (NS_NON_SHORT_CIRCUIT)</a></h3>
4957
4958
4959 <p> This code seems to be using non-short-circuit logic (e.g., &amp;
4960 or |)
4961 rather than short-circuit logic (&amp;&amp; or ||).
4962 Non-short-circuit logic causes both sides of the expression
4963 to be evaluated even when the result can be inferred from
4964 knowing the left-hand side. This can be less efficient and
4965 can result in errors if the left-hand side guards cases
4966 when evaluating the right-hand side can generate an error.
4967
4968 <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.22.2">the Java
4969 Language Specification</a> for details
4970
4971 </p>
4972
4973
4974 <h3><a name="PZLA_PREFER_ZERO_LENGTH_ARRAYS">PZLA: Consider returning a zero length array rather than null (PZLA_PREFER_ZERO_LENGTH_ARRAYS)</a></h3>
4975
4976
4977 <p> It is often a better design to
4978 return a length zero array rather than a null reference to indicate that there
4979 are no results (i.e., an empty list of results).
4980 This way, no explicit check for null is needed by clients of the method.</p>
4981
4982 <p>On the other hand, using null to indicate
4983 "there is no answer to this question" is probably appropriate.
4984 For example, <code>File.listFiles()</code> returns an empty list
4985 if given a directory containing no files, and returns null if the file
4986 is not a directory.</p>
4987
4988
4989 <h3><a name="QF_QUESTIONABLE_FOR_LOOP">QF: Complicated, subtle or wrong increment in for-loop (QF_QUESTIONABLE_FOR_LOOP)</a></h3>
4990
4991
4992 <p>Are you sure this for loop is incrementing the correct variable?
4993 It appears that another variable is being initialized and checked
4994 by the for loop.
4995 </p>
4996
4997
4998 <h3><a name="RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE">RCN: Redundant comparison of non-null value to null (RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE)</a></h3>
4999
5000
5001 <p> This method contains a reference known to be non-null with another reference
5002 known to be null.</p>
5003
5004
5005 <h3><a name="RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">RCN: Redundant comparison of two null values (RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES)</a></h3>
5006
5007
5008 <p> This method contains a redundant comparison of two references known to
5009 both be definitely null.</p>
5010
5011
5012 <h3><a name="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">RCN: Redundant nullcheck of value known to be non-null (RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE)</a></h3>
5013
5014
5015 <p> This method contains a redundant check of a known non-null value against
5016 the constant null.</p>
5017
5018
5019 <h3><a name="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN: Redundant nullcheck of value known to be null (RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE)</a></h3>
5020
5021
5022 <p> This method contains a redundant check of a known null value against
5023 the constant null.</p>
5024
5025
5026 <h3><a name="REC_CATCH_EXCEPTION">REC: Exception is caught when Exception is not thrown (REC_CATCH_EXCEPTION)</a></h3>
5027
5028
5029 <p>
5030 This method uses a try-catch block that catches Exception objects, but Exception is not
5031 thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to
5032 say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception
5033 each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well,
5034 masking potential bugs.
5035 </p>
5036 <p>A better approach is to either explicitly catch the specific exceptions that are thrown,
5037 or to explicitly catch RuntimeException exception, rethrow it, and then catch all non-Runtime Exceptions, as shown below:</p>
5038 <pre>
5039 try {
5040 ...
5041 } catch (RuntimeException e) {
5042 throw e;
5043 } catch (Exception e) {
5044 ... deal with all non-runtime exceptions ...
5045 }</pre>
5046
5047
5048 <h3><a name="RI_REDUNDANT_INTERFACES">RI: Class implements same interface as superclass (RI_REDUNDANT_INTERFACES)</a></h3>
5049
5050
5051 <p>
5052 This class declares that it implements an interface that is also implemented by a superclass.
5053 This is redundant because once a superclass implements an interface, all subclasses by default also
5054 implement this interface. It may point out that the inheritance hierarchy has changed since
5055 this class was created, and consideration should be given to the ownership of
5056 the interface's implementation.
5057 </p>
5058
5059
5060 <h3><a name="RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method checks to see if result of String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF)</a></h3>
5061
5062
5063 <p> The method invokes String.indexOf and checks to see if the result is positive or non-positive.
5064 It is much more typical to check to see if the result is negative or non-negative. It is
5065 positive only if the substring checked for occurs at some place other than at the beginning of
5066 the String.</p>
5067
5068
5069 <h3><a name="RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method discards result of readLine after checking if it is nonnull (RV_DONT_JUST_NULL_CHECK_READLINE)</a></h3>
5070
5071
5072 <p> The value returned by readLine is discarded after checking to see if the return
5073 value is non-null. In almost all situations, if the result is non-null, you will want
5074 to use that non-null value. Calling readLine again will give you a different line.</p>
5075
5076
5077 <h3><a name="RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative (RV_REM_OF_HASHCODE)</a></h3>
5078
5079
5080 <p> This code computes a hashCode, and then computes
5081 the remainder of that value modulo another value. Since the hashCode
5082 can be negative, the result of the remainder operation
5083 can also be negative. </p>
5084 <p> Assuming you want to ensure that the result of your computation is nonnegative,
5085 you may need to change your code.
5086 If you know the divisor is a power of 2,
5087 you can use a bitwise and operator instead (i.e., instead of
5088 using <code>x.hashCode()%n</code>, use <code>x.hashCode()&amp;(n-1)</code>.
5089 This is probably faster than computing the remainder as well.
5090 If you don't know that the divisor is a power of 2, take the absolute
5091 value of the result of the remainder operation (i.e., use
5092 <code>Math.abs(x.hashCode()%n)</code>
5093 </p>
5094
5095
5096 <h3><a name="RV_REM_OF_RANDOM_INT">RV: Remainder of 32-bit signed random integer (RV_REM_OF_RANDOM_INT)</a></h3>
5097
5098
5099 <p> This code generates a random signed integer and then computes
5100 the remainder of that value modulo another value. Since the random
5101 number can be negative, the result of the remainder operation
5102 can also be negative. Be sure this is intended, and strongly
5103 consider using the Random.nextInt(int) method instead.
5104 </p>
5105
5106
5107 <h3><a name="RV_RETURN_VALUE_IGNORED_INFERRED">RV: Method ignores return value, is this OK? (RV_RETURN_VALUE_IGNORED_INFERRED)</a></h3>
5108
5109
5110 <p>This code calls a method and ignores the return value. The return value
5111 is the same type as the type the method is invoked on, and from our analysis it looks
5112 like the return value might be important (e.g., like ignoring the
5113 return value of <code>String.toLowerCase()</code>).
5114 </p>
5115 <p>We are guessing that ignoring the return value might be a bad idea just from
5116 a simple analysis of the body of the method. You can use a @CheckReturnValue annotation
5117 to instruct FindBugs as to whether ignoring the return value of this method
5118 is important or acceptable.
5119 </p>
5120 <p>Please investigate this closely to decide whether it is OK to ignore the return value.
5121 </p>
5122
5123
5124 <h3><a name="SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field (SA_FIELD_DOUBLE_ASSIGNMENT)</a></h3>
5125
5126
5127 <p> This method contains a double assignment of a field; e.g.
5128 </p>
5129 <pre>
5130 int x,y;
5131 public void foo() {
5132 x = x = 17;
5133 }
5134 </pre>
5135 <p>Assigning to a field twice is useless, and may indicate a logic error or typo.</p>
5136
5137
5138 <h3><a name="SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assignment of local variable (SA_LOCAL_DOUBLE_ASSIGNMENT)</a></h3>
5139
5140
5141 <p> This method contains a double assignment of a local variable; e.g.
5142 </p>
5143 <pre>
5144 public void foo() {
5145 int x,y;
5146 x = x = 17;
5147 }
5148 </pre>
5149 <p>Assigning the same value to a variable twice is useless, and may indicate a logic error or typo.</p>
5150
5151
5152 <h3><a name="SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignment of local variable (SA_LOCAL_SELF_ASSIGNMENT)</a></h3>
5153
5154
5155 <p> This method contains a self assignment of a local variable; e.g.</p>
5156 <pre>
5157 public void foo() {
5158 int x = 3;
5159 x = x;
5160 }
5161 </pre>
5162 <p>
5163 Such assignments are useless, and may indicate a logic error or typo.
5164 </p>
5165
5166
5167 <h3><a name="SF_SWITCH_FALLTHROUGH">SF: Switch statement found where one case falls through to the next case (SF_SWITCH_FALLTHROUGH)</a></h3>
5168
5169
5170 <p> This method contains a switch statement where one case branch will fall through to the next case.
5171 Usually you need to end this case with a break or return.</p>
5172
5173
5174 <h3><a name="SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case is missing (SF_SWITCH_NO_DEFAULT)</a></h3>
5175
5176
5177 <p> This method contains a switch statement where default case is missing.
5178 Usually you need to provide a default case.</p>
5179 <p>Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if
5180 the default case is at the end of the switch statement and doesn't end with a break statement.
5181
5182
5183 <h3><a name="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST: Write to static field from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD)</a></h3>
5184
5185
5186 <p> This instance method writes to a static field. This is tricky to get
5187 correct if multiple instances are being manipulated,
5188 and generally bad practice.
5189 </p>
5190
5191
5192 <h3><a name="SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">Se: Private readResolve method not inherited by subclasses (SE_PRIVATE_READ_RESOLVE_NOT_INHERITED)</a></h3>
5193
5194
5195 <p> This class defines a private readResolve method. Since it is private, it won't be inherited by subclasses.
5196 This might be intentional and OK, but should be reviewed to ensure it is what is intended.
5197 </p>
5198
5199
5200 <h3><a name="SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS">Se: Transient field of class that isn't Serializable. (SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS)</a></h3>
5201
5202
5203 <p> The field is marked as transient, but the class isn't Serializable, so marking it as transient
5204 has absolutely no effect.
5205 This may be leftover marking from a previous version of the code in which the class was transient, or
5206 it may indicate a misunderstanding of how serialization works.
5207 </p>
5208
5209
5210 <h3><a name="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK">TQ: Value required to have type qualifier, but marked as unknown (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK)</a></h3>
5211
5212
5213 <p>
5214 A value is used in a way that requires it to be always be a value denoted by a type qualifier, but
5215 there is an explicit annotation stating that it is not known where the value is required to have that type qualifier.
5216 Either the usage or the annotation is incorrect.
5217 </p>
5218
5219
5220 <h3><a name="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value required to not have type qualifier, but marked as unknown (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK)</a></h3>
5221
5222
5223 <p>
5224 A value is used in a way that requires it to be never be a value denoted by a type qualifier, but
5225 there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier.
5226 Either the usage or the annotation is incorrect.
5227 </p>
5228
5229
5230 <h3><a name="UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow (UCF_USELESS_CONTROL_FLOW)</a></h3>
5231
5232
5233 <p> This method contains a useless control flow statement, where
5234 control flow continues onto the same place regardless of whether or not
5235 the branch is taken. For example,
5236 this is caused by having an empty statement
5237 block for an <code>if</code> statement:</p>
5238 <pre>
5239 if (argv.length == 0) {
5240 // TODO: handle this case
5241 }
5242 </pre>
5243
5244
5245 <h3><a name="UCF_USELESS_CONTROL_FLOW_NEXT_LINE">UCF: Useless control flow to next line (UCF_USELESS_CONTROL_FLOW_NEXT_LINE)</a></h3>
5246
5247
5248 <p> This method contains a useless control flow statement in which control
5249 flow follows to the same or following line regardless of whether or not
5250 the branch is taken.
5251 Often, this is caused by inadvertently using an empty statement as the
5252 body of an <code>if</code> statement, e.g.:</p>
5253 <pre>
5254 if (argv.length == 1);
5255 System.out.println("Hello, " + argv[0]);
5256 </pre>
5257
5258
5259 <h3><a name="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">UrF: Unread public/protected field (URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)</a></h3>
5260
5261
5262 <p> This field is never read.&nbsp;
5263 The field is public or protected, so perhaps
5264 it is intended to be used with classes not seen as part of the analysis. If not,
5265 consider removing it from the class.</p>
5266
5267
5268 <h3><a name="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UuF: Unused public or protected field (UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD)</a></h3>
5269
5270
5271 <p> This field is never used.&nbsp;
5272 The field is public or protected, so perhaps
5273 it is intended to be used with classes not seen as part of the analysis. If not,
5274 consider removing it from the class.</p>
5275
5276
5277 <h3><a name="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">UwF: Field not initialized in constructor but dereferenced without null check (UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR)</a></h3>
5278
5279
5280 <p> This field is never initialized within any constructor, and is therefore could be null after
5281 the object is constructed. Elsewhere, it is loaded and dereferenced without a null check.
5282 This could be a either an error or a questionable design, since
5283 it means a null pointer exception will be generated if that field is dereferenced
5284 before being initialized.
5285 </p>
5286
5287
5288 <h3><a name="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UwF: Unwritten public or protected field (UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD)</a></h3>
5289
5290
5291 <p> No writes were seen to this public/protected field.&nbsp; All reads of it will return the default
5292 value. Check for errors (should it have been initialized?), or remove it if it is useless.</p>
5293
5294
5295 <h3><a name="XFB_XML_FACTORY_BYPASS">XFB: Method directly allocates a specific implementation of xml interfaces (XFB_XML_FACTORY_BYPASS)</a></h3>
5296
5297
5298 <p>
5299 This method allocates a specific implementation of an xml interface. It is preferable to use
5300 the supplied factory classes to create these objects so that the implementation can be
5301 changed at runtime. See
5302 </p>
5303 <ul>
5304 <li>javax.xml.parsers.DocumentBuilderFactory</li>
5305 <li>javax.xml.parsers.SAXParserFactory</li>
5306 <li>javax.xml.transform.TransformerFactory</li>
5307 <li>org.w3c.dom.Document.create<i>XXXX</i></li>
5308 </ul>
5309 <p>for details.</p>
5310
5311
5312
5313
5314 <hr> <p>
5315 <script language="JavaScript" type="text/javascript">
5316 <!---//hide script from old browsers
5317 document.write( "Last updated "+ document.lastModified + "." );
5318 //end hiding contents --->
5319 </script>
5320 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
5321 <p>
5322 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
5323 </td></tr></table>
5324 </body></html>
doc/buggy-sm.png less more
Binary diff not shown
+0
-121
doc/contributing.html less more
0 <html>
1 <head>
2 <title>Contributing to FindBugs</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%"><tr>
9
10
11 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
12 <table width="100%" cellspacing="0" border="0">
13 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
14
15 <tr><td>&nbsp;</td></tr>
16
17 <tr><td><b>Docs and Info</b></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
30
31 <tr><td>&nbsp;</td></tr>
32
33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
34
35 <tr><td>&nbsp;</td></tr>
36
37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39 <tr><td>&nbsp;</td></tr>
40
41 <tr><td><b>Development</b></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
51 </table>
52 </td>
53
54 <td align="left" valign="top">
55
56 <h1>Contributing to FindBugs</h1>
57
58 <p> If you have a bug fix or feature enhancement you would like to contribute,
59 we would be happy to consider it for inclusion.</p>
60
61 <h2>Import FindBugs code as Eclipse projects</h2>
62
63 <p>The preferred way to get the FindBugs source code and create the patch is to use Eclipse + SVN.
64 You can easily import FindBugs code into Eclipse by following the steps described
65 here: <a href="http://code.google.com/p/findbugs/source/browse/trunk/eclipsePlugin/doc/building_findbugsplugin.txt">Import Eclipse projects</a>
66 .
67 </p>
68
69 <h2>Preparing a patch</h2>
70
71 <p> The best way to
72 send an enhancement is to create a patch against the latest code
73 in the FindBugs Subversion repository
74 at <a href="http://findbugs.googlecode.com/svn/trunk/">http://findbugs.googlecode.com/svn/trunk/</a>
75 (those people who have been given commit priviledges should use
76 <a href="https://findbugs.googlecode.com/svn/trunk/">http<b>s</b>://findbugs.googlecode.com/svn/trunk/</a>).
77 </p>
78
79 <p>To create a patch from Eclipse, please right click the [findbugs] or [findBugsEclipsePlugin] project
80 and choose [Team | Create Patch...] context menu.
81 </p>
82
83 <p> Please follow these guidelines when preparing your patch:</p>
84 <ul>
85 <li> <b>Use the same indentation style as the source file(s) you
86 are modifying</b>.&nbsp; In particular, please use tabs (not spaces)
87 to indent your code; one tab per indent level.
88 <li> If at all possible, avoid making whitespace modifications.
89 <li> Small patches are appreciated.
90 <li> If you are submitting a new bug detector, please submit a small
91 standalone source file that contains an instance of the
92 kind of bug the detector looks for.
93 </ul>
94
95 <p> Following these guidelines makes it much easier for us
96 to incorporate new code.
97
98 <h2>How to submit a patch</h2>
99
100 <p> Patches may be submitted through the
101 <a href="http://sourceforge.net/tracker/?atid=614695&group_id=96405&func=browse">Patches</a> tracker on the
102 <a href="http://sourceforge.net/projects/findbugs/">sourceforge project page</a>.
103
104
105 <hr> <p>
106 <script language="JavaScript" type="text/javascript">
107 <!---//hide script from old browsers
108 document.write( "Last updated "+ document.lastModified + "." );
109 //end hiding contents --->
110 </script>
111 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
112 <p>
113 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
114
115 </td>
116
117 </tr></table>
118
119 </body>
120 </html>
doc/customers/ITAsoftware.png less more
Binary diff not shown
doc/customers/geoLocation.png less more
Binary diff not shown
doc/customers/geoMap.png less more
Binary diff not shown
doc/customers/glassfish.png less more
Binary diff not shown
doc/customers/google.png less more
Binary diff not shown
doc/customers/logo_umd.png less more
Binary diff not shown
doc/customers/nsf.png less more
Binary diff not shown
doc/customers/sat4j.png less more
Binary diff not shown
doc/customers/sleepycat.png less more
Binary diff not shown
doc/customers/sun.png less more
Binary diff not shown
+0
-219
doc/demo.html less more
0 <html>
1 <head>
2 <title>FindBugs&trade; 1.2 Demo and Results</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css" />
4
5 </head>
6
7 <body>
8
9 <table width="100%"><tr>
10
11
12 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
13 <table width="100%" cellspacing="0" border="0">
14 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
15
16 <tr><td>&nbsp;</td></tr>
17
18 <tr><td><b>Docs and Info</b></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
30 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
31
32 <tr><td>&nbsp;</td></tr>
33
34 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
35
36 <tr><td>&nbsp;</td></tr>
37
38 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
39
40 <tr><td>&nbsp;</td></tr>
41
42 <tr><td><b>Development</b></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
51 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
52 </table>
53 </td>
54
55 <td align="left" valign="top">
56 <h1>
57 FindBugs 1.2 demo and results
58 </h1>
59
60 <p>If you just want to try running FindBugs against your
61 own code, you can
62 <a href="http://findbugs.cs.umd.edu/demo/jnlp/findbugs.jnlp">run FindBugs</a> using Java Webstart.
63 This will use our new gui under Java 1.5+ and our old gui under Java 1.4.
64 The new gui provides a number of new features, but requires Java 1.5+.
65 Both use exactly the same analysis engine.
66
67 </p><p>This web page provides results of running FindBugs 1.2.0
68 against several open source applications. We provide a summary
69 of the number of bugs we found, as well as a generated HTML listing
70 of the bugs and
71 a <a href="http://java.sun.com/products/javawebstart/">Java
72 WebStart</a> demo of the new GUI we've introduced in FindBugs version 1.1,
73 displaying the warnings and the relevant source.
74
75
76 </p><p>The applications and versions of them we report on
77 are somewhat arbitrary. In some cases, they are release versions,
78 in other cases nightly builds. We find lots of bugs in every large code
79 base we examine; these applications are certainly not the worst we have seen.
80 I have been allowed to confidentially examine the results of running FindBugs
81 against several closed commercial code bases by well respected companies;
82 the results I've seen there are not significantly different from
83 what I've observed in open source code bases.
84
85
86 </p><p><em>Experimental details</em>: These results are from running
87 FindBugs 1.2.0 at standard effort level. Our results do not include
88 any low priority warnings or any warnings about vulnerabilities to
89 malicious code. Although we have (repeatedly) manually audited the results,
90 we haven't manually filtered out false positives from these warnings,
91 so that you can get a feeling for the quality of the warnings generated
92 by FindBugs.
93 </p><p>Some of the bugs contain audit comments: they are marked as to whether
94 we thought the warning indicated a bug that should or must be fixed, or whether it was not, in fact, a bug.
95 </p><p>In the webstart versions, we've only included the bugs for which
96 we were able to identify source files. The number of lines of non-commenting source
97 statements in the table below (KNCSS) is derived from the same files
98 that we analyzed and in which we report bugs; we actually compute
99 KNCSS from the classfiles, not the source files.
100
101 </p><p><em>Vulnerability disclosure</em>: Thankfully, Java isn't C or C++. Dereferencing
102 a null pointer or accessing outside the bounds of an array generates a runtime
103 exception rather than a shell exploit. We do not believe that any of the
104 warnings here represents a security vulnerability, although we have not audited
105 them to verify that. These projects are all aware of the existence of
106 FindBugs, and FindBugs is already open source and available
107 for use both by developers and attackers, we don't believe that making
108 these results available constitutes a reckless disclosure.
109
110
111 </p><p><em>Recommendations</em>: First, review the correctness warnings.
112 We feel confident that developers
113 would want to fix most of the high and medium priority correctness warnings we report.
114 Once you've reviewed those,
115 you might want to look at some of the other categories.
116 </p><p>
117 In other categories,
118 such as Bad practice and Dodgy code, we accept more false positives. You
119 might decide that a pattern bug pattern isn't relevant for your code
120 base (e.g., you never use Serialization for persistent storage,
121 so you never care about the fact that you didn't define a serializationUID),
122 and even for the bug patterns relevant to your code base,
123 perhaps only a minority will reflect problems serious enough to
124 convince you to change your code.
125
126 </p><p><em>Please be patient</em> The Web start versions not only have to download the applications,
127 they need to download about 10 megabytes of data and source files. Please
128 be patient. Sorry we don't have a progress bar for the data and source download;
129 the ability to remotely download a data and source archive is a little bit of
130 a hack. We've provided small versions of some of the data sets that include
131 only the correctness bugs and the source files containing those warnings. The small
132 datasets are about a quarter of the sizes of the full datasets.
133 </p>
134 <p>
135 </p><table border="2">
136 <tr><th rowspan="2">Application</th><th colspan="2">Details</th><th colspan="2">Correctness bugs</th><th rowspan="2">Bad Practice</th><th rowspan="2">Dodgy</th><th rowspan="2">KNCSS
137 </th></tr><tr><th>HTML</th><th>WebStart</th><th>NP bugs</th><th>Other
138 </th></tr><tr><td align="right">Sun JDK 1.7.0-b12</td><td align="right">
139 <a href="http://findbugs.cs.umd.edu/demo/jdk7/index.html">All</a>
140 </td><td align="right">
141 <a href="http://findbugs.cs.umd.edu/demo/jdk7/index.jnlp">All</a>
142 <a href="http://findbugs.cs.umd.edu/demo/jdk7/small.jnlp">Small</a>
143 </td><td align="right">68</td><td align="right">180</td><td align="right">954</td><td align="right">654</td><td align="right">597
144
145 </td></tr><tr><td align="right">eclipse-SDK-3.3M7-solaris-gtk</td><td align="right">
146 <a href="http://findbugs.cs.umd.edu/demo/eclipse/index.html">All</a>
147 </td><td align="right">
148 <a href="http://findbugs.cs.umd.edu/demo/eclipse/index.jnlp">All</a>
149 <a href="http://findbugs.cs.umd.edu/demo/eclipse/small.jnlp">Small</a>
150 </td><td align="right">146</td><td align="right">259</td><td align="right">1,079</td><td align="right">643</td><td align="right">1,447
151
152 </td></tr><tr><td align="right">netbeans-6_0-m8</td><td align="right">
153 <a href="http://findbugs.cs.umd.edu/demo/netbeans/index.html">All</a>
154 </td><td align="right">
155 <a href="http://findbugs.cs.umd.edu/demo/netbeans/index.jnlp">All</a>
156 <a href="http://findbugs.cs.umd.edu/demo/netbeans/small.jnlp">Small</a>
157 </td><td align="right">189</td><td align="right">305</td><td align="right">3,010</td><td align="right">1,112</td><td align="right">1,022
158
159 </td></tr><tr><td align="right">glassfish-v2-b43</td><td align="right">
160 <a href="http://findbugs.cs.umd.edu/demo/glassfish/index.html">All</a>
161 </td><td align="right">
162 <a href="http://findbugs.cs.umd.edu/demo/glassfish/index.jnlp">All</a>
163 <a href="http://findbugs.cs.umd.edu/demo/glassfish/small.jnlp">Small</a>
164 </td><td align="right">146</td><td align="right">154</td><td align="right">964</td><td align="right">1,222</td><td align="right">2,176
165
166 </td></tr><tr><td align="right">jboss-4.0.5</td><td align="right">
167 <a href="http://findbugs.cs.umd.edu/demo/jboss/index.html">All</a>
168 </td><td align="right">
169 <a href="http://findbugs.cs.umd.edu/demo/jboss/index.jnlp">All</a>
170 <a href="http://findbugs.cs.umd.edu/demo/jboss/small.jnlp">Small</a>
171 </td><td align="right">30</td><td align="right">57</td><td align="right">263</td><td align="right">214</td><td align="right">178
172
173 </td></tr></table>
174 <p><em>KNCSS</em> - Thousands of lines of non-commenting source statements
175
176 </p><h2>Bug categories</h2>
177 <dl>
178 <dt>Correctness bug
179 </dt><dd>Probable bug - an apparent coding mistake
180 resulting in code that was probably not what the
181 developer intended. We strive for a low false positive rate.
182 </dd><dt>Bad Practice
183 </dt><dd>
184 Violations of recommended and essential
185 coding practice. Examples include hash code and equals
186 problems, cloneable idiom, dropped exceptions,
187 serializable problems, and misuse of finalize.
188 We strive to make this analysis accurate,
189 although some groups may
190 not care about some of the bad practices.
191 </dd><dt>Dodgy
192 </dt><dd>
193 Code that is confusing, anomalous, or
194 written in a way that leads itself to errors.
195 Examples include dead local stores, switch fall through,
196 unconfirmed casts, and redundant null check of value
197 known to be null.
198 More false positives accepted.
199 In previous versions of FindBugs, this category was known as Style.
200 </dl>
201
202
203 <hr> <p>
204 <script language="JavaScript" type="text/javascript">
205 <!---//hide script from old browsers
206 document.write( "Last updated "+ document.lastModified + "." );
207 //end hiding contents --->
208 </script>
209 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
210 <p>
211 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A></td></tr></table>
212
213 </body>
214 </html>
215
216
217
218
+0
-118
doc/downloads.html less more
0 <html>
1 <head>
2 <title>FindBugs Downloads</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%"><tr>
9
10
11 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
12 <table width="100%" cellspacing="0" border="0">
13 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
14
15 <tr><td>&nbsp;</td></tr>
16
17 <tr><td><b>Docs and Info</b></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
30
31 <tr><td>&nbsp;</td></tr>
32
33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
34
35 <tr><td>&nbsp;</td></tr>
36
37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39 <tr><td>&nbsp;</td></tr>
40
41 <tr><td><b>Development</b></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
51 </table>
52 </td>
53
54 <td align="left" valign="top">
55
56 <h1>FindBugs downloads</h1>
57
58 <p> This page contains links to downloads
59 of FindBugs version 2.0.3,
60 released on 17:16:15 EST, 22 November, 2013. Download links
61 for all FindBugs versions and files
62 are <a href="http://sourceforge.net/project/showfiles.php?group_id=96405">available
63 on the sourceforge download page</a>.
64
65 <ul>
66 <li>
67 FindBugs tool (standard version with command line, ant, and Swing interfaces)
68 <ul>
69 <li><a href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.tar.gz?download">findbugs-2.0.3.tar.gz</a></li>
70 <li><a href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.zip?download">findbugs-2.0.3.zip</a></li>
71 <li><a href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3-source.zip?download">findbugs-2.0.3-source.zip</a></li>
72 </ul>
73 </li>
74 <li>
75 The following versions of FindBugs are pre-configured to disable <a href="updateChecking.html">checks for updated versions</a>
76 of FindBugs, and
77 the plugin that allows communication with the FindBugs community cloud is disabled by default.
78 Such configurations are appropriate in situations where it is important that no information about the use of FindBugs
79 be disclosed outside of the organization where it is used.
80 <ul>
81 <li><a href="http://prdownloads.sourceforge.net/findbugs/findbugs-noUpdateChecks-2.0.3.tar.gz?download">findbugs-2.0.3.tar.gz</a></li>
82 <li><a href="http://prdownloads.sourceforge.net/findbugs/findbugs-noUpdateChecks-2.0.3.zip?download">findbugs-2.0.3.zip</a></li>
83 </ul>
84 </li>
85 <li>Eclipse plugin for FindBugs version 2.0.3.20131122 (requires Eclipse 3.6 or later)
86 <ul>
87 <li><a href="http://sourceforge.net/projects/findbugs/files/findbugs%20eclipse%20plugin/2.0.3/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122-15020.zip/download">edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122-15020.zip</a>
88 <li><a href="http://sourceforge.net/projects/findbugs/files/findbugs%20eclipse%20plugin/2.0.3/eclipsePlugin-2.0.3.20131122-15020-source.zip/download">
89 eclipsePlugin-2.0.3.20131122-15020-source.zip/download</a>
90 </ul>
91 </li>
92 </ul>
93
94 The Eclipse plugin may also be obtained from one of the FindBugs Eclipse plugin update sites:
95 <ul>
96 <li><a href="http://findbugs.cs.umd.edu/eclipse">http://findbugs.cs.umd.edu/eclipse</a> update site for <b>official</b> releases</li>
97 <li><a href="http://findbugs.cs.umd.edu/eclipse-candidate">http://findbugs.cs.umd.edu/eclipse-candidate</a> update site for <b>candidate</b> releases and official releases</li>
98 <li><a href="http://findbugs.cs.umd.edu/eclipse-daily">http://findbugs.cs.umd.edu/eclipse-daily</a> update site for <b>all</b> releases, including developmental ones</li>
99 </ul>
100
101
102 <hr> <p>
103 <script language="JavaScript" type="text/javascript">
104 <!---//hide script from old browsers
105 document.write( "Last updated "+ document.lastModified + "." );
106 //end hiding contents --->
107 </script>
108 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
109 <p>
110 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
111
112 </td>
113
114 </tr></table>
115
116 </body>
117 </html>
doc/eclipse-filters-icon.png less more
Binary diff not shown
+0
-128
doc/factSheet.html less more
0 <html>
1 <head>
2 <title>FindBugs&trade; Fact Sheet</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%"><tr>
9
10
11 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
12 <table width="100%" cellspacing="0" border="0">
13 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
14
15 <tr><td>&nbsp;</td></tr>
16
17 <tr><td><b>Docs and Info</b></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
30
31 <tr><td>&nbsp;</td></tr>
32
33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
34
35 <tr><td>&nbsp;</td></tr>
36
37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39 <tr><td>&nbsp;</td></tr>
40
41 <tr><td><b>Development</b></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
51 </table>
52 </td>
53
54 <td align="left" valign="top">
55
56 <h1>FindBugs&trade; Fact Sheet</h1>
57
58 <p> FindBugs looks for bugs in Java programs.&nbsp; It is based
59 on the concept of <i>bug patterns</i>.&nbsp; A bug pattern is a code
60 idiom that is often an error.&nbsp; Bug patterns arise for a variety
61 of reasons:
62 </p>
63
64 <ul>
65 <li> Difficult language features
66 <li> Misunderstood API methods
67 <li> Misunderstood invariants when code is modified during maintenance
68 <li> Garden variety mistakes: typos, use of the wrong boolean operator
69 </ul>
70
71 <p> FindBugs uses <i>static analysis</i> to inspect Java bytecode
72 for occurrences of bug patterns.&nbsp;
73 Static analysis means that FindBugs can find bugs by simply inspecting
74 a program's code: executing the program is not necessary.&nbsp;
75 This makes FindBugs very easy to use: in general, you should be
76 able to use it to look for bugs in your code within a few minutes of downloading it.&nbsp;
77 FindBugs works by analyzing Java bytecode (compiled class files),
78 so you don't even need the program's source code to use it.&nbsp;
79 Because its analysis is
80 sometimes imprecise, FindBugs can report <i>false warnings</i>,
81 which are warnings that do not indicate real errors.&nbsp;
82 In practice, the rate of false warnings reported by FindBugs
83 is less than 50%.
84 </p>
85
86 <p>
87 FindBugs supports a plugin architecture allowing anyone to add new
88 bug detectors.&nbsp; The <a href="publications.html">publications page</a>
89 contains links to articles describing how to write a new detector
90 for FindBugs.&nbsp; If you are familiar with Java bytecode
91 you can write a new FindBugs detector in as little as a few minutes.
92 </p>
93
94 <p> FindBugs is free software, available under the terms of the
95 <a href="http://www.gnu.org/copyleft/lesser.html">Lesser GNU Public License</a>.&nbsp;
96 It is written in Java, and can be run with any virtual machine compatible
97 with Sun's JDK 1.5.&nbsp; It can analyze programs written for any version
98 of Java.&nbsp; FindBugs was originally developed by Bill Pugh and David Hovemeyer.&nbsp;
99 It is maintained by Bill Pugh, and
100 a <a href="team.html">team of volunteers</a>.
101 </p>
102
103 <p> FindBugs uses <a href="http://jakarta.apache.org/bcel/">BCEL</a> to
104 analyze Java bytecode.&nbsp;
105 As of version 1.1, FindBugs also supports bug detectors written using
106 the <a href="http://asm.objectweb.org/">ASM</a> bytecode framework.&nbsp;
107 FindBugs uses <a href="http://dom4j.org/">dom4j</a>
108 for XML manipulation.
109 </p>
110
111
112 <hr> <p>
113 <script language="JavaScript" type="text/javascript">
114 <!---//hide script from old browsers
115 document.write( "Last updated "+ document.lastModified + "." );
116 //end hiding contents --->
117 </script>
118 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
119 <p>
120 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
121
122 </td>
123
124 </tr></table>
125
126 </body>
127 </html>
+0
-15
doc/findbugs.css less more
0 BODY {
1 background: white;
2 }
3
4 A.plain {
5 text-decoration: none;
6 }
7
8 A.sidebar {
9 text-decoration: none;
10 }
11
12 A.sidebar:hover, A.sidebar:active {
13 text-decoration: underline;
14 }
+0
-283
doc/findbugs2.html less more
0 <html>
1 <head>
2 <title>FindBugs 2&trade; - Find Bugs in Java Programs</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css" />
4
5 </head>
6
7 <body>
8
9 <table width="100%">
10 <tr>
11
12
13 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
14 <table width="100%" cellspacing="0" border="0">
15 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
16
17 <tr><td>&nbsp;</td></tr>
18
19 <tr><td><b>Docs and Info</b></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
30 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
31 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
32
33 <tr><td>&nbsp;</td></tr>
34
35 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
36
37 <tr><td>&nbsp;</td></tr>
38
39 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
40
41 <tr><td>&nbsp;</td></tr>
42
43 <tr><td><b>Development</b></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
51 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
52 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
53 </table>
54 </td>
55
56 <td align="left" valign="top">
57
58 <p></p>
59 <table>
60 <tr>
61 <td valign="center"><a href="http://findbugs.sourceforge.net/"><img src="buggy-sm.png" alt="FindBugs logo"
62 border="0" /> </a></td>
63 <td valign="center"><a href="http://www.umd.edu/"><img src="informal.png"
64 alt="UMD logo" border="0" /> </a></td>
65 </tr>
66 </table>
67
68 <h1>FindBugs 2</h1>
69
70 <p>This page describes the major changes in FindBugs 2. We are well aware that the documentation on
71 the new features in FindBugs 2.0 have not kept up with the implementation. We will be working to
72 improve the documentation, but don't want to hold up the release any longer to improve the
73 documentation.</p>
74 <p>Anyone currently using FindBugs 1.3.9 should find FindBugs 2.0 to largely be a drop-in
75 replacement that offers better accuracy and performance.</p>
76
77
78 <p>
79 Also check out <a href="http://code.google.com/p/findbugs/w/list">http://code.google.com/p/findbugs/w/list</a>
80 for more information about some recent features/changes in FindBugs.
81 </p>
82
83 <p>The major new features in FindBugs 2 are as follows:</p>
84 <ul>
85 <li>Bug Rank - bugs are given a rank 1-20, and grouped into the categories scariest (rank 1-4),
86 scary (rank 5-9), troubling (rank 10-14), and of concern (rank 15-20).
87 <ul>
88 <li>priority renamed confidence - many people were confused by the priority reported by
89 FindBugs, and considered all HIGH priority issues to be important. To reflect the
90 actually meaning of this attribute of issues, it has been renamed confidence. Issues of
91 different bug patterns should be compared by there rank, not their confidence.</li>
92 </ul>
93
94 </li>
95 <li><a href="#cloud">Cloud storage</a> - having a convent way for developers to share
96 information about when an issue was first seen, and whether it is believed to be a serious
97 problem, is important to successful and cost-effective deployment of static analysis in a large
98 software project.</li>
99 <li><a href="#updateChecks">update checks</a> - FindBugs will check for releases of new
100 versions of FindBugs. Note: we leverage this capability to count the number of FindBugs users.
101 These update checks can easily be disabled.</li>
102 <li><a href="#plugins">Plugins</a> - FindBugs 2.0 makes it much easier to define plugins that
103 provide various capabilities, and install these plugins either on a per user or per installation
104 basis.</li>
105 <li><code>fb</code> command - rather than using the rather haphazard collection of command line
106 scripts developed over the years for running various FindBugs commands, you can now use just
107 one: <code>fb</code>.
108 <ul>
109 <li><code>fb analyze</code> - invokes the FindBugs analysis</li>
110 <li><code>fb gui</code> - launches the FindBugs GUI
111 <li><code>fb list</code> - lists the issues from a FindBugs analysis file</li>
112 <li><code>fb help</code> - lists the command available.</li>
113 </ul>
114 <p>
115 Plugins can be used to extend the commands that can be invoked via
116 <code>fb</code>.
117 </p>
118 </li>
119 <li><a href="#newBugPatterns">New bug patterns and detectors</a>,
120 and improved accuracy
121 </li>
122 <li><a href="#performance">Improved performance</a>: overall, we've seen an average 10%
123 performance improvement over a large range of benchmarks, although a few users have experienced
124 performance regressions we are still trying to understand.</li>
125 <li id="guava">Guava support - working with Kevin Bourrillion, we have provided additional support for the
126 <a href="http://code.google.com/p/guava-libraries/">Guava library</a>, recognizing many common
127 misuse patterns.
128 </li>
129 <li id="jsr305">JSR-305 support - improved detection of problems identified by JSR-305 annotations. In
130 particular, we've significantly improved both the accuracy and performance of the analysis of
131 type qualifiers.</li>
132 </ul>
133
134 <h2 id="cloud">Cloud storage of issue evaluations</h2>
135 <p>For many years, you could store evaluations of FindBugs issues within the XML containing the
136 analysis results. However, this approach did not work well for a team of distributed developers.
137 Instead, we now provide a cloud based mechanism for storing this information. We are providing a
138 free communal cloud (hostied by Google appengine) for storing evaluations of FindBugs issues. You
139 can set up your own private cloud for storing issues, but at the moment this checking out a copy of
140 FindBugs, making some modifications and building the cloud storage plugin from source. We hope to
141 make it easier to have your own private cloud in FindBugs 2.0.1.</p>
142 <p>We have analyzed several large open source projects, and provide Java web start links to allow
143 you to view the results. We'd be happy to work with projects to make the results available from a
144 continuous build:</p>
145 <ul>
146 <li><a href="http://findbugs.cs.umd.edu/cloud/jdk.jnlp">Sun's JDK 8</a></li>
147 <li><a href="http://findbugs.cs.umd.edu/cloud/eclipse.jnlp">Eclipse 3.8</a></li>
148 <li><a href="http://findbugs.cs.umd.edu/cloud/tomcat.jnlp">Apache Tomcat 7.0</a></li>
149 <li><a href="http://findbugs.cs.umd.edu/cloud/intellij.jnlp">IntelliJ IDEA</a></li>
150 <li><a href="http://findbugs.cs.umd.edu/cloud/jboss.jnlp">JBoss</a></li>
151 </ul>
152
153 <h2 id="updateChecks">FindBugs update checks</h2>
154 <p>
155 FindBugs now checks to see if a new version of FindBugs or a plugin has been released. We make use
156 of this check to collect statistics on the operating system, java version, locale and FindBugs entry
157 point (e.g., ant, command line, GUI). <a href="updateChecking.html">More information is
158 available</a>, including information about how to disable update checks if your organization has a
159 policy against allowing the collection of such information. No information about the code being
160 analyzed is reported.
161
162 </p>
163
164 <h2 id="plugins">Plugins</h2>
165 <p>FindBugs 2.0 makes it much easier to customize FindBugs with plugins.</p>
166 <p>FindBugs looks for plugins in two places: your personal home directory, and in FindBugs home
167 (plugins installed in your home directory take precedence). In both places, it looks in two places:
168 the plugin directory, which contains plugins that are enabled by default, and the optionalPlugin
169 directory, which contains plugins that are disabled by default but can be enabled for a particular
170 project.</p>
171 <p>The FindBugs project includes several plugins:</p>
172 <ul>
173 <li><i>Cloud plugins</i>: These plugins provide ways to persist and share information about
174 issues seen in an analysis (e.g., when was this issue first seen, and any evaluations as to
175 whether this is harmless or a must fix issue, as well as comments about the issue from
176 developers)
177 <ul>
178 <li><code>bugCollectionCloud</code> - stores issue evaluations in the XML. The way
179 issue evaluations were always stored before FindBugs 2.0. Distributed in the
180 optionalPlugin directory.</li>
181 <li><code>findbugsCommunalCloud</code> Stores issue evaluations in the communal cloud
182 hosted at findbugs.appspot.com. Distributed in the plugin directory.</li>
183 <li><code>jdbcCloudClient</code> an older, deprecated cloud that stored information in
184 an SQL database. Not distributed, most be built from source.</li>
185 </ul></li>
186 <li><code>noUpdateChecks</code> - Disables checks for updated versions and usage counting.
187 Distributed in the optionalPlugin directory.</li>
188 <li><code>poweruser</code> - provides a number of additional commands for the <code>fb</code>
189 command. It is believed most of these commands are used by few people outside of the FindBugs
190 development team. Distributed in the optionalPlugin directory.</li>
191 <li><i>Bug filing plugins</i>: these plugins assist in the filing of FindBugs issues in built
192 trackers. The bug filing framework is designed to be extensible to other bug filing systems. At
193 the moment, these plugins are not supported, and must be built from source.
194 <ul>
195 <li><code>jira</code></li>
196 <li><code>google code</code></li>
197 </ul></li>
198 </ul>
199 <h2 id="performance">Performance Improvements/regressions</h2>
200 <p>
201 In our own testing, <a href="performance.html">we've seen an overall improvement of 9% in
202 FindBugs performance from 1.3.9 to 2.0.0, with the majority of benchmarks seeing improvements</a>. A
203 few users have reported significant performance regressions and we are <a href="performance.html">asking
204 for more information from anyone seeing significant performance regressions</a>.
205
206 </p>
207 <h2 id="newBugPatterns">New Bug patterns</h2>
208 <ul>
209 <li><a
210 href="http://findbugs.sourceforge.net/bugDescriptions.html#AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION">AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION</a>
211 </li>
212 <li><a
213 href="http://findbugs.sourceforge.net/bugDescriptions.html#BX_UNBOXING_IMMEDIATELY_REBOXED">BX_UNBOXING_IMMEDIATELY_REBOXED</a>
214 </li>
215 <li><a
216 href="http://findbugs.sourceforge.net/bugDescriptions.html#CO_COMPARETO_RESULTS_MIN_VALUE">CO_COMPARETO_RESULTS_MIN_VALUE</a>
217 </li>
218 <li><a
219 href="http://findbugs.sourceforge.net/bugDescriptions.html#DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD</a>
220 </li>
221 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_ARGUMENTS_WRONG_ORDER">DMI_ARGUMENTS_WRONG_ORDER</a>
222 </li>
223 <li><a
224 href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE</a>
225 </li>
226 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_DOH">DMI_DOH</a></li>
227 <li><a
228 href="http://findbugs.sourceforge.net/bugDescriptions.html#DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS</a>
229 </li>
230 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#DM_DEFAULT_ENCODING">DM_DEFAULT_ENCODING</a>
231 </li>
232 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#ICAST_INT_2_LONG_AS_INSTANT">ICAST_INT_2_LONG_AS_INSTANT</a>
233 </li>
234 <li><a
235 href="http://findbugs.sourceforge.net/bugDescriptions.html#INT_BAD_COMPARISON_WITH_INT_VALUE">INT_BAD_COMPARISON_WITH_INT_VALUE</a>
236 </li>
237 <li><a
238 href="http://findbugs.sourceforge.net/bugDescriptions.html#JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT</a>
239 </li>
240 <li><a
241 href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD</a>
242 </li>
243 <li><a
244 href="http://findbugs.sourceforge.net/bugDescriptions.html#OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE</a>
245 </li>
246 <li><a
247 href="http://findbugs.sourceforge.net/bugDescriptions.html#PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS</a>
248 </li>
249 <li><a
250 href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE">RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE</a>
251 </li>
252 <li><a
253 href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_NEGATING_RESULT_OF_COMPARETO">RV_NEGATING_RESULT_OF_COMPARETO</a>
254 </li>
255 <li><a
256 href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_RETURN_VALUE_IGNORED_INFERRED">RV_RETURN_VALUE_IGNORED_INFERRED</a>
257 </li>
258 <li><a
259 href="http://findbugs.sourceforge.net/bugDescriptions.html#SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD</a>
260 </li>
261 <li><a
262 href="http://findbugs.sourceforge.net/bugDescriptions.html#URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD</a>
263 </li>
264 <li><a
265 href="http://findbugs.sourceforge.net/bugDescriptions.html#UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD</a>
266 </li>
267 <li><a
268 href="http://findbugs.sourceforge.net/bugDescriptions.html#UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD</a>
269 </li>
270 <li><a
271 href="http://findbugs.sourceforge.net/bugDescriptions.html#VA_FORMAT_STRING_USES_NEWLINE">VA_FORMAT_STRING_USES_NEWLINE</a>
272 </li>
273 <li><a href="http://findbugs.sourceforge.net/bugDescriptions.html#VO_VOLATILE_INCREMENT">VO_VOLATILE_INCREMENT</a>
274 </li>
275 </ul>
276
277 </td>
278 </tr>
279 </table>
280
281 </body>
282 </html>
doc/guaranteedDereference.png less more
Binary diff not shown
+0
-340
doc/index.html less more
0 <html>
1 <head>
2 <title>FindBugs&trade; - Find Bugs in Java Programs</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css" />
4
5 </head>
6
7 <body>
8
9 <table width="100%">
10 <tr>
11
12
13 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
14 <table width="100%" cellspacing="0" border="0">
15 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
16
17 <tr><td>&nbsp;</td></tr>
18
19 <tr><td><b>Docs and Info</b></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
30 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
31 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
32
33 <tr><td>&nbsp;</td></tr>
34
35 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
36
37 <tr><td>&nbsp;</td></tr>
38
39 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
40
41 <tr><td>&nbsp;</td></tr>
42
43 <tr><td><b>Development</b></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
51 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
52 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
53 </table>
54 </td>
55
56 <td align="left" valign="top">
57
58 <p></p>
59 <table>
60 <tr>
61 <td valign="center"><a href="http://findbugs.sourceforge.net/"><img src="buggy-sm.png" alt="FindBugs logo"
62 border="0" /> </a></td>
63 <td valign="center"><a href="http://www.umd.edu/"><img src="informal.png"
64 alt="UMD logo" border="0" /> </a></td>
65 </tr>
66 </table>
67
68 <h1>FindBugs&trade; - Find Bugs in Java Programs</h1>
69
70 <p>
71 This is the web page for FindBugs, a program which uses static analysis to look for bugs in Java
72 code.&nbsp; It is free software, distributed under the terms of the <a
73 href="http://www.gnu.org/licenses/lgpl.html">Lesser GNU Public License</a>. The name
74 FindBugs&trade; and the <a href="buggy-sm.png">FindBugs logo</a> are trademarked by <a
75 href="http://www.umd.edu">The University of Maryland</a>. FindBugs has been downloaded more than
76 a million times.
77 </p>
78
79 <p>The current version of FindBugs is 2.0.3.</p>
80
81 <p>
82 FindBugs requires JRE (or JDK) 1.5.0 or later to run.&nbsp; However, it can analyze programs
83 compiled for any version of Java, from 1.0 to 1.7. Some classfiles compiled for Java 1.8 give
84 FindBugs problems, the next major release of FindBugs will handle Java 1.8 classfiles.
85
86 <p> The current version of FindBugs is 2.0.3,
87
88 released on 17:16:15 EST, 22 November, 2013. <a href="reportingBugs.html">We are very interested in getting
89 feedback on how to improve FindBugs</a>. File bug reports on <a
90 href="http://sourceforge.net/tracker/?func=browse&amp;group_id=96405&amp;atid=614693"> our
91 sourceforge bug tracker</a>
92 </p>
93 <p>The current version of FindBugs may encounter errors when analyzing
94 Java 1.8 bytecode, due to changes in the classfile format. After FindBugs 2.0.3
95 is released, work will start on the next major release of FindBugs, which will
96 be able to analyze Java 1.8 (and will require Java 1.7 to compile and run).
97
98
99 <p>
100 <a href="#changes">Changes</a> | <a href="#talks">Talks</a> | <a href="#papers">Papers </a> | <a
101 href="#sponsors">Sponsors</a> | <a href="#support">Support</a>
102 </p>
103
104 <h1>FindBugs 2.0.3 Release</h1>
105 <p>FindBugs 2.0.3 is intended to be a minor bug fix release over
106 FindBugs 2.0.2. Although than some improvements to existing bug detectors
107 and analysis engines, and a few new bug patterns, and some
108 important bug fixes to the Eclipse plugin, no significant changes
109 should be observed. Consult the <a href="Changes.html">Change log</a>
110 for more details.</p>
111
112 <p>
113 Also check out <a href="http://code.google.com/p/findbugs/w/list">http://code.google.com/p/findbugs/w/list</a>
114 for more information about some recent features/changes in FindBugs.
115 </p>
116
117
118 <h3>
119 <a href="findbugs2.html">Major changes in FindBugs 2.0 (from FindBugs 1.3.x)</a>
120 </h3>
121 <ul>
122 <li><a href="findbugs2.html#cloud">FindBugs Communal cloud</a></li>
123 <li><a href="findbugs2.html#updateChecks">checks for updated versions of FindBugs</a></li>
124 <li><a href="findbugs2.html#plugins">Powerful plugin capabilities</a></li>
125 <li><a href="findbugs2.html#newBugPatterns">new bug patterns</a>,
126 including new/improved support for <a href="findbugs2.html#guava">Guava</a>
127 and <a href="findbugs2.html#jsr305">JSR-305</a>
128 </li>
129 <li><a href="findbugs2.html#performance">improved performance</a></li>
130 </ul>
131
132
133 <h2>Ways to run FindBugs</h2>
134 <p>Here are various ways to run FindBugs. For plugins not supported by the FindBugs team, check to
135 see what version of FindBugs they provide; it might take a little while for the plugins to update to
136 FindBugs 2.0.</p>
137 <dl>
138 <dt>Command line, ant, GUI</dt>
139 <dd>Provided in FindBugs download</dd>
140 <dt>
141 <a href="http://www.eclipse.org/">Eclipse</a>
142 </dt>
143 <dd>
144 Update site for Eclipse plugin: <a href="http://findbugs.cs.umd.edu/eclipse">http://findbugs.cs.umd.edu/eclipse</a>.
145 Supported by the FindBugs project.
146 </dd>
147 <dt>
148 <a href="http://maven.apache.org/">Maven</a>
149 </dt>
150 <dd>
151 <a href="http://mojo.codehaus.org/findbugs-maven-plugin/">http://mojo.codehaus.org/findbugs-maven-plugin/</a>
152 </dd>
153 <dt>
154 <a href="http://netbeans.org/">Netbeans</a>
155 </dt>
156 <dd>
157 <a href="http://kenai.com/projects/sqe/pages/Home">SQE: Software Quality Environment</a>
158 </dd>
159 <dt><a href="https://wiki.jenkins-ci.org/display/JENKINS">Jenkins</a></dt>
160 <dd> <a href="https://wiki.jenkins-ci.org/display/JENKINS/FindBugs+Plugin">Jenkins FindBugs Plugin</a>
161
162 <dt>
163 <a href="http://wiki.hudson-ci.org/display/HUDSON/Home">Hudson</a>
164 </dt>
165 <dd>
166 <a href="http://wiki.hudson-ci.org/display/HUDSON/FindBugs+Plugin"> HUDSON FindBugs Plugin</a>
167 </dd>
168 <dt>
169 <a href="http://www.jetbrains.com/idea/">IntelliJ</a>
170 </dt>
171 <dd>
172 Several plugins, see <a href="http://code.google.com/p/findbugs/wiki/IntellijFindBugsPlugins">http://code.google.com/p/findbugs/wiki/IntellijFindBugsPlugins</a>
173 for a description.
174
175 </dd>
176 </dl>
177
178
179 <h1>New</h1>
180 <ul>
181
182 <li>jFormatString library republished at
183 <a href="http://code.google.com/p/j-format-string">http://code.google.com/p/j-format-string</a>.
184 This is the library we use for compile time checking of format strings. It is separately published to
185
186 <li>We're releasing FindBugs 2.0.3.
187
188 Mostly small changes to address false positives, with one important fix to the Eclipse plugin
189 to fix a problem that had prevented the plugin from running in some versions of Eclipse.
190 Check the <a href="Changes.html">change log</a> for more details.
191
192 <li>We've released <a href="findbugs2.html">FindBugs 2.0</a>
193 </li>
194 <li>FindBugs communal cloud and Java web start links:. We have analyzed several large open
195 source projects, and provide Java web start links to allow you to view the results. We'd be
196 happy to work with projects to make the results available from a continuous build:
197 <p></p>
198 <ul>
199 <li><a href="http://findbugs.cs.umd.edu/cloud/jdk.jnlp">Sun's JDK 8</a></li>
200 <li><a href="http://findbugs.cs.umd.edu/cloud/eclipse.jnlp">Eclipse 3.8</a></li>
201 <li><a href="http://findbugs.cs.umd.edu/cloud/tomcat.jnlp">Apache Tomcat 7.0</a></li>
202 <li><a href="http://findbugs.cs.umd.edu/cloud/intellij.jnlp">IntelliJ IDEA</a></li>
203 <li><a href="http://findbugs.cs.umd.edu/cloud/jboss.jnlp">JBoss</a></li>
204 </ul>
205 </li>
206 </ul>
207
208
209
210 <h1>Experience with FindBugs</h1>
211 <ul>
212 <li><b>Google FindBugs Fixit</b>: Google has a tradition of <a
213 href="http://www.nytimes.com/2007/10/21/jobs/21pre.html">engineering fixits</a>, special days where
214 they try to get all of their engineers focused on some specific problem or technique for improving
215 the systems at Google. A fixit might work to improve web accessibility, internal testing, removing
216 TODO's from internal software, etc.
217
218 <p>In 2009, Google held a global fixit for UMD's FindBugs tool a static analysis tool for
219 finding coding mistakes in Java software. The focus of the fixit was to get feedback on the
220 4,000 highest confidence issues found by FindBugs at Google, and let Google engineers decide
221 which issues, if any, needed fixing.</p>
222 <p>More than 700 engineers ran FindBugs from dozens of offices. More than 250 of them entered
223 more than 8,000 reviews of the issues. A review is a classification of an issue as must-fix,
224 should-fix, mostly-harmless, not-a-bug, and several other categories. More than 75% of the
225 reviews classified issues as must fix, should fix or I will fix. Many of the scariest issues
226 received more than 10 reviews each.</p>
227 <p>Engineers have already submitted changes that made more than 1,100 of the 3,800 issues go
228 away. Engineers filed more than 1,700 bug reports, of which 600 have already been marked as
229 fixed Work continues on addressing the issues raised by the fixit, and on supporting the
230 integration of FindBugs into the software development process at Google.</p>
231 <p>The fixit at Google showcased new capabilities of FindBugs that provide a cloud computing /
232 social networking backdrop. Reviews of issues are immediately persisted into a central store,
233 where they can be seen by other developers, and FindBugs is integrated into the internal Google
234 tools for filing and viewing bug reports and for viewing the version control history of source
235 files. For the Fixit, FindBugs was configured in a mode where engineers could not see reviews
236 from other engineers until they had entered their own; after the fixit, the configuration will
237 be changed to a more open configuration where engineers can see reviews from others without
238 having to provide their own review first. These capabilities have all been contributed to UMD's
239 open source FindBugs tool, although a fair bit of engineering remains to prepare the
240 capabilities for general release and make sure they can integrate into systems outside of
241 Google. The new capabilities are expected to be ready for general release in Fall 2009.</p>
242 </li>
243 </ul>
244
245 <h2>
246 <a name="talks">Talks about FindBugs</a>
247 </h2>
248 <ul>
249 <li>
250 <a href="http://www.cs.umd.edu/~pugh/MistakesThatMatter.pdf">Mistakes That Matter</a>, JavaOne,
251 2009
252 </li>
253 <li><a href="http://youtu.be/jflQSFhYTEo?hd=1">Youtube video</a> showing of demo
254 of our 2.0 Eclipse plugin (5 minutes)</li>
255 <li><a href="http://findbugs.cs.umd.edu/talks/findbugs.mov">Quicktime movie</a> showing of demo
256 of our new GUI to view some of the null pointer bugs in Eclipse (Big file warning: 23 Megabytes)</li>
257 <li><a href="http://findbugs.cs.umd.edu/talks/JavaOne2007-TS2007.pdf">JavaOne 2007 talk on
258 Improving Software Quality Using Static Analysis</a></li>
259 <li><a href="http://findbugs.cs.umd.edu/talks/fb-sdbp-2006.pdf">Talk</a> Bill Pugh gave at <a
260 href="http://www.sdexpo.com/2006/sdbp/">SD Best Practices</a>, Sept 14th (more of a handle on
261 tutorial about using FindBugs)</li>
262 <li><a href="http://findbugs.cs.umd.edu/talks/fb-Sept1213-2006.pdf">Talk</a> Bill Pugh gave at
263 <a href="http://itasoftware.com/">ITA Software</a> and <a href="http://www.csail.mit.edu/">MIT</a>,
264 Sept 12th and 13th (more of a research focus)</li>
265 <li><a href="http://video.google.com/videoplay?docid=-8150751070230264609">Video of talk</a>
266 Bill Pugh gave at <a href="http://www.google.com">Google</a>, July 6th, 2006</li>
267 <li><a href="http://javaposse.com/index.php?post_id=95780">Java Posse podcast interview
268 with Bill Pugh and Brian Goetz</a></li>
269 </ul>
270 <h2>
271 <a name="papers">Papers about FindBugs</a>
272 </h2>
273 <ul>
274 <li><a href="http://findbugs.cs.umd.edu/papers/MoreNullPointerBugs07.pdf">Finding More Null
275 Pointer Bugs, But Not Too Many</a>, by <a href="http://faculty.ycp.edu/~dhovemey/">David
276 Hovemeyer</a>, York College of Pennsylvania and <a href="http://www.cs.umd.edu/~pugh/">William
277 Pugh</a>, Univ. of Maryland, <a href="http://paste07.cs.washington.edu/">7th ACM
278 SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering</a>, June, 2007</li>
279 <li><a href="http://findbugs.cs.umd.edu/papers/FindBugsExperiences07.pdf">Evaluating Static
280 Analysis Defect Warnings On Production Software,</a> <a href="http://www.cs.umd.edu/~nat/">Nathaniel
281 Ayewah</a> and <a href="http://www.cs.umd.edu/~pugh/">William Pugh</a>, Univ. of Maryland, and
282 J. David Morgenthaler, John Penix and YuQian Zhou, Google, Inc., <a
283 href="http://paste07.cs.washington.edu/">7th ACM SIGPLAN-SIGSOFT Workshop on Program
284 Analysis for Software Tools and Engineering</a>, June, 2007
285 </li>
286 </ul>
287
288 <h1>
289 <a name="sponsors">Contributors and Sponsors</a>
290 </h1>
291 <p>
292 The <a href="team.html">current development team</a> consists of <a
293 href="http://www.cs.umd.edu/~pugh">Bill Pugh</a> and <a
294 href="http://andrei.gmxhome.de/privat.html">Andrey Loskutov</a>.
295 </p>
296 <p>The most recent funding for FindBugs comes from a Google Faculty Research Awards.</p>
297 <h2>
298 <a name="support">Additional Support</a>
299 </h2>
300 <p>
301 Numerous <a =href="team.html">people</a> have made significant contributions to the FindBugs
302 project, including founding work by <a href="http://goose.ycp.edu/~dhovemey/">David Hovemeyer</a>
303 and the web cloud infrastructure by Keith Lea.
304 </p>
305 <p>
306 YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC
307 is creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look
308 at YourKit's leading software products: <a href="http://www.yourkit.com/java/profiler/index.jsp">YourKit
309 Java Profiler</a> and <a href="http://www.yourkit.com/.net/profiler/index.jsp">YourKit .NET
310 Profiler</a>.
311 </p>
312 <p>
313 The FindBugs project also uses <a href="http://www.atlassian.com/software/fisheye/">FishEye</a> and
314 <a href="http://www.atlassian.com/software/clover/">Clover</a>, which are generously provided by <a
315 href="http://www.cenqua.com/">Cenqua/Atlassian</a>.
316 </p>
317 <p>
318 Additional financial support for the FindBugs project was provided by <a href="http://www.nsf.gov">National
319 Science Foundation</a> grants ASC9720199 and CCR-0098162,
320 </p>
321 <p>Any opinions, findings and conclusions or recommendations expressed in this material are those of
322 the author(s) and do not necessarily reflect the views of the National Science Foundation (NSF).
323 </p>
324
325 <hr> <p>
326 <script language="JavaScript" type="text/javascript">
327 <!---//hide script from old browsers
328 document.write( "Last updated "+ document.lastModified + "." );
329 //end hiding contents --->
330 </script>
331 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
332 <p>
333 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
334 </td>
335 </tr>
336 </table>
337
338 </body>
339 </html>
doc/infiniteRecursiveLoops.png less more
Binary diff not shown
doc/informal.png less more
Binary diff not shown
+0
-123
doc/ja/manual/acknowledgments.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;14&#31456; &#35613;&#36766;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="license.html" title="&#31532;13&#31456; &#12521;&#12452;&#12475;&#12531;&#12473;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;14&#31456; &#35613;&#36766;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="license.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="chapter" title="&#31532;14&#31456; &#35613;&#36766;"><div class="titlepage"><div><div><h2 class="title"><a name="acknowledgments"></a>&#31532;14&#31456; &#35613;&#36766;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="acknowledgments.html#d0e3438">1. &#36002;&#29486;&#32773;</a></span></dt><dt><span class="sect1"><a href="acknowledgments.html#d0e3561">2. &#20351;&#29992;&#12375;&#12390;&#12356;&#12427;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;</a></span></dt></dl></div><div class="sect1" title="1. &#36002;&#29486;&#32773;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3438"></a>1. &#36002;&#29486;&#32773;</h2></div></div></div><p><span class="application">FindBugs</span> was originally written by Bill Pugh (<code class="email">&lt;<a class="email" href="mailto:pugh@cs.umd.edu">pugh@cs.umd.edu</a>&gt;</code>).
3 David Hovemeyer (<code class="email">&lt;<a class="email" href="mailto:daveho@cs.umd.edu">daveho@cs.umd.edu</a>&gt;</code>) implemented some of the
4 detectors, added the Swing GUI, and is a co-maintainer.</p><p>Mike Fagan (<code class="email">&lt;<a class="email" href="mailto:mfagan@tde.com">mfagan@tde.com</a>&gt;</code>) contributed the <span class="application">Ant</span> build script,
5 the <span class="application">Ant</span> task, and several enhancements and bug fixes to the GUI.</p><p>Germano Leichsenring contributed Japanese translations of the bug
6 summaries.</p><p>David Li contributed the Emacs bug report format.</p><p>Peter D. Stout contributed recursive detection of Class-Path
7 attributes in analyzed Jar files, German translations of
8 text used in the Swing GUI, and other fixes.</p><p>Peter Friese wrote the <span class="application">FindBugs</span> Eclipse plugin.</p><p>Rohan Lloyd contributed several Mac OS X enhancements,
9 bug detector improvements,
10 and maintains the Fink package for <span class="application">FindBugs</span>.</p><p>Hiroshi Okugawa translated the <span class="application">FindBugs</span> manual and
11 more of the bug summaries into Japanese.</p><p>Phil Crosby enhanced the Eclipse plugin to add a view
12 to display the bug details.</p><p>Dave Brosius fixed a number of bugs, added user preferences
13 to the Swing GUI, improved several bug detectors, and
14 contributed the string concatenation detector.</p><p>Thomas Klaeger contributed a number of bug fixes and
15 bug detector improvements.</p><p>Andrei Loskutov made a number of improvements to the
16 Eclipse plugin.</p><p>Brian Goetz contributed a major refactoring of the
17 visitor classes to improve readability and understandability.</p><p> Pete Angstadt fixed several problems in the Swing GUI.</p><p>Francis Lalonde provided a task resource file for the
18 FindBugs Ant task.</p><p>Garvin LeClaire contributed support for output in
19 Xdocs format, for use by Maven.</p><p>Holger Stenzhorn contributed improved German translations of items
20 in the Swing GUI.</p><p>Juha Knuutila contributed Finnish translations of items
21 in the Swing GUI.</p><p>Tanel Lebedev contributed Estonian translations of items
22 in the Swing GUI.</p><p>Hanai Shisei (ruimo) contributed full Japanese translations of
23 bug messages, and text used in the Swing GUI.</p><p>David Cotton contributed Fresh translations for bug
24 messages and for the Swing GUI.</p><p>Michael Tamm contributed support for the "errorProperty" attribute
25 in the Ant task.</p><p>Thomas Kuehne improved the German translation of the Swing GUI.</p><p>Len Trigg improved source file support for the Emacs output mode.</p><p>Greg Bentz provided a fix for the hashcode/equals detector.</p><p>K. Hashimoto contributed internationalization fixes and several other
26 bug fixes.</p><p>
27 Glenn Boysko contributed support for ignoring specified local
28 variables in the dead local store detector.
29 </p><p>
30 Jay Dunning contributed a detector to find equality comparisons
31 of floating-point values, and overhauled the analysis summary
32 report and its representation in the saved XML format.
33 </p><p>
34 Olivier Parent contributed updated French translations for bug descriptions and
35 Swing GUI.
36 </p><p>
37 Chris Nappin contributed the <code class="filename">plain.xsl</code>
38 stylesheet.
39 </p><p>
40 Etienne Giraudy contributed the <code class="filename">fancy.xsl</code> and <code class="filename">fancy-hist.xsl</code>
41 stylesheets, and made improvements to the <span class="command"><strong>-xml:withMessages</strong></span>
42 option.
43 </p><p>
44 Takashi Okamoto fixed bugs in the project preferences dialog
45 in the Eclipse plugin, and contributed to its internationalization and localization.
46 </p><p>Thomas Einwaller fixed bugs in the project preferences dialog in the Eclipse plugin.</p><p>Jeff Knox contributed support for the warningsProperty attribute
47 in the Ant task.</p><p>Peter Hendriks extended the Eclipse plugin preferences,
48 and fixed a bug related to renaming the Eclipse plugin ID.</p><p>Mark McKay contributed an Ant task to launch the findbugs frame.</p><p>Dieter von Holten (dvholten) contributed
49 some German improvements to findbugs_de.properties.</p><p>If you have contributed to <span class="application">FindBugs</span>, but aren't mentioned above,
50 please send email to <code class="email">&lt;<a class="email" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>&gt;</code> (and also accept
51 our humble apologies).</p></div><div class="sect1" title="2. &#20351;&#29992;&#12375;&#12390;&#12356;&#12427;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3561"></a>2. &#20351;&#29992;&#12375;&#12390;&#12356;&#12427;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;</h2></div></div></div><p><span class="application">FindBugs</span> &#12399;&#12289;&#12356;&#12367;&#12388;&#12363;&#12398;&#12458;&#12540;&#12503;&#12531;&#12477;&#12540;&#12473;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;&#12497;&#12483;&#12465;&#12540;&#12472;&#12434;&#20351;&#29992;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12371;&#12428;&#12425;&#12364;&#12394;&#12369;&#12428;&#12400;&#12289; <span class="application">FindBugs</span> &#12398;&#38283;&#30330;&#12399;&#12289;&#12424;&#12426;&#19968;&#23652;&#22256;&#38627;&#12394;&#12418;&#12398;&#12395;&#12394;&#12387;&#12383;&#12371;&#12392;&#12391;&#12375;&#12423;&#12358;&#12290;</p><div class="sect2" title="2.1. BCEL"><div class="titlepage"><div><div><h3 class="title"><a name="d0e3571"></a>2.1. BCEL</h3></div></div></div><p><span class="application">FindBugs</span> includes software developed by the Apache Software Foundation
52 (<a class="ulink" href="http://www.apache.org/" target="_top">http://www.apache.org/</a>).
53 Specifically, it uses the <a class="ulink" href="http://jakarta.apache.org/bcel/" target="_top">Byte Code
54 Engineering Library</a>.</p></div><div class="sect2" title="2.2. ASM"><div class="titlepage"><div><div><h3 class="title"><a name="d0e3584"></a>2.2. ASM</h3></div></div></div><p><span class="application">FindBugs</span> uses the <a class="ulink" href="http://asm.objectweb.org/" target="_top">ASM</a>
55 bytecode framework, which is distributed under the following license:</p><div class="blockquote"><blockquote class="blockquote"><p>
56 Copyright (c) 2000-2005 INRIA, France Telecom
57 All rights reserved.
58 </p><p>
59 Redistribution and use in source and binary forms, with or without
60 modification, are permitted provided that the following conditions
61 are met:
62 </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
63 Redistributions of source code must retain the above copyright
64 notice, this list of conditions and the following disclaimer.
65 </p></li><li class="listitem"><p>
66 Redistributions in binary form must reproduce the above copyright
67 notice, this list of conditions and the following disclaimer in the
68 documentation and/or other materials provided with the distribution.
69 </p></li><li class="listitem"><p>
70 Neither the name of the copyright holders nor the names of its
71 contributors may be used to endorse or promote products derived from
72 this software without specific prior written permission.
73 </p></li></ol></div><p>
74 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
75 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
76 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
77 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
78 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
79 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
80 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
81 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
82 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
83 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
84 THE POSSIBILITY OF SUCH DAMAGE.
85 </p></blockquote></div></div><div class="sect2" title="2.3. DOM4J"><div class="titlepage"><div><div><h3 class="title"><a name="d0e3611"></a>2.3. DOM4J</h3></div></div></div><p><span class="application">FindBugs</span> uses <a class="ulink" href="http://dom4j.org" target="_top">DOM4J</a>, which is
86 distributed under the following license:</p><div class="blockquote"><blockquote class="blockquote"><p>
87 Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
88 </p><p>
89 Redistribution and use of this software and associated documentation
90 ("Software"), with or without modification, are permitted provided that
91 the following conditions are met:
92 </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
93 Redistributions of source code must retain copyright statements and
94 notices. Redistributions must also contain a copy of this document.
95 </p></li><li class="listitem"><p>
96 Redistributions in binary form must reproduce the above copyright
97 notice, this list of conditions and the following disclaimer in the
98 documentation and/or other materials provided with the distribution.
99 </p></li><li class="listitem"><p>
100 The name "DOM4J" must not be used to endorse or promote products
101 derived from this Software without prior written permission
102 of MetaStuff, Ltd. For written permission, please contact
103 <code class="email">&lt;<a class="email" href="mailto:dom4j-info@metastuff.com">dom4j-info@metastuff.com</a>&gt;</code>.
104 </p></li><li class="listitem"><p>
105 Products derived from this Software may not be called "DOM4J" nor may
106 "DOM4J" appear in their names without prior written permission of
107 MetaStuff, Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
108 </p></li><li class="listitem"><p>
109 Due credit should be given to the DOM4J Project (<a class="ulink" href="http://dom4j.org/" target="_top">http://dom4j.org/</a>).
110 </p></li></ol></div><p>
111 THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS''
112 AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
113 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
114 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS
115 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
116 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
117 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
118 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
119 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
120 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
121 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
122 </p></blockquote></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="license.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left" valign="top">&#31532;13&#31456; &#12521;&#12452;&#12475;&#12531;&#12473;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>
+0
-6
doc/ja/manual/analysisprops.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="filter.html" title="&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;"><link rel="next" href="annotations.html" title="&#31532;10&#31456; &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="filter.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="annotations.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;"><div class="titlepage"><div><div><h2 class="title"><a name="analysisprops"></a>&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;</h2></div></div></div><p><span class="application">FindBugs</span> &#12399;&#20998;&#26512;&#12377;&#12427;&#22580;&#21512;&#12395;&#12356;&#12367;&#12388;&#12363;&#12398;&#35251;&#28857;&#12434;&#25345;&#12387;&#12390;&#12356;&#12414;&#12377;&#12290;&#12381;&#12375;&#12390;&#12289;&#35251;&#28857;&#12434;&#12459;&#12473;&#12479;&#12510;&#12452;&#12474;&#12375;&#12390;&#23455;&#34892;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12471;&#12473;&#12486;&#12512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12434;&#20351;&#12387;&#12390;&#12289;&#12381;&#12428;&#12425;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;&#12371;&#12398;&#31456;&#12391;&#12399;&#12289;&#20998;&#26512;&#12458;&#12503;&#12471;&#12519;&#12531;&#12398;&#35373;&#23450;&#26041;&#27861;&#12434;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;</p><p>&#20998;&#26512;&#12458;&#12503;&#12471;&#12519;&#12531;&#12398;&#20027;&#12394;&#30446;&#30340;&#12399;&#12289; 2 &#12388;&#12354;&#12426;&#12414;&#12377;&#12290;1 &#30058;&#30446;&#12399;&#12289; <span class="application">FindBugs</span> &#12395;&#23550;&#12375;&#12390;&#20998;&#26512;&#12373;&#12428;&#12427;&#12450;&#12503;&#12522;&#12465;&#12540;&#12471;&#12519;&#12531;&#12398;&#12513;&#12477;&#12483;&#12489;&#12398;&#24847;&#21619;&#12434;&#20253;&#12360;&#12427;&#12371;&#12392;&#12391;&#12377;&#12290;&#12381;&#12358;&#12377;&#12427;&#12371;&#12392;&#12391; <span class="application">FindBugs</span> &#12364;&#12424;&#12426;&#27491;&#30906;&#12394;&#32080;&#26524;&#12434;&#20986;&#12377;&#12371;&#12392;&#12364;&#12391;&#12365;&#12289;&#35492;&#26908;&#20986;&#12434;&#28187;&#12425;&#12377;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;2 &#30058;&#30446;&#12395;&#12289;&#20998;&#26512;&#12434;&#34892;&#12358;&#12395;&#24403;&#12383;&#12426;&#12381;&#12398;&#31934;&#24230;&#12434;&#35373;&#23450;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12377;&#12427;&#12371;&#12392;&#12391;&#12377;&#12290;&#20998;&#26512;&#12398;&#31934;&#24230;&#12434;&#33853;&#12392;&#12377;&#12371;&#12392;&#12391;&#12289;&#12513;&#12514;&#12522;&#20351;&#29992;&#37327;&#12392;&#20998;&#26512;&#26178;&#38291;&#12434;&#28187;&#12425;&#12377;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12383;&#12384;&#12375;&#12289;&#26412;&#24403;&#12398;&#12496;&#12464;&#12434;&#35211;&#36867;&#12375;&#12383;&#12426;&#12289;&#35492;&#26908;&#20986;&#12398;&#25968;&#12364;&#22679;&#12360;&#12427;&#12392;&#12356;&#12358;&#20195;&#20767;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p><p>&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531; <span class="command"><strong>-property</strong></span> &#12434;&#20351;&#12387;&#12390;&#12289;&#20998;&#26512;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#35373;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#27425;&#12395;&#12289;&#20363;&#12434;&#31034;&#12375;&#12414;&#12377;:</p><pre class="screen">
3 <code class="prompt">$ </code><span class="command"><strong>findbugs -textui -property "cfg.noprune=true" <em class="replaceable"><code>myApp.jar</code></em></strong></span>
4 </pre><p>
5 </p><p>&#35373;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#20998;&#26512;&#12458;&#12503;&#12471;&#12519;&#12531;&#12398;&#19968;&#35239;&#12434; <a class="xref" href="analysisprops.html#analysisproptable" title="&#34920;9.1 &#35373;&#23450;&#21487;&#33021;&#12394;&#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;">&#34920;9.1&#12300;&#35373;&#23450;&#21487;&#33021;&#12394;&#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12301;</a> &#12395;&#31034;&#12375;&#12414;&#12377;&#12290;</p><div class="table"><a name="analysisproptable"></a><p class="title"><b>&#34920;9.1 &#35373;&#23450;&#21487;&#33021;&#12394;&#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;</b></p><div class="table-contents"><table summary="&#35373;&#23450;&#21487;&#33021;&#12394;&#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#21517;</th><th align="left">&#35373;&#23450;&#20516;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">findbugs.assertionmethods</td><td align="left">&#12467;&#12531;&#12510;&#21306;&#20999;&#12426;&#12398;&#23436;&#20840;&#20462;&#39166;&#12513;&#12477;&#12483;&#12489;&#21517;&#12522;&#12473;&#12488; : &#20363;&#12289; "com.foo.MyClass.checkAssertion"</td><td align="left">&#12371;&#12398;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12395;&#12399;&#12289;&#12503;&#12525;&#12464;&#12521;&#12512;&#12364;&#27491;&#12375;&#12356;&#12371;&#12392;&#12434;&#12481;&#12455;&#12483;&#12463;&#12377;&#12427;&#12383;&#12417;&#12395;&#20351;&#12431;&#12428;&#12427;&#12513;&#12477;&#12483;&#12489;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12371;&#12428;&#12425;&#12398;&#12513;&#12477;&#12483;&#12489;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289; &#12481;&#12455;&#12483;&#12463;&#12513;&#12477;&#12483;&#12489;&#12391;&#30906;&#35469;&#12375;&#12383;&#20516;&#12395;&#23550;&#12377;&#12427; null &#21442;&#29031;&#12450;&#12463;&#12475;&#12473;&#12487;&#12451;&#12486;&#12463;&#12479;&#12398;&#35492;&#26908;&#20986;&#12434;&#22238;&#36991;&#12391;&#12365;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">findbugs.de.comment</td><td align="left">true &#12414;&#12383;&#12399; false</td><td align="left">true &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289; DroppedException (&#28961;&#35222;&#12373;&#12428;&#12383;&#20363;&#22806;) &#12487;&#12451;&#12486;&#12463;&#12479;&#12399;&#31354;&#12398; catch &#12502;&#12525;&#12483;&#12463; &#12395;&#12467;&#12513;&#12531;&#12488;&#12364;&#28961;&#12356;&#12363;&#25506;&#12375;&#12414;&#12377;&#12290;&#12381;&#12375;&#12390;&#12289;&#12467;&#12513;&#12531;&#12488;&#12364;&#12415;&#12388;&#12363;&#12387;&#12383;&#22580;&#21512;&#12395;&#12399;&#35686;&#21578;&#12364;&#22577;&#21578;&#12373;&#12428;&#12414;&#12379;&#12435;&#12290;</td></tr><tr><td align="left">findbugs.maskedfields.locals</td><td align="left">true &#12414;&#12383;&#12399; false</td><td align="left">true &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#12501;&#12451;&#12540;&#12523;&#12489;&#12434;&#38560;&#34109;&#12375;&#12390;&#12356;&#12427;&#12525;&#12540;&#12459;&#12523;&#22793;&#25968;&#12395;&#23550;&#12375;&#12390;&#20778;&#20808;&#24230;(&#20302;)&#12398;&#35686;&#21578;&#12364;&#30330;&#34892;&#12373;&#12428;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289; false &#12391;&#12377;&#12290;</td></tr><tr><td align="left">findbugs.nullderef.assumensp</td><td align="left">true &#12414;&#12383;&#12399; false</td><td align="left">&#20351;&#29992;&#12373;&#12428;&#12414;&#12379;&#12435;&#12290; (&#24847;&#22259; : true &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;null &#21442;&#29031;&#12450;&#12463;&#12475;&#12473;&#12487;&#12451;&#12486;&#12463;&#12479;&#12399;&#12513;&#12477;&#12483;&#12489;&#12363;&#12425;&#12398;&#25147;&#12426;&#20516;&#12289;&#12414;&#12383;&#12399;&#12289;&#12513;&#12477;&#12483;&#12489;&#12395;&#21463;&#12369;&#28193;&#12373;&#12428;&#12427;&#24341;&#25968;&#12434; null &#12391;&#12354;&#12427;&#12392;&#20206;&#23450;&#12375;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289; false &#12391;&#12377;&#12290;&#12371;&#12398;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12434;&#26377;&#21177;&#12395;&#12377;&#12427;&#12392;&#12289;&#22823;&#37327;&#12398;&#35492;&#26908;&#20986;&#12364;&#29983;&#25104;&#12373;&#12428;&#12427;&#12391;&#12354;&#12429;&#12358;&#12371;&#12392;&#12395;&#27880;&#24847;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;)</td></tr><tr><td align="left">findbugs.refcomp.reportAll</td><td align="left">true &#12414;&#12383;&#12399; false</td><td align="left">true &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289; == &#12362;&#12424;&#12403; != &#28436;&#31639;&#23376;&#12434;&#20351;&#12387;&#12390;&#12356;&#12427;&#30097;&#12431;&#12375;&#12356;&#21442;&#29031;&#27604;&#36611;&#12364;&#12377;&#12409;&#12390;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290; false &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#21516;&#27096;&#12398;&#35686;&#21578;&#12399; 1 &#12513;&#12477;&#12483;&#12489;&#12395;&#12388;&#12365; 1 &#12388;&#12375;&#12363;&#30330;&#34892;&#12373;&#12428;&#12414;&#12379;&#12435;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289; false &#12391;&#12377;&#12290;</td></tr><tr><td align="left">findbugs.sf.comment</td><td align="left">true &#12414;&#12383;&#12399; false</td><td align="left">true &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289; SwitchFallthrough &#12487;&#12451;&#12486;&#12463;&#12479;&#12399;&#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12395;&#12300;fall&#12301;&#12414;&#12383;&#12399;&#12300;nobreak&#12301;&#12392;&#12356;&#12358;&#21336;&#35486;&#12434;&#21547;&#12435;&#12384;&#12467;&#12513;&#12531;&#12488;&#12434;&#35352;&#36617;&#12375;&#12390;&#12356;&#12394;&#12356; case&#12521;&#12505;&#12523; &#12395;&#38480;&#12426;&#35686;&#21578;&#12434;&#22577;&#21578;&#12375;&#12414;&#12377;&#12290;(&#12371;&#12398;&#27231;&#33021;&#12364;&#27491;&#12375;&#12367;&#21205;&#20316;&#12377;&#12427;&#12383;&#12417;&#12395;&#12399;&#12289;&#27491;&#30906;&#12394;&#12477;&#12540;&#12473;&#12497;&#12473;&#12364;&#24517;&#35201;&#12391;&#12377;&#12290;) &#12371;&#12428;&#12395;&#12424;&#12426;&#12289;&#24847;&#22259;&#30340;&#12391;&#12399;&#12394;&#12356; switch &#25991;&#12398; fallthrough &#12434;&#30330;&#35211;&#12375;&#26131;&#12367;&#12394;&#12426;&#12414;&#12377;&#12290;</td></tr></tbody></table></div></div><br class="table-break"></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="filter.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="annotations.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;10&#31456; &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;</td></tr></table></div></body></html>
+0
-67
doc/ja/manual/annotations.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;10&#31456; &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="analysisprops.html" title="&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;"><link rel="next" href="rejarForAnalysis.html" title="&#31532;11&#31456; rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;10&#31456; &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="analysisprops.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="rejarForAnalysis.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;10&#31456; &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;"><div class="titlepage"><div><div><h2 class="title"><a name="annotations"></a>&#31532;10&#31456; &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;</h2></div></div></div><p><span class="application">FindBugs</span> &#12399;&#12356;&#12367;&#12388;&#12363;&#12398;&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#12469;&#12509;&#12540;&#12488;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#38283;&#30330;&#32773;&#12398;&#24847;&#22259;&#12434;&#26126;&#30906;&#12395;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289; FindBugs &#12399;&#12424;&#12426;&#30340;&#30906;&#12395;&#35686;&#21578;&#12434;&#30330;&#34892;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#20351;&#29992;&#12377;&#12427;&#12383;&#12417;&#12395;&#12399; Java 5 &#12364;&#24517;&#35201;&#12391;&#12354;&#12426;&#12289; annotations.jar &#12362;&#12424;&#12403; jsr305.jar &#12501;&#12449;&#12452;&#12523;&#12434;&#12467;&#12531;&#12497;&#12452;&#12523;&#26178;&#12398;&#12463;&#12521;&#12473;&#12497;&#12473;&#12395;&#21547;&#12417;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.CheckForNull</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
3 <p>&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#12388;&#12369;&#12383;&#35201;&#32032;&#12399;&#12289; null &#12391;&#12354;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#12375;&#12383;&#12364;&#12387;&#12390;&#12289;&#24403;&#35442;&#35201;&#32032;&#12434;&#20351;&#29992;&#12377;&#12427;&#38555;&#12399; null &#12481;&#12455;&#12483;&#12463;&#12434;&#12377;&#12427;&#12409;&#12365;&#12391;&#12377;&#12290;&#12371;&#12398;&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#12513;&#12477;&#12483;&#12489;&#12395;&#36969;&#29992;&#12377;&#12427;&#12392;&#12289;&#12513;&#12477;&#12483;&#12489;&#12398;&#25147;&#12426;&#20516;&#12395;&#36969;&#29992;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.CheckReturnValue</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Method, Constructor
4 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
5 <span class="command"><strong>priority:</strong></span> &#35686;&#21578;&#12398;&#20778;&#20808;&#24230;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377; (HIGH, MEDIUM, LOW, IGNORE) &#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#20516; :MEDIUM&#12290;</p><p>
6 <span class="command"><strong>explanation:</strong></span>&#25147;&#12426;&#20516;&#12434;&#12481;&#12455;&#12483;&#12463;&#12375;&#12394;&#12369;&#12400;&#12394;&#12425;&#12394;&#12356;&#29702;&#30001;&#12434;&#12486;&#12461;&#12473;&#12488;&#12391;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#20516; :""&#12290;</p></dd></dl></div><p>&#12371;&#12398;&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#20351;&#29992;&#12375;&#12390;&#12289;&#21628;&#20986;&#12375;&#24460;&#12395;&#25147;&#12426;&#20516;&#12434;&#12481;&#12455;&#12483;&#12463;&#12377;&#12409;&#12365;&#12513;&#12477;&#12483;&#12489;&#12434;&#34920;&#12377;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.DefaultAnnotation</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Package
7 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
8 <span class="command"><strong>value:</strong></span>&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12463;&#12521;&#12473;&#12398;class&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12290;&#35079;&#25968;&#12398;&#12463;&#12521;&#12473;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>
9 <span class="command"><strong>priority:</strong></span>&#30465;&#30053;&#26178;&#12398;&#20778;&#20808;&#24230;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377; (HIGH, MEDIUM, LOW, IGNORE) &#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#20516; :MEDIUM&#12290;</p></dd></dl></div><p>
10 Indicates that all members of the class or package should be annotated with the default
11 value of the supplied annotation classes. This would be used for behavior annotations
12 such as @NonNull, @CheckForNull, or @CheckReturnValue. In particular, you can use
13 @DefaultAnnotation(NonNull.class) on a class or package, and then use @Nullable only
14 on those parameters, methods or fields that you want to allow to be null.
15 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.DefaultAnnotationForFields</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Package
16 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
17 <span class="command"><strong>value:</strong></span>&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12463;&#12521;&#12473;&#12398;class&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12290;&#35079;&#25968;&#12398;&#12463;&#12521;&#12473;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>
18 <span class="command"><strong>priority:</strong></span>&#30465;&#30053;&#26178;&#12398;&#20778;&#20808;&#24230;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377; (HIGH, MEDIUM, LOW, IGNORE) &#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#20516; :MEDIUM&#12290;</p></dd></dl></div><p>
19 This is same as the DefaultAnnotation except it only applys to fields.
20 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.DefaultAnnotationForMethods</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Package
21 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
22 <span class="command"><strong>value:</strong></span>&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12463;&#12521;&#12473;&#12398;class&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12290;&#35079;&#25968;&#12398;&#12463;&#12521;&#12473;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>
23 <span class="command"><strong>priority:</strong></span>&#30465;&#30053;&#26178;&#12398;&#20778;&#20808;&#24230;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377; (HIGH, MEDIUM, LOW, IGNORE) &#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#20516; :MEDIUM&#12290;</p></dd></dl></div><p>
24 This is same as the DefaultAnnotation except it only applys to methods.
25 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.DefaultAnnotationForParameters</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Package
26 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
27 <span class="command"><strong>value:</strong></span>&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12463;&#12521;&#12473;&#12398;class&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12290;&#35079;&#25968;&#12398;&#12463;&#12521;&#12473;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>
28 <span class="command"><strong>priority:</strong></span>&#30465;&#30053;&#26178;&#12398;&#20778;&#20808;&#24230;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377; (HIGH, MEDIUM, LOW, IGNORE) &#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#20516; :MEDIUM&#12290;</p></dd></dl></div><p>
29 This is same as the DefaultAnnotation except it only applys to method parameters.
30 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.NonNull</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
31 <p>&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#12388;&#12369;&#12383;&#35201;&#32032;&#12399;&#12289; null &#12391;&#12354;&#12387;&#12390;&#12399;&#12356;&#12369;&#12414;&#12379;&#12435;&#12290;&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#12388;&#12369;&#12383;&#12501;&#12451;&#12540;&#12523;&#12489;&#12399;&#12289;&#27083;&#31689;&#23436;&#20102;&#24460; null &#12391;&#12354;&#12387;&#12390;&#12399;&#12356;&#12369;&#12414;&#12379;&#12435;&#12290;&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#12388;&#12369;&#12383;&#12513;&#12477;&#12483;&#12489;&#12399;&#12289; null &#12391;&#12399;&#12394;&#12356;&#20516;&#12434;&#25147;&#12426;&#20516;&#12392;&#12375;&#12394;&#12369;&#12428;&#12400;&#12394;&#12426;&#12414;&#12379;&#12435;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.Nullable</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
32 <p>&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12434;&#12388;&#12369;&#12383;&#35201;&#32032;&#12399;&#12289; null &#12391;&#12354;&#12387;&#12390;&#12399;&#12356;&#12369;&#12414;&#12379;&#12435;&#12290;In general, this means developers will have to read the documentation to determine when a null value is acceptable and whether it is neccessary to check for a null value. FindBugs will treat the annotated items as though they had no annotation.</p><p>
33 In pratice this annotation is useful only for overriding an overarching NonNull
34 annotation.
35 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.OverrideMustInvoke</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Method
36 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
37 <span class="command"><strong>value:</strong></span>Specify when the super invocation should be
38 performed (FIRST, ANYTIME, LAST). Default value:ANYTIME.
39 </p></dd></dl></div><p>
40 Used to annotate a method that, if overridden, must (or should) be invoke super
41 in the overriding method. Examples of such methods include finalize() and clone().
42 The argument to the method indicates when the super invocation should occur:
43 at any time, at the beginning of the overriding method, or at the end of the overriding method.
44 (This anotation is not implmemented in FindBugs as of September 8, 2006).
45 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.PossiblyNull</strong></span></span></dt><dd><p>
46 This annotation is deprecated. Use CheckForNull instead.
47 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.SuppressWarnings</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Field, Method, Parameter, Constructor, Package
48 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
49 <span class="command"><strong>value:</strong></span>The name of the warning. More than one name can be specified.
50 </p><p>
51 <span class="command"><strong>justification:</strong></span>Reason why the warning should be ignored. &#12487;&#12501;&#12457;&#12523;&#12488;&#20516; :""&#12290;</p></dd></dl></div><p>
52 The set of warnings that are to be suppressed by the compiler in the annotated element.
53 Duplicate names are permitted. The second and successive occurrences of a name are ignored.
54 The presence of unrecognized warning names is <span class="emphasis"><em>not</em></span> an error: Compilers
55 must ignore any warning names they do not recognize. They are, however, free to emit a
56 warning if an annotation contains an unrecognized warning name. Compiler vendors should
57 document the warning names they support in conjunction with this annotation type. They
58 are encouraged to cooperate to ensure that the same names work across multiple compilers.
59 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.UnknownNullness</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
60 <p>
61 Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
62 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.UnknownNullness</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
63 <p>
64 Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
65 </p></dd></dl></div><p>&#12414;&#12383;&#12289; <span class="application">FindBugs</span> &#27425;&#12395;&#31034;&#12377;&#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&#12418;&#12469;&#12509;&#12540;&#12488;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290; :</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">net.jcip.annotations.GuardedBy</li><li class="listitem">net.jcip.annotations.Immutable</li><li class="listitem">net.jcip.annotations.NotThreadSafe</li><li class="listitem">net.jcip.annotations.ThreadSafe</li></ul></div><p>
66 </p><p><a class="ulink" href="http://jcip.net/" target="_top">Java Concurrency in Practice</a> &#12398; <a class="ulink" href="http://jcip.net/annotations/doc/index.html" target="_top"> API &#12489;&#12461;&#12517;&#12513;&#12531;&#12488;</a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="analysisprops.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="rejarForAnalysis.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;11&#31456; rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;</td></tr></table></div></body></html>
+0
-40
doc/ja/manual/anttask.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;6&#31456; FindBugs&#8482; Ant &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="gui.html" title="&#31532;5&#31456; FindBugs GUI &#12398;&#20351;&#29992;&#26041;&#27861;"><link rel="next" href="eclipse.html" title="&#31532;7&#31456; FindBugs&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;6&#31456; <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gui.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="eclipse.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;6&#31456; FindBugs&#8482; Ant &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;"><div class="titlepage"><div><div><h2 class="title"><a name="anttask"></a>&#31532;6&#31456; <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="anttask.html#d0e1173">1. <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1209">2. build.xml &#12398;&#26360;&#12365;&#26041;</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1278">3. &#12479;&#12473;&#12463;&#12398;&#23455;&#34892;</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1303">4. &#12497;&#12521;&#12513;&#12540;&#12479;&#12540;</a></span></dt></dl></div><p>&#12371;&#12398;&#31456;&#12391;&#12399;&#12289; <span class="application">FindBugs</span> &#12434; <a class="ulink" href="http://ant.apache.org/" target="_top"><span class="application">Ant</span></a> &#12398;&#12499;&#12523;&#12489;&#12473;&#12463;&#12522;&#12503;&#12488;&#12395;&#32068;&#12415;&#20837;&#12428;&#12427;&#26041;&#27861;&#12395;&#12388;&#12356;&#12390;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290; <a class="ulink" href="http://ant.apache.org/" target="_top"><span class="application">Ant</span></a> &#12399;&#12289;&#12499;&#12523;&#12489;&#12420;&#37197;&#20633;&#12434;&#34892;&#12358;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427; Java &#12391;&#12424;&#12367;&#20351;&#29992;&#12373;&#12428;&#12427;&#12484;&#12540;&#12523;&#12391;&#12377;&#12290;<span class="application">FindBugs</span> <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12434;&#20351;&#29992;&#12377;&#12427;&#12392;&#12289; &#12499;&#12523;&#12489;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20316;&#25104;&#12375;&#12390;&#27231;&#26800;&#30340;&#12395; <span class="application">FindBugs</span> &#12395;&#12424;&#12427; Java &#12467;&#12540;&#12489;&#12398;&#20998;&#26512;&#12434;&#23455;&#34892;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12371;&#12398; <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12399;&#12289; Mike Fagan &#27663;&#12398;&#22810;&#22823;&#12394;&#36002;&#29486;&#12395;&#12424;&#12427;&#12418;&#12398;&#12391;&#12377;&#12290;</p><div class="sect1" title="1. Ant &#12479;&#12473;&#12463;&#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1173"></a>1. <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</h2></div></div></div><p><span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12399;&#12289; <code class="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbugs-ant.jar</code> &#12434; <span class="application">Ant</span> &#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12398;<code class="filename">lib</code> &#12469;&#12502;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12395;&#12467;&#12500;&#12540;&#12377;&#12427;&#12384;&#12369;&#12391;&#12377;&#12290;</p><div class="note" title="&#27880;&#35352;" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[&#27880;&#35352;]" src="note.png"></td><th align="left">&#27880;&#35352;</th></tr><tr><td align="left" valign="top"><p>&#20351;&#29992;&#12377;&#12427; <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12392; <span class="application">FindBugs</span> &#26412;&#20307;&#12399;&#12289;&#21516;&#26801;&#12373;&#12428;&#12390;&#12356;&#12383;&#21516;&#12376;&#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#12418;&#12398;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12434;&#24375;&#12367;&#25512;&#22888;&#12375;&#12414;&#12377;&#12290;&#21029;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12398; <span class="application">FindBugs</span> &#12395;&#21547;&#12414;&#12428;&#12390;&#12356;&#12383; <span class="application">Ant</span> &#12479;&#12473;&#12463; Jar &#12501;&#12449;&#12452;&#12523;&#12391;&#12398;&#21205;&#20316;&#12399;&#20445;&#35388;&#12375;&#12414;&#12379;&#12435;&#12290;</p></td></tr></table></div><p>
3 </p></div><div class="sect1" title="2. build.xml &#12398;&#26360;&#12365;&#26041;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1209"></a>2. build.xml &#12398;&#26360;&#12365;&#26041;</h2></div></div></div><p><span class="application">FindBugs</span> &#12434; <code class="filename">build.xml</code> (<span class="application">Ant</span> &#12499;&#12523;&#12489;&#12473;&#12463;&#12522;&#12503;&#12488;) &#12395;&#32068;&#12415;&#20837;&#12428;&#12427;&#12383;&#12417;&#12395;&#12399;&#12414;&#12378;&#12289;&#12479;&#12473;&#12463;&#23450;&#32681;&#12434;&#35352;&#36848;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#12479;&#12473;&#12463;&#23450;&#32681;&#12399;&#27425;&#12398;&#12424;&#12358;&#12395;&#35352;&#36848;&#12375;&#12414;&#12377;&#12290;:</p><pre class="screen">
4 &lt;taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/&gt;
5 </pre><p>&#12479;&#12473;&#12463;&#23450;&#32681;&#12399;&#12289; <code class="literal">findbugs</code> &#35201;&#32032;&#12434; <code class="filename">build.xml</code> &#19978;&#12395;&#35352;&#36848;&#12375;&#12383;&#12392;&#12365;&#12289;&#12381;&#12398;&#12479;&#12473;&#12463;&#12398;&#23455;&#34892;&#12395;&#20351;&#29992;&#12373;&#12428;&#12427;&#12463;&#12521;&#12473;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p><p>&#12479;&#12473;&#12463;&#23450;&#32681;&#12398;&#35352;&#36848;&#12434;&#12377;&#12428;&#12400;&#12289;<code class="literal">findbugs</code> &#12479;&#12473;&#12463;&#12434;&#20351;&#12387;&#12390;&#12479;&#12540;&#12466;&#12483;&#12488;&#12434;&#23450;&#32681;&#12391;&#12365;&#12414;&#12377;&#12290;&#27425;&#12395;&#31034;&#12377;&#12398;&#12399;&#12289; Apache <a class="ulink" href="http://jakarta.apache.org/bcel/" target="_top">BCEL</a> &#12521;&#12452;&#12502;&#12521;&#12522;&#12540;&#12434;&#20998;&#26512;&#12377;&#12427;&#22580;&#21512;&#12434;&#24819;&#23450;&#12375;&#12383; <code class="filename">build.xml</code> &#12398;&#35352;&#36848;&#20363;&#12391;&#12377;&#12290;</p><pre class="screen">
6 &lt;property name="findbugs.home" value="/export/home/daveho/work/findbugs" /&gt;
7
8 &lt;target name="findbugs" depends="jar"&gt;
9 &lt;findbugs home="${findbugs.home}"
10 output="xml"
11 outputFile="bcel-fb.xml" &gt;
12 &lt;auxClasspath path="${basedir}/lib/Regex.jar" /&gt;
13 &lt;sourcePath path="${basedir}/src/java" /&gt;
14 &lt;class location="${basedir}/bin/bcel.jar" /&gt;
15 &lt;/findbugs&gt;
16 &lt;/target&gt;
17 </pre><p><code class="literal">findbugs</code> &#35201;&#32032;&#12395;&#12399;&#12289; <code class="literal">home</code> &#23646;&#24615;&#12364;&#24517;&#38920;&#12391;&#12377;&#12290; <span class="application">FindBugs</span> &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12377;&#12394;&#12431;&#12385; <em class="replaceable"><code>$FINDBUGS_HOME</code></em> &#12398;&#20516;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;<a class="xref" href="installing.html" title="&#31532;2&#31456; FindBugs&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;">2&#31456;<i><span class="application">FindBugs</span>&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p><p>&#12371;&#12398;&#12479;&#12540;&#12466;&#12483;&#12488;&#12399; <code class="filename">bcel.jar</code> &#12395;&#23550;&#12375;&#12390; <span class="application">FindBugs</span> &#12434;&#23455;&#34892;&#12375;&#12414;&#12377;&#12290;&#12371;&#12398; Jar &#12501;&#12449;&#12452;&#12523;&#12399;&#12289; BCEL &#12499;&#12523;&#12489;&#12473;&#12463;&#12522;&#12503;&#12488;&#12395;&#12424;&#12387;&#12390;&#20316;&#25104;&#12373;&#12428;&#12427;&#12418;&#12398;&#12391;&#12377;&#12290;(&#19978;&#35352;&#12398;&#12479;&#12540;&#12466;&#12483;&#12488;&#12364;&#12300;jar&#12301;&#12479;&#12540;&#12466;&#12483;&#12488;&#12395;&#20381;&#23384;&#12375;&#12390;&#12356;&#12427; (depends) &#12392;&#35373;&#23450;&#12377;&#12427;&#12371;&#12392;&#12395;&#12424;&#12426;&#12289; <span class="application">FindBugs</span> &#12364;&#23455;&#34892;&#12373;&#12428;&#12427;&#21069;&#12395;&#24403;&#35442;&#12521;&#12452;&#12502;&#12521;&#12522;&#12540;&#12364;&#23436;&#20840;&#12395;&#12467;&#12531;&#12497;&#12452;&#12523;&#12373;&#12428;&#12390;&#12356;&#12427;&#12371;&#12392;&#12434;&#20445;&#35388;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;) <span class="application">FindBugs</span> &#12398;&#20986;&#21147;&#12399;&#12289; XML &#24418;&#24335;&#12391; <code class="filename">bcel-fb.xml</code> &#12501;&#12449;&#12452;&#12523;&#12395;&#20445;&#23384;&#12373;&#12428;&#12414;&#12377;&#12290;&#35036;&#21161; Jar &#12501;&#12449;&#12452;&#12523; <code class="filename">Regex.jar</code> &#12434; aux classpath &#12395;&#35352;&#36848;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12394;&#12380;&#12394;&#12425;&#12289;&#24403;&#35442; Jar &#12501;&#12449;&#12452;&#12523;&#12364; BCEL &#12513;&#12452;&#12531;&#65381;&#12521;&#12452;&#12502;&#12521;&#12522;&#12540;&#12363;&#12425;&#21442;&#29031;&#12373;&#12428;&#12427;&#12363;&#12425;&#12391;&#12377;&#12290;source path &#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#20445;&#23384;&#12373;&#12428;&#12427;&#12496;&#12464;&#12487;&#12540;&#12479;&#12395; BCEL &#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12408;&#12398;&#27491;&#30906;&#12394;&#21442;&#29031;&#12364;&#35352;&#36848;&#12373;&#12428;&#12414;&#12377;&#12290;</p></div><div class="sect1" title="3. &#12479;&#12473;&#12463;&#12398;&#23455;&#34892;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1278"></a>3. &#12479;&#12473;&#12463;&#12398;&#23455;&#34892;</h2></div></div></div><p>&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12363;&#12425; <span class="application">Ant</span> &#12434;&#36215;&#21205;&#12377;&#12427;&#20363;&#12434;&#27425;&#12395;&#31034;&#12375;&#12414;&#12377;&#12290;&#21069;&#36848;&#12398; <code class="literal">findbugs</code> &#12479;&#12540;&#12466;&#12483;&#12488;&#12434;&#20351;&#29992;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;</p><pre class="screen">
18 <code class="prompt">[daveho@noir]$</code> <span class="command"><strong>ant findbugs</strong></span>
19 Buildfile: build.xml
20
21 init:
22
23 compile:
24
25 examples:
26
27 jar:
28
29 findbugs:
30 [findbugs] Running FindBugs...
31 [findbugs] Bugs were found
32 [findbugs] Output saved to bcel-fb.xml
33
34 BUILD SUCCESSFUL
35 Total time: 35 seconds
36 </pre><p>&#12371;&#12398;&#20107;&#20363;&#12395;&#12362;&#12356;&#12390;&#12399;&#12289;XML &#12501;&#12449;&#12452;&#12523;&#12391;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12434;&#20445;&#23384;&#12375;&#12390;&#12356;&#12427;&#12398;&#12391;&#12289; <span class="application">FindBugs</span> GUI &#12434;&#20351;&#12387;&#12390;&#32080;&#26524;&#12434;&#21442;&#29031;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290; <a class="xref" href="running.html" title="&#31532;4&#31456; FindBugs&#8482; &#12398;&#23455;&#34892;">4&#31456;<i><span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></div><div class="sect1" title="4. &#12497;&#12521;&#12513;&#12540;&#12479;&#12540;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1303"></a>4. &#12497;&#12521;&#12513;&#12540;&#12479;&#12540;</h2></div></div></div><p>&#12371;&#12398;&#12475;&#12463;&#12471;&#12519;&#12531;&#12391;&#12399;&#12289; <span class="application">FindBugs</span> &#12479;&#12473;&#12463;&#12434;&#20351;&#29992;&#12377;&#12427;&#38555;&#12395;&#12289;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12497;&#12521;&#12513;&#12540;&#12479;&#12540;&#12395;&#12388;&#12356;&#12390;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;</p><div class="variablelist"><dl><dt><span class="term"><code class="literal">class</code></span></dt><dd><p>&#20998;&#26512;&#12398;&#23550;&#35937;&#12392;&#12394;&#12427;&#12463;&#12521;&#12473;&#32676;&#12434;&#25351;&#23450;&#12377;&#12427;&#12383;&#12417;&#12398;&#12493;&#12473;&#12488;&#12373;&#12428;&#12427;&#35201;&#32032;&#12391;&#12377;&#12290;<code class="literal">class</code> &#35201;&#32032;&#12395;&#12399; <code class="literal">location</code> &#23646;&#24615;&#12398;&#25351;&#23450;&#12364;&#24517;&#38920;&#12391;&#12377;&#12290;&#20998;&#26512;&#23550;&#35937;&#12392;&#12394;&#12427;&#12450;&#12540;&#12459;&#12452;&#12502;&#12501;&#12449;&#12452;&#12523; (jar, zip, &#20182;)&#12289;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12414;&#12383;&#12399;&#12463;&#12521;&#12473;&#12501;&#12449;&#12452;&#12523;&#12398;&#21517;&#21069;&#12434;&#35352;&#36848;&#12375;&#12414;&#12377;&#12290;1 &#12388;&#12398; <code class="literal">findbugs</code> &#35201;&#32032;&#12395;&#23550;&#12375;&#12390;&#12289;&#35079;&#25968;&#12398; <code class="literal">class</code> &#23376;&#35201;&#32032;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">auxClasspath</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#12493;&#12473;&#12488;&#12373;&#12428;&#12427;&#35201;&#32032;&#12391;&#12377;&#12290;&#20998;&#26512;&#23550;&#35937;&#12398;&#12521;&#12452;&#12502;&#12521;&#12522;&#12540;&#12414;&#12383;&#12399;&#12450;&#12503;&#12522;&#12465;&#12540;&#12471;&#12519;&#12531;&#12395;&#12424;&#12387;&#12390;&#20351;&#29992;&#12373;&#12428;&#12390;&#12356;&#12427;&#12364;&#20998;&#26512;&#12398;&#23550;&#35937;&#12395;&#12399;&#12375;&#12383;&#12367;&#12394;&#12356;&#12463;&#12521;&#12473;&#12434;&#21547;&#12435;&#12391;&#12356;&#12427;&#12463;&#12521;&#12473;&#12497;&#12473; (Jar &#12501;&#12449;&#12452;&#12523;&#12414;&#12383;&#12399;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;) &#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290; <span class="application">Ant</span> &#12398; Java &#12479;&#12473;&#12463;&#12395;&#12354;&#12427; <code class="literal">classpath</code> &#35201;&#32032; &#12392;&#21516;&#12376;&#26041;&#27861;&#12391;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">sourcePath</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#12493;&#12473;&#12488;&#12373;&#12428;&#12427;&#35201;&#32032;&#12391;&#12377;&#12290;&#20998;&#26512;&#23550;&#35937; Java &#12467;&#12540;&#12489;&#12398;&#12467;&#12531;&#12497;&#12452;&#12523;&#26178;&#12395;&#20351;&#29992;&#12375;&#12383;&#12477;&#12540;&#12473;&#12501;&#12449;&#12452;&#12523;&#12434;&#21547;&#12435;&#12391;&#12356;&#12427;&#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12408;&#12398;&#12497;&#12473;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12477;&#12540;&#12473;&#12497;&#12473;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12395;&#12424;&#12426;&#12289;&#29983;&#25104;&#12373;&#12428;&#12427; XML &#12398;&#12496;&#12464;&#20986;&#21147;&#32080;&#26524;&#12395;&#23436;&#20840;&#12394;&#12477;&#12540;&#12473;&#24773;&#22577;&#12434;&#12418;&#12383;&#12379;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12289;&#24460;&#12395;&#12394;&#12387;&#12390; GUI &#12391;&#21442;&#29031;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">home</code></span></dt><dd><p>&#24517;&#38920;&#23646;&#24615;&#12391;&#12377;&#12290;<span class="application">FindBugs</span> &#12364;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12373;&#12428;&#12390;&#12356;&#12427;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#21517;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">quietErrors</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#12502;&#12540;&#12523;&#20516;&#23646;&#24615;&#12391;&#12377;&#12290;true &#12434;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#28145;&#21051;&#12394;&#20998;&#26512;&#12456;&#12521;&#12540;&#30330;&#29983;&#12420;&#12463;&#12521;&#12473;&#12364;&#12415;&#12388;&#12363;&#12425;&#12394;&#12356;&#12392;&#12356;&#12387;&#12383;&#24773;&#22577;&#12364; <span class="application">FindBugs</span> &#20986;&#21147;&#12395;&#35352;&#37682;&#12373;&#12428;&#12414;&#12379;&#12435;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289; false &#12391;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">reportLevel</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;&#22577;&#21578;&#12373;&#12428;&#12427;&#12496;&#12464;&#12398;&#20778;&#20808;&#24230;&#12398;&#12375;&#12365;&#12356;&#20516;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12300;low&#12301;&#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#12377;&#12409;&#12390;&#12398;&#12496;&#12464;&#12364;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290;&#12300;medium&#12301; (&#12487;&#12501;&#12457;&#12523;&#12488;) &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20778;&#20808;&#24230; (&#20013;)&#12362;&#12424;&#12403;&#20778;&#20808;&#24230; (&#39640;)&#12398;&#12496;&#12464;&#12364;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290;&#12300;high&#12301;&#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20778;&#20808;&#24230; (&#39640;) &#12398;&#12496;&#12464;&#12398;&#12415;&#12364;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">output</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;&#20986;&#21147;&#24418;&#24335;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12300;xml&#12301; (&#12487;&#12501;&#12457;&#12523;&#12488;) &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20986;&#21147;&#12399; XML &#24418;&#24335;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12300;xml:withMessages&#12301; &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20986;&#21147;&#12399;&#20154;&#38291;&#12364;&#35501;&#12417;&#12427;&#12513;&#12483;&#12475;&#12540;&#12472; &#12364;&#36861;&#21152;&#12373;&#12428;&#12383; XML &#24418;&#24335;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;(XSL &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12434;&#20351;&#12387;&#12390;&#12524;&#12509;&#12540;&#12488;&#12434;&#20316;&#25104;&#12377;&#12427;&#12371;&#12392;&#12434;&#35336;&#30011;&#12375;&#12390;&#12356;&#12427;&#22580;&#21512;&#12399;&#12371;&#12398;&#24418;&#24335;&#12434;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;) &#12300;html&#12301;&#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20986;&#21147;&#12399; HTML &#24418;&#24335;(&#12487;&#12501;&#12457;&#12523;&#12488;&#12398;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12399; default.xsl) &#12395;&#12394;&#12426;&#12414;&#12377;&#12290; &#12300;text&#12301;&#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20986;&#21147;&#12399;&#29305;&#21029;&#12394;&#12486;&#12461;&#12473;&#12488;&#24418;&#24335;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12300;emacs&#12301;&#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20986;&#21147;&#12399; <a class="ulink" href="http://www.gnu.org/software/emacs/" target="_top">Emacs</a> &#12456;&#12521;&#12540;&#12513;&#12483;&#12475;&#12540;&#12472;&#24418;&#24335;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12300;xdocs&#12301;&#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20986;&#21147;&#12399; Apache Maven &#12391;&#20351;&#29992;&#12391;&#12365;&#12427; xdoc XML &#12395;&#12394;&#12426;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">stylesheet</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;output &#23646;&#24615; &#12395; html &#12434;&#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12395;&#12289; HTML &#20986;&#21147;&#20316;&#25104;&#12395;&#20351;&#29992;&#12373;&#12428;&#12427;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;FindBugs &#37197;&#24067;&#29289;&#12395;&#21547;&#12414;&#12428;&#12390;&#12356;&#12427;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12399;&#12289; default.xsl&#12289; fancy.xsl &#12289; fancy-hist.xsl &#12289; plain.xsl &#12362;&#12424;&#12403; summary.xsl &#12391;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#20516;&#12399; default.xsl &#12391;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">sort</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;<code class="literal">output</code> &#23646;&#24615;&#12395;&#12300;text&#12301;&#12434;&#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12395;&#12289;&#12496;&#12464;&#12398;&#22577;&#21578;&#12434;&#12463;&#12521;&#12473;&#38918;&#12395;&#12477;&#12540;&#12488;&#12377;&#12427;&#12363;&#12393;&#12358;&#12363;&#12434; <code class="literal">sort</code> &#23646;&#24615;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289; true &#12391;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">outputFile</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;&#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12289;<span class="application">FindBugs</span> &#12398;&#20986;&#21147;&#12399;&#12381;&#12398;&#21517;&#21069;&#12398;&#12501;&#12449;&#12452;&#12523;&#12408;&#12392;&#20445;&#23384;&#12373;&#12428;&#12414;&#12377;&#12290;&#30465;&#30053;&#26178;&#12289;&#20986;&#21147;&#12399; <span class="application">Ant</span> &#12395;&#12424;&#12387;&#12390;&#30452;&#25509;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">debug</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#12502;&#12540;&#12523;&#20516;&#23646;&#24615;&#12391;&#12377;&#12290;true &#12395;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289; <span class="application">FindBugs</span> &#12399; &#35386;&#26029;&#24773;&#22577;&#12434;&#20986;&#21147;&#12375;&#12414;&#12377;&#12290;&#12393;&#12398;&#12463;&#12521;&#12473;&#12434;&#20998;&#26512;&#12375;&#12390;&#12356;&#12427;&#12363;&#12289;&#12393;&#12398;&#12497;&#12464;&#12497;&#12479;&#12540;&#12531;&#12487;&#12451;&#12486;&#12463;&#12479;&#12364;&#23455;&#34892;&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;&#12289;&#12392;&#12356;&#12358;&#24773;&#22577;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289; false &#12391;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">effort</code></span></dt><dd><p>&#20998;&#26512;&#12398;&#27963;&#21205;&#12524;&#12505;&#12523;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;<code class="literal">min</code> &#12289;<code class="literal">default</code> &#12414;&#12383;&#12399; <code class="literal">max</code> &#12398;&#12356;&#12378;&#12428;&#12363;&#12398;&#20516;&#12434;&#35373;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#20998;&#26512;&#12524;&#12505;&#12523;&#12398;&#35373;&#23450;&#12395;&#38306;&#12377;&#12427;&#35443;&#32048;&#24773;&#22577;&#12399;&#12289; <a class="xref" href="running.html#commandLineOptions" title="3. &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;">&#12300;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;&#12301;</a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><code class="literal">conserveSpace</code></span></dt><dd><p>effort="min" &#12392;&#21516;&#32681;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">workHard</code></span></dt><dd><p>effort="max" &#12392;&#21516;&#32681;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">visitors</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;&#12393;&#12398;&#12496;&#12464;&#12487;&#12451;&#12486;&#12463;&#12479;&#12434;&#23455;&#34892;&#12377;&#12427;&#12363;&#12434;&#12467;&#12531;&#12510;&#21306;&#20999;&#12426;&#12398;&#12522;&#12473;&#12488;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12496;&#12464;&#12487;&#12451;&#12486;&#12463;&#12479;&#12399;&#12497;&#12483;&#12465;&#12540;&#12472;&#25351;&#23450;&#12394;&#12375;&#12398;&#12463;&#12521;&#12473;&#21517;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#30465;&#30053;&#26178;&#12289;&#12487;&#12501;&#12457;&#12523;&#12488;&#12391;&#28961;&#21177;&#21270;&#12373;&#12428;&#12390;&#12356;&#12427;&#12418;&#12398;&#12434;&#38500;&#12367;&#12377;&#12409;&#12390;&#12398;&#12487;&#12451;&#12486;&#12463;&#12479;&#12364;&#23455;&#34892;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">omitVisitors</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;<code class="literal">visitors</code> &#23646;&#24615;&#12392;&#20284;&#12390;&#12356;&#12414;&#12377;&#12364;&#12289;&#12371;&#12385;&#12425;&#12399; <span class="emphasis"><em>&#23455;&#34892;&#12373;&#12428;&#12394;&#12356;</em></span> &#12487;&#12451;&#12486;&#12463;&#12479;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">excludeFilter</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#22577;&#21578;&#12363;&#12425;&#38500;&#22806;&#12373;&#12428;&#12427;&#12496;&#12464;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<a class="xref" href="filter.html" title="&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;">8&#31456;<i>&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><code class="literal">includeFilter</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#22577;&#21578;&#12373;&#12428;&#12427;&#12496;&#12464;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<a class="xref" href="filter.html" title="&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;">8&#31456;<i>&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><code class="literal">projectFile</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12501;&#12449;&#12452;&#12523;&#12399;&#12289; <span class="application">FindBugs</span> GUI &#12391;&#20316;&#25104;&#12375;&#12414;&#12377;&#12290;&#20998;&#26512;&#12373;&#12428;&#12427;&#12463;&#12521;&#12473;&#12289;&#12362;&#12424;&#12403;&#12289;&#35036;&#21161;&#12463;&#12521;&#12473;&#12497;&#12473;&#12289;&#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12364;&#35352;&#20837;&#12373;&#12428;&#12390;&#12414;&#12377;&#12290;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12399;&#12289; <code class="literal">class</code> &#35201;&#32032;&#12539; <code class="literal">auxClasspath</code> &#23646;&#24615;&#12362;&#12424;&#12403; <code class="literal">sourcePath</code> &#23646;&#24615;&#12434;&#35373;&#23450;&#12377;&#12427;&#24517;&#35201;&#12399;&#12354;&#12426;&#12414;&#12379;&#12435;&#12290;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398;&#20316;&#25104;&#26041;&#27861;&#12399;&#12289; <a class="xref" href="running.html" title="&#31532;4&#31456; FindBugs&#8482; &#12398;&#23455;&#34892;">4&#31456;<i><span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><code class="literal">jvmargs</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;<span class="application">FindBugs</span> &#12434;&#23455;&#34892;&#12375;&#12390;&#12356;&#12427; Java &#20206;&#24819;&#12510;&#12471;&#12531;&#12395;&#23550;&#12375;&#12390;&#21463;&#12369;&#28193;&#12373;&#12428;&#12427;&#24341;&#25968;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#24040;&#22823;&#12394;&#12503;&#12525;&#12464;&#12521;&#12512;&#12434;&#20998;&#26512;&#12377;&#12427;&#22580;&#21512;&#12395;&#12289; JVM &#12364;&#20351;&#29992;&#12377;&#12427;&#12513;&#12514;&#12522;&#23481;&#37327;&#12434;&#22679;&#12420;&#12377;&#25351;&#23450;&#12434;&#12377;&#12427;&#12383;&#12417;&#12395;&#12371;&#12398;&#24341;&#25968;&#12434;&#21033;&#29992;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12427;&#12363;&#12418;&#12375;&#12428;&#12414;&#12379;&#12435;&#12290;</p></dd><dt><span class="term"><code class="literal">systemProperty</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#12493;&#12473;&#12488;&#12373;&#12428;&#12427;&#35201;&#32032;&#12391;&#12377;&#12290;&#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12289;Java &#12471;&#12473;&#12486;&#12512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12434;&#23450;&#32681;&#12375;&#12414;&#12377;&#12290;<code class="literal">name</code> &#23646;&#24615;&#12395;&#12399;&#12471;&#12473;&#12486;&#12512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12398;&#21517;&#21069;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12381;&#12375;&#12390;&#12289; <code class="literal">value</code> &#23646;&#24615;&#12395;&#12399;&#12471;&#12473;&#12486;&#12512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12398;&#20516;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">timeout</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;<span class="application">FindBugs</span> &#12434;&#23455;&#34892;&#12375;&#12390;&#12356;&#12427; Java &#12503;&#12525;&#12475;&#12473; &#12398;&#23455;&#34892;&#35377;&#23481;&#26178;&#38291;&#12434;&#12511;&#12522;&#31186;&#21336;&#20301;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#26178;&#38291;&#12434;&#36229;&#36942;&#12377;&#12427;&#12392;&#12495;&#12531;&#12464;&#12450;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12392;&#21028;&#26029;&#12375;&#12390;&#12503;&#12525;&#12475;&#12473;&#12364;&#32066;&#20102;&#12373;&#12428;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289; 600,000 &#12511;&#12522;&#31186; (10 &#20998;) &#12391;&#12377;&#12290;&#24040;&#22823;&#12394;&#12503;&#12525;&#12464;&#12521;&#12512;&#12398;&#22580;&#21512;&#12399;&#12289; <span class="application">FindBugs</span> &#12364;&#20998;&#26512;&#12434;&#23436;&#20102;&#12377;&#12427;&#12414;&#12391;&#12395; 10 &#20998; &#20197;&#19978;&#25499;&#12363;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12371;&#12392;&#12395;&#27880;&#24847;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><code class="literal">failOnError</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#12502;&#12540;&#12523;&#20516;&#23646;&#24615;&#12391;&#12377;&#12290;<span class="application">FindBugs</span> &#12398;&#23455;&#34892;&#20013;&#12395;&#12456;&#12521;&#12540;&#12364;&#12354;&#12387;&#12383;&#22580;&#21512;&#12395;&#12289;&#12499;&#12523;&#12489;&#12503;&#12525;&#12475;&#12473;&#33258;&#20307;&#12434;&#25171;&#12385;&#20999;&#12387;&#12390;&#30064;&#24120;&#32066;&#20102;&#12373;&#12379;&#12427;&#12363;&#12393;&#12358;&#12363;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289;&#12300;false&#12301;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">errorProperty</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;<span class="application">FindBugs</span> &#12398;&#23455;&#34892;&#20013;&#12395;&#12456;&#12521;&#12540;&#12364;&#30330;&#29983;&#12375;&#12383;&#22580;&#21512;&#12395;&#12289;&#12300;true&#12301;&#12364;&#35373;&#23450;&#12373;&#12428;&#12427;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12398;&#21517;&#21069;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">warningsProperty</code></span></dt><dd><p>&#20219;&#24847;&#25351;&#23450;&#12398;&#23646;&#24615;&#12391;&#12377;&#12290;<span class="application">FindBugs</span> &#12364;&#20998;&#26512;&#12375;&#12383;&#12503;&#12525;&#12464;&#12521;&#12512;&#12395;&#12496;&#12464;&#22577;&#21578;&#12364; 1 &#20214;&#12391;&#12418;&#12354;&#12427;&#22580;&#21512;&#12395;&#12289;&#12300;true&#12301;&#12364;&#35373;&#23450;&#12373;&#12428;&#12427;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12398;&#21517;&#21069;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd></dl></div><p>
37
38
39 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gui.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="eclipse.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;5&#31456; <span class="application">FindBugs</span> GUI &#12398;&#20351;&#29992;&#26041;&#27861;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;7&#31456; <span class="application">FindBugs</span>&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;</td></tr></table></div></body></html>
+0
-40
doc/ja/manual/building.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;3&#31456; FindBugs&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="installing.html" title="&#31532;2&#31456; FindBugs&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;"><link rel="next" href="running.html" title="&#31532;4&#31456; FindBugs&#8482; &#12398;&#23455;&#34892;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;3&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="installing.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="running.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;3&#31456; FindBugs&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;"><div class="titlepage"><div><div><h2 class="title"><a name="building"></a>&#31532;3&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="building.html#d0e175">1. &#21069;&#25552;&#26465;&#20214;</a></span></dt><dt><span class="sect1"><a href="building.html#d0e258">2. &#12477;&#12540;&#12473;&#37197;&#24067;&#29289;&#12398;&#23637;&#38283;</a></span></dt><dt><span class="sect1"><a href="building.html#d0e271">3. <code class="filename">local.properties</code> &#12398;&#20462;&#27491;</a></span></dt><dt><span class="sect1"><a href="building.html#d0e326">4. <span class="application">Ant</span> &#12398;&#23455;&#34892;</a></span></dt><dt><span class="sect1"><a href="building.html#d0e420">5. &#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12363;&#12425;&#12398; <span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</a></span></dt></dl></div><p>&#12371;&#12398;&#31456;&#12391;&#12399;&#12289; <span class="application">FindBugs</span> &#12434;&#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12363;&#12425;&#12499;&#12523;&#12489;&#12377;&#12427;&#26041;&#27861;&#12434;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;<span class="application">FindBugs</span> &#12434;&#20462;&#27491;&#12377;&#12427;&#12371;&#12392;&#12395;&#33288;&#21619;&#12364;&#12394;&#12356;&#12398;&#12391;&#12354;&#12428;&#12400;&#12289; <a class="link" href="running.html" title="&#31532;4&#31456; FindBugs&#8482; &#12398;&#23455;&#34892;">&#27425;&#12398;&#31456;</a> &#12395;&#36914;&#12435;&#12391;&#12367;&#12384;&#12373;&#12356;&#12290;</p><div class="sect1" title="1. &#21069;&#25552;&#26465;&#20214;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e175"></a>1. &#21069;&#25552;&#26465;&#20214;</h2></div></div></div><p>&#12477;&#12540;&#12473;&#12363;&#12425; <span class="application">FindBugs</span> &#12434;&#12467;&#12531;&#12497;&#12452;&#12523;&#12377;&#12427;&#12383;&#12417;&#12395;&#12399;&#12289;&#20197;&#19979;&#12398;&#12418;&#12398;&#12364;&#24517;&#35201;&#12391;&#12377;&#12290;</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><a class="ulink" href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3-source.zip?download" target="_top"><span class="application">FindBugs</span> &#12398;&#12477;&#12540;&#12473;&#37197;&#24067;&#29289;</a>
3 </p></li><li class="listitem"><p>
4 <a class="ulink" href="http://java.sun.com/j2se/" target="_top">JDK 1.5.0 &#12505;&#12540;&#12479; &#12414;&#12383;&#12399;&#12381;&#12428;&#20197;&#38477;</a>
5 </p></li><li class="listitem"><p>
6 <a class="ulink" href="http://ant.apache.org/" target="_top">Apache <span class="application">Ant</span></a>, &#12496;&#12540;&#12472;&#12519;&#12531; 1.6.3 &#12414;&#12383;&#12399;&#12381;&#12428;&#20197;&#38477;</p></li></ul></div><p>
7 </p><div class="warning" title="&#35686;&#21578;" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[&#35686;&#21578;]" src="warning.png"></td><th align="left">&#35686;&#21578;</th></tr><tr><td align="left" valign="top"><p>Redhat Linux &#12471;&#12473;&#12486;&#12512;&#12398; <code class="filename">/usr/bin/ant</code> &#12395;&#21516;&#26801;&#12373;&#12428;&#12390;&#12356;&#12427; <span class="application">Ant</span> &#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12391;&#12399;&#12289; <span class="application">FindBugs</span> &#12398;&#12467;&#12531;&#12497;&#12452;&#12523;&#12399;<span class="emphasis"><em>&#12358;&#12414;&#12367;&#12391;&#12365;&#12414;&#12379;&#12435;</em></span>&#12290;<a class="ulink" href="http://ant.apache.org/" target="_top"><span class="application">Ant</span> web &#12469;&#12452;&#12488;</a>&#12363;&#12425;&#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12434;&#12480;&#12454;&#12531;&#12525;&#12540;&#12489;&#12375;&#12390;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12377;&#12427;&#12371;&#12392;&#12434;&#25512;&#22888;&#12375;&#12414;&#12377;&#12290;<span class="application">Ant</span> &#12434;&#23455;&#34892;&#12377;&#12427;&#22580;&#21512;&#12399;&#12289; &#29872;&#22659;&#22793;&#25968; <em class="replaceable"><code>JAVA_HOME</code></em> &#12364; JDK 1.5 (&#12414;&#12383;&#12399;&#12381;&#12428;&#20197;&#38477;)&#12434;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12375;&#12383;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434;&#25351;&#12375;&#12390;&#12356;&#12427;&#12371;&#12392;&#12434;&#30906;&#35469;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></td></tr></table></div><p>&#20307;&#35009;&#12398;&#25972;&#12387;&#12383; <span class="application">FindBugs</span> &#12398;&#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12434;&#29983;&#25104;&#12375;&#12383;&#12356;&#22580;&#21512;&#12399;&#12289;&#20197;&#19979;&#12398;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;&#12418;&#24517;&#35201;&#12392;&#12394;&#12426;&#12414;&#12377;:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><a class="ulink" href="http://docbook.sourceforge.net/projects/xsl/index.html" target="_top">DocBook XSL &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;</a>&#12290;<span class="application">FindBugs</span> &#12398;&#12510;&#12491;&#12517;&#12450;&#12523;&#12434; HTML &#12395;&#22793;&#25563;&#12377;&#12427;&#12398;&#12395;&#24517;&#35201;&#12391;&#12377;&#12290;</p></li><li class="listitem"><p><a class="ulink" href="http://saxon.sourceforge.net/" target="_top"><span class="application">Saxon</span> XSLT &#12503;&#12525;&#12475;&#12483;&#12469;&#12540;</a>&#12290;(&#21516;&#27096;&#12395;&#12289; <span class="application">FindBugs</span> &#12398;&#12510;&#12491;&#12517;&#12450;&#12523;&#12434; HTML &#12395;&#22793;&#25563;&#12377;&#12427;&#12398;&#12395;&#24517;&#35201;&#12391;&#12377;&#12290;)</p></li></ul></div><p>
8 </p></div><div class="sect1" title="2. &#12477;&#12540;&#12473;&#37197;&#24067;&#29289;&#12398;&#23637;&#38283;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e258"></a>2. &#12477;&#12540;&#12473;&#37197;&#24067;&#29289;&#12398;&#23637;&#38283;</h2></div></div></div><p>&#12477;&#12540;&#12473;&#37197;&#24067;&#29289;&#12434;&#12480;&#12454;&#12531;&#12525;&#12540;&#12489;&#12375;&#12383;&#24460;&#12395;&#12289;&#12381;&#12428;&#12434;&#20316;&#26989;&#29992;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12395;&#23637;&#38283;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#36890;&#24120;&#12399;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394;&#12467;&#12510;&#12531;&#12489;&#12391;&#23637;&#38283;&#12434;&#34892;&#12356;&#12414;&#12377;:</p><pre class="screen">
9 <code class="prompt">$ </code><span class="command"><strong>unzip findbugs-2.0.3-source.zip</strong></span>
10 </pre><p>
11
12 </p></div><div class="sect1" title="3. local.properties &#12398;&#20462;&#27491;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e271"></a>3. <code class="filename">local.properties</code> &#12398;&#20462;&#27491;</h2></div></div></div><p>FindBugs &#12398;&#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12434;&#12499;&#12523;&#12489;&#12377;&#12427;&#12383;&#12417;&#12395;&#12399;&#12289; <code class="filename">local.properties</code> &#12501;&#12449;&#12452;&#12523;&#12434;&#20462;&#27491;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#12371;&#12398;&#12501;&#12449;&#12452;&#12523;&#12399;&#12289; <span class="application">FindBugs</span> &#12434;&#12499;&#12523;&#12489;&#12377;&#12427;&#38555;&#12395; <a class="ulink" href="http://ant.apache.org/" target="_top"><span class="application">Ant</span></a> <code class="filename">build.xml</code> &#12501;&#12449;&#12452;&#12523;&#12364;&#21442;&#29031;&#12375;&#12414;&#12377;&#12290;FindBugs &#12398;&#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12434;&#12499;&#12523;&#12489;&#12375;&#12394;&#12356;&#22580;&#21512;&#12399;&#12289;&#12371;&#12398;&#12501;&#12449;&#12452;&#12523;&#12399;&#28961;&#35222;&#12375;&#12390;&#12418;&#12363;&#12414;&#12356;&#12414;&#12379;&#12435;&#12290;</p><p><code class="filename">local.properties</code> &#12391;&#12398;&#23450;&#32681;&#12399;&#12289; <code class="filename">build.properties</code> &#12501;&#12449;&#12452;&#12523;&#12391;&#12398;&#23450;&#32681;&#12395;&#20778;&#20808;&#12375;&#12414;&#12377;&#12290;<code class="filename">build.properties</code> &#12399;&#27425;&#12398;&#12424;&#12358;&#12394;&#20869;&#23481;&#12391;&#12377;:</p><pre class="programlisting">
13
14 # User Configuration:
15 # This section must be modified to reflect your system.
16
17 local.software.home =/export/home/daveho/linux
18
19 # Set this to the directory containing the DocBook Modular XSL Stylesheets
20 # from http://docbook.sourceforge.net/projects/xsl/
21
22 xsl.stylesheet.home =${local.software.home}/docbook/docbook-xsl-1.71.1
23
24 # Set this to the directory where Saxon (http://saxon.sourceforge.net/)
25 # is installed.
26
27 saxon.home =${local.software.home}/java/saxon-6.5.5
28
29 </pre><p>
30 </p><p><code class="varname">xsl.stylesheet.home</code> &#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12395;&#12399;&#12289;<a class="ulink" href="http://docbook.sourceforge.net/projects/xsl/" target="_top">DocBook Modular XSL &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;</a>&#12364;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12375;&#12390;&#12354;&#12427;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12398;&#32118;&#23550;&#12497;&#12473;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<span class="application">FindBugs</span> &#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12434;&#29983;&#25104;&#12375;&#12424;&#12358;&#12392;&#32771;&#12360;&#12390;&#12356;&#12427;&#22580;&#21512;&#12395;&#12398;&#12415;&#12289;&#12371;&#12398;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12434;&#25351;&#23450;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p><p><code class="varname">saxon.home</code> &#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12395;&#12399;&#12289;<a class="ulink" href="http://saxon.sourceforge.net/" target="_top"><span class="application">Saxon</span> XSLT &#12503;&#12525;&#12475;&#12483;&#12469;&#12540;</a>&#12364;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12375;&#12390;&#12354;&#12427;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12398;&#32118;&#23550;&#12497;&#12473;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<span class="application">FindBugs</span> &#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12434;&#29983;&#25104;&#12375;&#12424;&#12358;&#12392;&#32771;&#12360;&#12390;&#12356;&#12427;&#22580;&#21512;&#12395;&#12398;&#12415;&#12289;&#12371;&#12398;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12434;&#25351;&#23450;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p></div><div class="sect1" title="4. Ant &#12398;&#23455;&#34892;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e326"></a>4. <span class="application">Ant</span> &#12398;&#23455;&#34892;</h2></div></div></div><p>&#12477;&#12540;&#12473;&#37197;&#24067;&#29289;&#12398;&#23637;&#38283;&#12289; <span class="application">Ant</span> &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12289;<code class="filename">build.properties</code>(<code class="filename">local.properties</code>) &#12398;&#20462;&#27491; (&#12371;&#12428;&#12399;&#20219;&#24847;) &#12362;&#12424;&#12403;&#12484;&#12540;&#12523; (<span class="application">Saxon</span> &#12394;&#12393;)&#12398;&#29872;&#22659;&#27083;&#31689;&#12364;&#12391;&#12365;&#12428;&#12400;&#12289; <span class="application">FindBugs</span> &#12434;&#12499;&#12523;&#12489;&#12377;&#12427;&#12383;&#12417;&#12398;&#28310;&#20633;&#12399;&#23436;&#20102;&#12391;&#12377;&#12290;<span class="application">Ant</span> &#12398;&#36215;&#21205;&#12377;&#12427;&#26041;&#27861;&#12399;&#12289;&#21336;&#12395;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12377;&#12427;&#12384;&#12369;&#12391;&#12377;&#12290;</p><pre class="screen">
31 <code class="prompt">$ </code><span class="command"><strong>ant <em class="replaceable"><code>target</code></em></strong></span>
32 </pre><p><em class="replaceable"><code>target</code></em> &#12395;&#12399;&#20197;&#19979;&#12398;&#12356;&#12378;&#12428;&#12363;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;: </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>build</strong></span></span></dt><dd><p>&#12371;&#12398;&#12479;&#12540;&#12466;&#12483;&#12488;&#12399;&#12289; <span class="application">FindBugs</span> &#12398;&#12467;&#12540;&#12489;&#12434;&#12467;&#12531;&#12497;&#12452;&#12523;&#12375;&#12414;&#12377;&#12290;&#12371;&#12428;&#12399;&#12289;&#12487;&#12501;&#12457;&#12523;&#12488;&#12398;&#12479;&#12540;&#12466;&#12483;&#12488;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>docs</strong></span></span></dt><dd><p>&#12371;&#12398;&#12479;&#12540;&#12466;&#12483;&#12488;&#12399;&#12289;&#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12398;&#25972;&#24418;&#12434;&#34892;&#12356;&#12414;&#12377;(&#12414;&#12383;&#12289;&#21103;&#20316;&#29992;&#12392;&#12375;&#12390;&#12356;&#12367;&#12388;&#12363;&#12398;&#12477;&#12540;&#12473;&#12398;&#12467;&#12531;&#12497;&#12452;&#12523;&#12418;&#34892;&#12356;&#12414;&#12377;&#12290;)</p></dd><dt><span class="term"><span class="command"><strong>runjunit</strong></span></span></dt><dd><p>&#12371;&#12398;&#12479;&#12540;&#12466;&#12483;&#12488;&#12399;&#12289;&#12467;&#12531;&#12497;&#12452;&#12523;&#12434;&#34892;&#12356; <span class="application">FindBugs</span> &#12364;&#25345;&#12387;&#12390;&#12356;&#12427; JUnit &#12486;&#12473;&#12488;&#12434;&#23455;&#34892;&#12375;&#12414;&#12377;&#12290;&#12518;&#12491;&#12483;&#12488;&#12486;&#12473;&#12488;&#12364;&#22833;&#25943;&#12375;&#12383;&#22580;&#21512;&#12399;&#12289;&#12456;&#12521;&#12540;&#12513;&#12483;&#12475;&#12540;&#12472;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>bindist</strong></span></span></dt><dd><p><span class="application">FindBugs</span> &#12398;&#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12434;&#27083;&#31689;&#12375;&#12414;&#12377;&#12290;&#12371;&#12398;&#12479;&#12540;&#12466;&#12483;&#12488;&#12399;&#12289; <code class="filename">.zip</code> &#12362;&#12424;&#12403; <code class="filename">.tar.gz</code> &#12398;&#12450;&#12540;&#12459;&#12452;&#12502;&#12434;&#12381;&#12428;&#12382;&#12428;&#20316;&#25104;&#12375;&#12414;&#12377;&#12290;</p></dd></dl></div><p>
33 </p><p><span class="application">Ant</span> &#12467;&#12510;&#12531;&#12489;&#12398;&#23455;&#34892;&#24460;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394;&#20986;&#21147;&#12364;&#34920;&#31034;&#12373;&#12428;&#12427;&#12399;&#12378;&#12391;&#12377;&#12290; (&#12371;&#12398;&#21069;&#12395; <span class="application">Ant</span> &#12364;&#23455;&#34892;&#12375;&#12383;&#12479;&#12473;&#12463;&#12395;&#38306;&#12377;&#12427;&#12513;&#12483;&#12475;&#12540;&#12472;&#12418;&#12356;&#12367;&#12425;&#12363;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;):</p><pre class="screen">
34 <code class="computeroutput">
35 BUILD SUCCESSFUL
36 Total time: 17 seconds
37 </code>
38 </pre><p>
39 </p></div><div class="sect1" title="5. &#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12363;&#12425;&#12398; FindBugs&#8482; &#12398;&#23455;&#34892;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e420"></a>5. &#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12363;&#12425;&#12398; <span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</h2></div></div></div><p><span class="command"><strong>build</strong></span> &#12479;&#12540;&#12466;&#12483;&#12488;&#12398;&#23455;&#34892;&#12364;&#32066;&#20102;&#12377;&#12427;&#12392;&#12289;&#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12392;&#21516;&#27096;&#12398;&#29366;&#24907;&#12364;&#20316;&#26989;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12395;&#27083;&#31689;&#12373;&#12428;&#12427;&#12424;&#12358;&#12395; <span class="application">FindBugs</span> &#12398;<span class="application">Ant</span> &#12499;&#12523;&#12489;&#12473;&#12463;&#12522;&#12503;&#12488;&#12399;&#35352;&#36848;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;&#12375;&#12383;&#12364;&#12387;&#12390;&#12289;<a class="xref" href="running.html" title="&#31532;4&#31456; FindBugs&#8482; &#12398;&#23455;&#34892;">4&#31456;<i><span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</i></a> &#12398; <span class="application">FindBugs</span> &#12398;&#23455;&#34892;&#12395;&#38306;&#12377;&#12427;&#24773;&#22577;&#12399;&#12477;&#12540;&#12473;&#37197;&#24067;&#29289;&#12398;&#22580;&#21512;&#12395;&#12418;&#24540;&#29992;&#12391;&#12365;&#12414;&#12377;&#12290;</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="installing.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="running.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;2&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;4&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</td></tr></table></div></body></html>
+0
-280
doc/ja/manual/datamining.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;12&#31456; FindBugs&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="rejarForAnalysis.html" title="&#31532;11&#31456; rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;"><link rel="next" href="license.html" title="&#31532;13&#31456; &#12521;&#12452;&#12475;&#12531;&#12473;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;12&#31456; <span class="application">FindBugs</span>&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rejarForAnalysis.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="license.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;12&#31456; FindBugs&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;"><div class="titlepage"><div><div><h2 class="title"><a name="datamining"></a>&#31532;12&#31456; <span class="application">FindBugs</span>&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="datamining.html#commands">1. &#12467;&#12510;&#12531;&#12489;</a></span></dt><dt><span class="sect1"><a href="datamining.html#examples">2. &#20363;</a></span></dt><dt><span class="sect1"><a href="datamining.html#antexample">3. Ant &#12398;&#20363;</a></span></dt></dl></div><p>&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12408;&#12398;&#39640;&#27231;&#33021;&#12398;&#21839;&#12356;&#21512;&#12431;&#12379;&#27231;&#33021;&#12289;&#12362;&#12424;&#12403;&#12289;&#35519;&#26619;&#23550;&#35937;&#12398;&#12467;&#12540;&#12489;&#12398;&#35079;&#25968;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#12431;&#12383;&#12427;&#35686;&#21578;&#12398;&#36861;&#36321;&#35352;&#37682;&#27231;&#33021;&#12434;&#12289; FindBugs &#12399;&#20869;&#34101;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12371;&#12428;&#12425;&#12434;&#20351;&#12387;&#12390;&#27425;&#12398;&#12424;&#12358;&#12394;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12377;&#12394;&#12431;&#12385;&#12289;&#12356;&#12388;&#12496;&#12464;&#12364;&#26368;&#21021;&#25345;&#12385;&#36796;&#12414;&#12428;&#12383;&#12363;&#12434;&#25436;&#12375;&#20986;&#12377;&#12371;&#12392;&#12289;&#26368;&#32066;&#12522;&#12522;&#12540;&#12473;&#20197;&#24460;&#25345;&#12385;&#36796;&#12414;&#12428;&#12383;&#35686;&#21578;&#12398;&#20998;&#26512;&#12434;&#34892;&#12358;&#12371;&#12392;&#12289;&#12414;&#12383;&#12399;&#12289;&#28961;&#38480;&#20877;&#36215;&#12523;&#12540;&#12503;&#12398;&#25968;&#12434;&#26178;&#38291;&#36600;&#12391;&#12464;&#12521;&#12501;&#12395;&#12377;&#12427;&#12371;&#12392;&#12391;&#12377;&#12290;</p><p>&#12371;&#12428;&#12425;&#12398;&#25216;&#34899;&#12399;&#12289; FindBugs &#12364;&#35686;&#21578;&#12398;&#20445;&#23384;&#12395;&#20351;&#12358; XML &#26360;&#24335;&#12434;&#20351;&#29992;&#12375;&#12414;&#12377;&#12290;&#12371;&#12428;&#12425;&#12398; XML &#12501;&#12449;&#12452;&#12523;&#12399;&#12289;&#36890;&#24120;&#12289;&#29305;&#23450;&#12398; 1 &#20998;&#26512;&#12395;&#23550;&#12377;&#12427;&#35686;&#21578;&#12364;&#20837;&#12428;&#12425;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;&#12375;&#12363;&#12375;&#12381;&#12428;&#12425;&#12395;&#12399;&#12289;&#19968;&#36899;&#12398;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;&#12398;&#12499;&#12523;&#12489;&#12420;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23550;&#12377;&#12427;&#20998;&#26512;&#32080;&#26524;&#12434;&#26684;&#32013;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12377;&#12409;&#12390;&#12398; FindBugs XML &#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#12399;&#12289;&#12496;&#12540;&#12472;&#12519;&#12531;&#21517;&#12392;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503; &#12364;&#20837;&#12428;&#12425;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;FindBugs &#12399;&#20998;&#26512;&#12364;&#34892;&#12431;&#12428;&#12427;&#12501;&#12449;&#12452;&#12523;&#12398;&#26356;&#26032;&#26178;&#21051;&#12363;&#12425;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503;&#12434;&#35336;&#31639;&#12375;&#12414;&#12377; (&#20363;&#12360;&#12400;&#12289;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503;&#12399;&#12463;&#12521;&#12473;&#12501;&#12449;&#12452;&#12523;&#12398;&#29983;&#25104;&#26178;&#21051;&#12395;&#12394;&#12427;&#12424;&#12358;&#12395;&#12394;&#12387;&#12390;&#12356;&#12414;&#12377;&#12290;&#20998;&#26512;&#12364;&#34892;&#12431;&#12428;&#12383;&#26178;&#21051;&#12391;&#12399;&#12354;&#12426;&#12414;&#12379;&#12435;) &#12290;&#21508;&#12293;&#12398;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#12399;&#12289;&#12496;&#12540;&#12472;&#12519;&#12531;&#21517;&#12418;&#20837;&#12428;&#12425;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;&#12496;&#12540;&#12472;&#12519;&#12531;&#21517;&#12392;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503;&#12399;&#12289; <span class="command"><strong>setBugDatabaseInfo</strong></span> (<a class="xref" href="datamining.html#setBugDatabaseInfo" title="1.7. setBugDatabaseInfo">&#12300;setBugDatabaseInfo&#12301;</a>) &#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12375;&#12390;&#25163;&#21205;&#12391;&#35373;&#23450;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#26684;&#32013;&#12377;&#12427;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#12362;&#12356;&#12390;&#12399;&#12289;&#20998;&#26512;&#12373;&#12428;&#12427;&#12467;&#12540;&#12489;&#12398;&#21508;&#12496;&#12540;&#12472;&#12519;&#12531;&#12372;&#12392;&#12395;&#12471;&#12540;&#12465;&#12531;&#12473;&#30058;&#21495;&#12364;&#21106;&#12426;&#24403;&#12390;&#12425;&#12428;&#12414;&#12377;&#12290;&#12371;&#12428;&#12425;&#12398;&#12471;&#12540;&#12465;&#12531;&#12473;&#30058;&#21495;&#12399;&#21336;&#12395; 0 &#12363;&#12425;&#22987;&#12414;&#12427;&#36899;&#32154;&#12377;&#12427;&#25972;&#25968;&#20516;&#12391;&#12377; (&#20363;&#12360;&#12400;&#12289; 4 &#12388;&#12398;&#12467;&#12540;&#12489;&#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#26684;&#32013;&#12377;&#12427;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#12399;&#12289;&#12496;&#12540;&#12472;&#12519;&#12531; 0~3 &#12364;&#20837;&#12428;&#12425;&#12428;&#12414;&#12377;) &#12290;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#12399;&#12414;&#12383;&#12289;&#21508;&#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#21517;&#21069;&#12392;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503;&#12364;&#12381;&#12428;&#12382;&#12428;&#35352;&#37682;&#12373;&#12428;&#12414;&#12377;&#12290;<span class="command"><strong>filterBugs</strong></span> &#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12377;&#12427;&#12392;&#12289;&#12471;&#12540;&#12465;&#12531;&#12473;&#30058;&#21495;&#12289;&#12496;&#12540;&#12472;&#12519;&#12531;&#21517;&#12414;&#12383;&#12399;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503;&#12363;&#12425;&#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#21442;&#29031;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>1 &#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#26684;&#32013;&#12377;&#12427;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12398;&#38598;&#21512;&#12363;&#12425;&#12289; 1 &#20491;&#12398;&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12434;&#20316;&#25104;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12383;&#12289;&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#23550;&#12375;&#12390;&#12289;&#12381;&#12428;&#20197;&#24460;&#12395;&#20316;&#25104;&#12373;&#12428;&#12383; 1 &#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12434;&#32080;&#21512;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12371;&#12428;&#12425;&#12398;&#12467;&#12510;&#12531;&#12489;&#12398;&#12356;&#12367;&#12388;&#12363;&#12399;&#12289; ant &#12479;&#12473;&#12463;&#12392;&#12375;&#12390;&#23455;&#34892;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12467;&#12510;&#12531;&#12489;&#12398;&#23455;&#34892;&#26041;&#27861;&#12362;&#12424;&#12403;&#23646;&#24615;&#12539;&#24341;&#25968;&#12398;&#35443;&#32048;&#12399;&#12289;&#20197;&#19979;&#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#20197;&#19979;&#12398;&#12377;&#12409;&#12390;&#12398;&#20363;&#12395;&#12362;&#12356;&#12390;&#12399;&#12289; <code class="literal">findbugs.lib</code> <code class="literal">refid</code> &#12364;&#27491;&#12375;&#12367;&#35373;&#23450;&#12373;&#12428;&#12390;&#12356;&#12427;&#12371;&#12392;&#12434;&#21069;&#25552;&#12392;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#35373;&#23450;&#26041;&#27861;&#12398;&#19968;&#20363;&#12434;&#27425;&#12395;&#31034;&#12375;&#12414;&#12377; :</p><pre class="programlisting">
3
4 &lt;!-- findbugs &#12479;&#12473;&#12463;&#23450;&#32681; --&gt;
5 &lt;property name="findbugs.home" value="/your/path/to/findbugs" /&gt;
6 &lt;path id="findbugs.lib"&gt;
7 &lt;fileset dir="${findbugs.home}/lib"&gt;
8 &lt;include name="findbugs-ant.jar"/&gt;
9 &lt;/fileset&gt;
10 &lt;/path&gt;
11
12 </pre><div class="sect1" title="1. &#12467;&#12510;&#12531;&#12489;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="commands"></a>1. &#12467;&#12510;&#12531;&#12489;</h2></div></div></div><p>FindBugs &#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464; &#12484;&#12540;&#12523;&#12399;&#12377;&#12409;&#12390;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12363;&#12425;&#23455;&#34892;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12383;&#12289;&#12356;&#12367;&#12388;&#12363;&#12398;&#12424;&#12426;&#26377;&#29992;&#12394;&#12467;&#12510;&#12531;&#12489;&#12399;&#12289; ant &#12499;&#12523;&#12489;&#12501;&#12449;&#12452;&#12523;&#12363;&#12425;&#23455;&#34892;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12484;&#12540;&#12523;&#12395;&#12388;&#12356;&#12390;&#31777;&#21336;&#12395;&#35500;&#26126;&#12375;&#12414;&#12377; :</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#unionBugs" title="1.1. unionBugs">unionBugs</a></strong></span></span></dt><dd><p>&#21029;&#12398;&#12463;&#12521;&#12473;&#12395;&#23550;&#12377;&#12427;&#21029;&#20491;&#12398;&#20998;&#26512;&#32080;&#26524;&#12434;&#32080;&#21512;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#computeBugHistory" title="1.2. computeBugHistory">computeBugHistory</a></strong></span></span></dt><dd><p>&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12363;&#12425;&#24471;&#12425;&#12428;&#12383;&#35079;&#25968;&#12398;&#12496;&#12464;&#35686;&#21578;&#12434;&#12289;&#12510;&#12540;&#12472;&#12375;&#12390; 1 &#20491;&#12398;&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#12375;&#12414;&#12377;&#12290;&#12371;&#12428;&#12434;&#20351;&#12387;&#12390;&#12289;&#26082;&#23384;&#12398;&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#26356;&#12395;&#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#36861;&#21152;&#12375;&#12383;&#12426;&#12289; 1 &#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#26684;&#32013;&#12377;&#12427;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12398;&#38598;&#21512;&#12363;&#12425; 1 &#20491;&#12398;&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12434;&#20316;&#25104;&#12375;&#12383;&#12426;&#12289;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#setBugDatabaseInfo" title="1.7. setBugDatabaseInfo">setBugDatabaseInfo</a></strong></span></span></dt><dd><p>&#12522;&#12499;&#12472;&#12519;&#12531;&#21517;&#12420;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503;&#12394;&#12393;&#12398;&#24773;&#22577;&#12434; XML &#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#listBugDatabaseInfo" title="1.8. listBugDatabaseInfo">listBugDatabaseInfo</a></strong></span></span></dt><dd><p>XML &#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12395;&#12354;&#12427;&#12522;&#12499;&#12472;&#12519;&#12531;&#21517;&#12420;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503;&#12394;&#12393;&#12398;&#24773;&#22577;&#12434;&#19968;&#35239;&#34920;&#31034;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#filterBugs" title="1.3. filterBugs">filterBugs</a></strong></span></span></dt><dd><p>&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12398;&#37096;&#20998;&#38598;&#21512;&#12434;&#36984;&#25246;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#mineBugHistory" title="1.4. mineBugHistory">mineBugHistory</a></strong></span></span></dt><dd><p>&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12398;&#21508;&#12496;&#12540;&#12472;&#12519;&#12531;&#27598;&#12398;&#35686;&#21578;&#25968;&#12434;&#19968;&#35239;&#12395;&#12375;&#12383;&#34920;&#12434;&#20316;&#25104;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#defectDensity" title="1.5. defectDensity">defectDensity</a></strong></span></span></dt><dd><p>&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#20840;&#20307;&#12362;&#12424;&#12403;&#12463;&#12521;&#12473;&#27598;&#12539;&#12497;&#12483;&#12465;&#12540;&#12472;&#27598;&#12398;&#19981;&#33391;&#23494;&#24230; (1000 NCSS &#27598;&#12398;&#35686;&#21578;&#25968;) &#12395;&#38306;&#12377;&#12427;&#24773;&#22577;&#12434;&#19968;&#35239;&#34920;&#31034;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#convertXmlToText" title="1.6. convertXmlToText">convertXmlToText</a></strong></span></span></dt><dd><p>XML &#24418;&#24335;&#12398;&#12496;&#12464;&#35686;&#21578;&#12434;&#12289; 1 &#34892; 1 &#12496;&#12464;&#12398;&#12486;&#12461;&#12473;&#12488;&#24418;&#24335;&#12289;&#12414;&#12383;&#12399;&#12289;HTML&#24418;&#24335;&#12395;&#22793;&#25563;&#12375;&#12414;&#12377;&#12290;</p></dd></dl></div><div class="sect2" title="1.1. unionBugs"><div class="titlepage"><div><div><h3 class="title"><a name="unionBugs"></a>1.1. unionBugs</h3></div></div></div><p>&#20998;&#26512;&#12377;&#12427;&#12398;&#12395;&#12450;&#12503;&#12522;&#12465;&#12540;&#12471;&#12519;&#12531;&#12398; jar &#12501;&#12449;&#12452;&#12523;&#12434;&#20998;&#21106;&#12375;&#12390;&#12356;&#12427;&#22580;&#21512;&#12289;&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#21029;&#20491;&#12395;&#29983;&#25104;&#12373;&#12428;&#12383; XML &#12496;&#12464;&#35686;&#21578;&#12501;&#12449;&#12452;&#12523;&#12434;&#12377;&#12409;&#12390;&#12398;&#35686;&#21578;&#12434;&#21547;&#12435;&#12391;&#12356;&#12427; 1 &#12388;&#12398; &#12501;&#12449;&#12452;&#12523;&#12395;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#21516;&#12376;&#12501;&#12449;&#12452;&#12523;&#12398;&#30064;&#12394;&#12427;&#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#20998;&#26512;&#12375;&#12383;&#32080;&#26524;&#12434;&#32080;&#21512;&#12377;&#12427;&#22580;&#21512;&#12399;&#12289;&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;<span class="emphasis"><em>&#20351;&#29992;&#12375;&#12394;&#12356;&#12391;&#12367;&#12384;&#12373;&#12356;</em></span>&#12290;&#20195;&#12431;&#12426;&#12395; <span class="command"><strong>computeBugHistory</strong></span> &#12434;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p><p>XML &#12501;&#12449;&#12452;&#12523;&#12399;&#12289;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12391;&#25351;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#32080;&#26524;&#12399;&#12289;&#27161;&#28310;&#20986;&#21147;&#12395;&#36865;&#12425;&#12428;&#12414;&#12377;&#12290;</p></div><div class="sect2" title="1.2. computeBugHistory"><div class="titlepage"><div><div><h3 class="title"><a name="computeBugHistory"></a>1.2. computeBugHistory</h3></div></div></div><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#20998;&#26512;&#12377;&#12427;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;&#12398;&#30064;&#12394;&#12427;&#12499;&#12523;&#12489;&#12414;&#12383;&#12399;&#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#24773;&#22577;&#12434;&#21547;&#12416;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12434;&#29983;&#25104;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#20837;&#21147;&#12392;&#12375;&#12390;&#25552;&#20379;&#12375;&#12383;&#12501;&#12449;&#12452;&#12523;&#12398; 1 &#30058;&#30446;&#12398;&#12501;&#12449;&#12452;&#12523;&#12363;&#12425;&#23653;&#27508;&#12364;&#21462;&#24471;&#12373;&#12428;&#12414;&#12377;&#12290;&#24460;&#12395;&#32154;&#12367;&#12501;&#12449;&#12452;&#12523;&#12399; 1 &#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12391;&#12354;&#12427;&#12424;&#12358;&#12395;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356; (&#12418;&#12375;&#12289;&#23653;&#27508;&#12434;&#25345;&#12387;&#12390;&#12356;&#12383;&#12392;&#12375;&#12390;&#12418;&#28961;&#35222;&#12373;&#12428;&#12414;&#12377;) &#12290;</p><p>&#12487;&#12501;&#12457;&#12523;&#12488;&#12391;&#12399;&#12289;&#32080;&#26524;&#12399;&#27161;&#28310;&#20986;&#21147;&#12395;&#36865;&#12425;&#12428;&#12414;&#12377;&#12290;</p><p>&#12371;&#12398;&#27231;&#33021;&#12399;&#12289; ant &#12363;&#12425;&#12418;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12378;&#27425;&#12395;&#31034;&#12377;&#12424;&#12358;&#12395;&#12289;&#12499;&#12523;&#12489;&#12501;&#12449;&#12452;&#12523;&#12395; <span class="command"><strong>computeBugHistory</strong></span> &#12434; taskdef &#12391;&#23450;&#32681;&#12375;&#12414;&#12377; :</p><pre class="programlisting">
13
14 &lt;taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask"&gt;
15 &lt;classpath refid="findbugs.lib" /&gt;
16 &lt;/taskdef&gt;
17
18 </pre><p>&#12371;&#12398; ant &#12479;&#12473;&#12463;&#12395;&#25351;&#23450;&#12391;&#12365;&#12427;&#23646;&#24615;&#12434;&#12289;&#19979;&#34920;&#12395;&#19968;&#35239;&#12391;&#31034;&#12375;&#12414;&#12377;&#12290;&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12377;&#12427;&#12395;&#12399;&#12289; <code class="literal">&lt;datafile&gt;</code> &#35201;&#32032;&#12434;&#20837;&#12428;&#23376;&#12395;&#12375;&#12390;&#20837;&#12428;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#27425;&#12395;&#12289;&#20363;&#12434;&#31034;&#12375;&#12414;&#12377;:</p><pre class="programlisting">
19
20 &lt;computeBugHistory home="${findbugs.home}" ...&gt;
21 &lt;datafile name="analyze1.xml"/&gt;
22 &lt;datafile name="analyze2.xml"/&gt;
23 &lt;/computeBugHistory&gt;
24
25 </pre><div class="table"><a name="computeBugHistoryTable"></a><p class="title"><b>&#34920;12.1 computeBugHistory &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</b></p><div class="table-contents"><table summary="computeBugHistory &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</th><th align="left">Ant &#23646;&#24615;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">-output &lt;file&gt;</td><td align="left">output="&lt;file&gt;"</td><td align="left">&#20986;&#21147;&#32080;&#26524;&#12434;&#20445;&#23384;&#12377;&#12427;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290; (&#21516;&#26178;&#12395;&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12395;&#12418;&#12394;&#12426;&#12360;&#12414;&#12377;)</td></tr><tr><td align="left">-overrideRevisionNames[:truth]</td><td align="left">overrideRevisionNames="[true|false]"</td><td align="left">&#12501;&#12449;&#12452;&#12523;&#21517;&#12363;&#12425;&#31639;&#20986;&#12373;&#12428;&#12427;&#12381;&#12428;&#12382;&#12428;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#21517;&#12434;&#25351;&#23450;&#22793;&#26356;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-noPackageMoves[:truth]</td><td align="left">noPackageMoves="[true|false]"</td><td align="left">&#12497;&#12483;&#12465;&#12540;&#12472;&#12434;&#31227;&#21205;&#12375;&#12383;&#12463;&#12521;&#12473;&#12364;&#12354;&#12427;&#22580;&#21512;&#12289;&#24403;&#35442;&#12463;&#12521;&#12473;&#12398;&#35686;&#21578;&#12399;&#21029;&#12398;&#23384;&#22312;&#12392;&#12375;&#12390;&#25201;&#12431;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-preciseMatch[:truth]</td><td align="left">preciseMatch="[true|false]"</td><td align="left">&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#12364;&#27491;&#30906;&#12395;&#19968;&#33268;&#12377;&#12427;&#12371;&#12392;&#12434;&#35201;&#27714;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-precisePriorityMatch[:truth]</td><td align="left">precisePriorityMatch="[true|false]"</td><td align="left">&#20778;&#20808;&#24230;&#12364;&#27491;&#30906;&#12395;&#19968;&#33268;&#12375;&#12383;&#22580;&#21512;&#12398;&#12415;&#35686;&#21578;&#12364;&#21516;&#19968;&#12391;&#12354;&#12427;&#12392;&#21028;&#26029;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-quiet[:truth]</td><td align="left">quiet="[true|false]"</td><td align="left">&#12456;&#12521;&#12540;&#12364;&#30330;&#29983;&#12375;&#12394;&#12356;&#38480;&#12426;&#12289;&#27161;&#28310;&#20986;&#21147;&#12395;&#12399;&#20309;&#12418;&#34920;&#31034;&#12373;&#12428;&#12414;&#12379;&#12435;&#12290;</td></tr><tr><td align="left">-withMessages[:truth]</td><td align="left">withMessages="[true|false]"</td><td align="left">&#20986;&#21147; XML &#12395;&#20154;&#38291;&#12364;&#35501;&#12416;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12496;&#12464;&#12513;&#12483;&#12475;&#12540;&#12472;&#12364;&#21547;&#12414;&#12428;&#12414;&#12377;&#12290;</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.3. filterBugs"><div class="titlepage"><div><div><h3 class="title"><a name="filterBugs"></a>1.3. filterBugs</h3></div></div></div><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289; FindBugs XML &#35686;&#21578;&#12501;&#12449;&#12452;&#12523;&#12363;&#12425;&#19968;&#37096;&#20998;&#12434;&#36984;&#12403;&#20986;&#12375;&#12390;&#26032;&#35215; FindBugs &#35686;&#21578;&#12501;&#12449;&#12452;&#12523;&#12395;&#36984;&#25246;&#12373;&#12428;&#12383;&#37096;&#20998;&#12434;&#26360;&#12365;&#36796;&#12416;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12395;&#12399;&#12289;&#12458;&#12503;&#12471;&#12519;&#12531;&#32676;&#12395;&#32154;&#12356;&#12390; 0 &#20491;&#12363;&#12425; 2 &#20491;&#12398; findbugs xml &#12496;&#12464;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#12402;&#12392;&#12388;&#12418;&#25351;&#23450;&#12375;&#12394;&#12356;&#22580;&#21512;&#12399;&#12289;&#27161;&#28310;&#20837;&#21147;&#12363;&#12425;&#35501;&#12435;&#12391;&#27161;&#28310;&#20986;&#21147;&#12395;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434; 1 &#20491; &#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12399;&#12289;&#25351;&#23450;&#12375;&#12383;&#12501;&#12449;&#12452;&#12523;&#12363;&#12425;&#35501;&#12435;&#12391;&#27161;&#28310;&#20986;&#21147;&#12395;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434; 2 &#20491; &#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12399;&#12289; 1 &#30058;&#30446;&#12395;&#25351;&#23450;&#12375;&#12383;&#12501;&#12449;&#12452;&#12523;&#12363;&#12425;&#35501;&#12435;&#12391; 2 &#30058;&#30446;&#12395;&#25351;&#23450;&#12375;&#12383;&#12501;&#12449;&#12452;&#12523;&#12395;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</p><p>&#12371;&#12398;&#27231;&#33021;&#12399;&#12289; ant &#12363;&#12425;&#12418;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12378;&#27425;&#12395;&#31034;&#12377;&#12424;&#12358;&#12395;&#12289;&#12499;&#12523;&#12489;&#12501;&#12449;&#12452;&#12523;&#12395; <span class="command"><strong>filterBugs</strong></span> &#12434; taskdef &#12391;&#23450;&#32681;&#12375;&#12414;&#12377; :</p><pre class="programlisting">
26
27 &lt;taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsTask"&gt;
28 &lt;classpath refid="findbugs.lib" /&gt;
29 &lt;/taskdef&gt;
30
31 </pre><p>&#12371;&#12398; ant &#12479;&#12473;&#12463;&#12395;&#25351;&#23450;&#12391;&#12365;&#12427;&#23646;&#24615;&#12434;&#12289;&#19979;&#34920;&#12395;&#19968;&#35239;&#12391;&#31034;&#12375;&#12414;&#12377;&#12290;&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12377;&#12427;&#12395;&#12399;&#12289; <code class="literal">input</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12377;&#12427;&#12363;&#12289; <code class="literal">&lt;datafile&gt;</code> &#35201;&#32032;&#12434;&#20837;&#12428;&#23376;&#12395;&#12375;&#12390;&#20837;&#12428;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#27425;&#12395;&#12289;&#20363;&#12434;&#31034;&#12375;&#12414;&#12377;:</p><pre class="programlisting">
32
33 &lt;filterBugs home="${findbugs.home}" ...&gt;
34 &lt;datafile name="analyze.xml"/&gt;
35 &lt;/filterBugs&gt;
36
37 </pre><div class="table"><a name="filterOptionsTable"></a><p class="title"><b>&#34920;12.2 filterBugs &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</b></p><div class="table-contents"><table summary="filterBugs &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</th><th align="left">Ant &#23646;&#24615;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align="left">&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;file&gt;"</td><td align="left">&#20986;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-not</td><td align="left">not="[true|false]"</td><td align="left">&#12501;&#12451;&#12523;&#12479;&#12540;&#12398;&#12473;&#12452;&#12483;&#12481;&#12434;&#21453;&#36578;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-withSource[:truth]</td><td align="left">withSource="[true|false]"</td><td align="left">&#12477;&#12540;&#12473;&#12364;&#20837;&#25163;&#21487;&#33021;&#12394;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-exclude &lt;filter file&gt;</td><td align="left">exclude="&lt;filter file&gt;"</td><td align="left">&#12501;&#12451;&#12523;&#12479;&#12540;&#12395;&#19968;&#33268;&#12377;&#12427;&#12496;&#12464;&#12364;&#38500;&#22806;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-include &lt;filter file&gt;</td><td align="left">include="&lt;filter file&gt;"</td><td align="left">&#12501;&#12451;&#12523;&#12479;&#12540;&#12395;&#19968;&#33268;&#12377;&#12427;&#12496;&#12464;&#12398;&#12415;&#12434;&#21547;&#12414;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-annotation &lt;text&gt;</td><td align="left">annotation="&lt;text&gt;"</td><td align="left">&#25163;&#12391;&#20837;&#21147;&#12375;&#12383;&#27880;&#37320;&#12395;&#25351;&#23450;&#12375;&#12383;&#25991;&#35328;&#12434;&#21547;&#12416;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-after &lt;when&gt;</td><td align="left">after="&lt;when&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12496;&#12540;&#12472;&#12519;&#12531;&#12424;&#12426;&#24460;&#12395;&#21021;&#12417;&#12390;&#20986;&#29694;&#12375;&#12383;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-before &lt;when&gt;</td><td align="left">before="&lt;when&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12496;&#12540;&#12472;&#12519;&#12531;&#12424;&#12426;&#21069;&#12395;&#21021;&#12417;&#12390;&#20986;&#29694;&#12375;&#12383;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-first &lt;when&gt;</td><td align="left">first="&lt;when&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#21021;&#12417;&#12390;&#20986;&#29694;&#12375;&#12383;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-last &lt;when&gt;</td><td align="left">last="&lt;when&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12496;&#12540;&#12472;&#12519;&#12531;&#12364;&#20986;&#29694;&#12375;&#12383;&#26368;&#24460;&#12391;&#12354;&#12427;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-fixed &lt;when&gt;</td><td align="left">fixed="&lt;when&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#21069;&#22238;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12364;&#20986;&#29694;&#12375;&#12383;&#26368;&#24460;&#12391;&#12354;&#12427;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290; (<code class="option">-last</code> &#12395;&#20778;&#20808;&#12375;&#12414;&#12377;)&#12290;</td></tr><tr><td align="left">-present &lt;when&gt;</td><td align="left">present="&lt;when&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23384;&#22312;&#12377;&#12427;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-absent &lt;when&gt;</td><td align="left">absent="&lt;when&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23384;&#22312;&#12375;&#12394;&#12356;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-active[:truth]</td><td align="left">active="[true|false]"</td><td align="left">&#26368;&#32066;&#36890;&#30058;&#12395;&#23384;&#22312;&#12377;&#12427;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-introducedByChange[:truth]</td><td align="left">introducedByChange="[true|false]"</td><td align="left">&#23384;&#22312;&#12377;&#12427;&#12463;&#12521;&#12473;&#12398;&#22793;&#26356;&#12395;&#12424;&#12387;&#12390;&#12418;&#12383;&#12425;&#12373;&#12428;&#12383;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-removedByChange[:truth]</td><td align="left">removedByChange="[true|false]"</td><td align="left">&#23384;&#22312;&#12377;&#12427;&#12463;&#12521;&#12473;&#12398;&#22793;&#26356;&#12395;&#12424;&#12387;&#12390;&#38500;&#21435;&#12373;&#12428;&#12383;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-newCode[:truth]</td><td align="left">newCode="[true|false]"</td><td align="left">&#26032;&#12463;&#12521;&#12473;&#12398;&#36861;&#21152;&#12395;&#12424;&#12387;&#12390;&#12418;&#12383;&#12425;&#12373;&#12428;&#12383;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-removedCode[:truth]</td><td align="left">removedCode="[true|false]"</td><td align="left">&#12463;&#12521;&#12473;&#12398;&#21066;&#38500;&#12395;&#12424;&#12387;&#12390;&#38500;&#21435;&#12373;&#12428;&#12383;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-priority &lt;level&gt;</td><td align="left">priority="&lt;level&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#20778;&#20808;&#24230;&#20197;&#19978;&#12398;&#20778;&#20808;&#24230;&#12434;&#12418;&#12388;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-class &lt;pattern&gt;</td><td align="left">class="&lt;class&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12497;&#12479;&#12540;&#12531;&#12395;&#19968;&#33268;&#12377;&#12427;&#20027;&#12463;&#12521;&#12473;&#12434;&#12418;&#12388;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-bugPattern &lt;pattern&gt;</td><td align="left">bugPattern="&lt;pattern&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12497;&#12479;&#12540;&#12531;&#12395;&#19968;&#33268;&#12377;&#12427;&#12496;&#12464;&#31278;&#21029;&#12434;&#12418;&#12388;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-category &lt;category&gt;</td><td align="left">category="&lt;category&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#25991;&#23383;&#21015;&#12391;&#22987;&#12414;&#12427;&#12459;&#12486;&#12468;&#12522;&#12540;&#12398;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-designation &lt;designation&gt;</td><td align="left">designation="&lt;designation&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12496;&#12464;&#20998;&#39006;&#25351;&#23450;&#12434;&#12418;&#12388;&#35686;&#21578;&#12398;&#12415;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290; (&#20363;&#12289; -designation SHOULD_FIX)</td></tr><tr><td align="left">-withMessages[:truth] </td><td align="left">withMessages="[true|false]"</td><td align="left">&#12486;&#12461;&#12473;&#12488;&#12513;&#12483;&#12475;&#12540;&#12472;&#12434;&#21547;&#12435;&#12384; XML &#12364;&#29983;&#25104;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.4. mineBugHistory"><div class="titlepage"><div><div><h3 class="title"><a name="mineBugHistory"></a>1.4. mineBugHistory</h3></div></div></div><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#35079;&#25968;&#12496;&#12540;&#12472;&#12519;&#12531;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12398;&#21508;&#12496;&#12540;&#12472;&#12519;&#12531;&#27598;&#12398;&#35686;&#21578;&#25968;&#12434;&#19968;&#35239;&#12395;&#12375;&#12383;&#34920;&#12434;&#20316;&#25104;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12371;&#12398;&#27231;&#33021;&#12399;&#12289; ant &#12363;&#12425;&#12418;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12378;&#27425;&#12395;&#31034;&#12377;&#12424;&#12358;&#12395;&#12289;&#12499;&#12523;&#12489;&#12501;&#12449;&#12452;&#12523;&#12395; <span class="command"><strong>mineBugHistory</strong></span> &#12434; taskdef &#12391;&#23450;&#32681;&#12375;&#12414;&#12377; :</p><pre class="programlisting">
38
39 &lt;taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask"&gt;
40 &lt;classpath refid="findbugs.lib" /&gt;
41 &lt;/taskdef&gt;
42
43 </pre><p>&#12371;&#12398; ant &#12479;&#12473;&#12463;&#12395;&#25351;&#23450;&#12391;&#12365;&#12427;&#23646;&#24615;&#12434;&#12289;&#19979;&#34920;&#12395;&#19968;&#35239;&#12391;&#31034;&#12375;&#12414;&#12377;&#12290;&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12377;&#12427;&#12395;&#12399;&#12289; <code class="literal">input</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12377;&#12427;&#12363;&#12289; <code class="literal">&lt;datafile&gt;</code> &#35201;&#32032;&#12434;&#20837;&#12428;&#23376;&#12395;&#12375;&#12390;&#20837;&#12428;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#27425;&#12395;&#12289;&#20363;&#12434;&#31034;&#12375;&#12414;&#12377;:</p><pre class="programlisting">
44
45 &lt;mineBugHistory home="${findbugs.home}" ...&gt;
46 &lt;datafile name="analyze.xml"/&gt;
47 &lt;/mineBugHistory&gt;
48
49 </pre><div class="table"><a name="mineBugHistoryOptionsTable"></a><p class="title"><b>&#34920;12.3 mineBugHistory &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</b></p><div class="table-contents"><table summary="mineBugHistory &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</th><th align="left">Ant &#23646;&#24615;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align="left">&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;file&gt;"</td><td align="left">&#20986;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-formatDates</td><td align="left">formatDates="[true|false]"</td><td align="left">&#12487;&#12540;&#12479;&#12364;&#12486;&#12461;&#12473;&#12488;&#24418;&#24335;&#12391;&#25551;&#30011;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-noTabs</td><td align="left">noTabs="[true|false]"</td><td align="left">&#12479;&#12502;&#12398;&#20195;&#12431;&#12426;&#12395;&#35079;&#25968;&#12473;&#12506;&#12540;&#12473;&#12391;&#12459;&#12521;&#12512;&#12364;&#21306;&#20999;&#12425;&#12428;&#12414;&#12377; (&#19979;&#35352;&#21442;&#29031;)&#12290;</td></tr><tr><td align="left">-summary</td><td align="left">summary="[true|false]"</td><td align="left">&#26368;&#26032; 10 &#20214;&#12398;&#22793;&#26356;&#12398;&#35201;&#32004;&#12364;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr></tbody></table></div></div><br class="table-break"><p><code class="option">-noTabs</code> &#20986;&#21147;&#12434;&#20351;&#12358;&#12371;&#12392;&#12391;&#12289;&#22266;&#23450;&#24133;&#12501;&#12457;&#12531;&#12488;&#12398;&#12471;&#12455;&#12523;&#12391;&#35501;&#12415;&#26131;&#12367;&#12394;&#12426;&#12414;&#12377;&#12290;&#25968;&#20516;&#12459;&#12521;&#12512;&#12399;&#21491;&#23492;&#12379;&#12373;&#12428;&#12427;&#12398;&#12391;&#12289;&#12473;&#12506;&#12540;&#12473;&#12364;&#12459;&#12521;&#12512;&#20516;&#12398;&#21069;&#12395;&#25407;&#20837;&#12373;&#12428;&#12414;&#12377;&#12290;&#12414;&#12383;&#12289;&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#20351;&#29992;&#12375;&#12383;&#22580;&#21512;&#12289; <code class="option">-formatDates</code> &#12434;&#25351;&#23450;&#12375;&#12383;&#12392;&#12365;&#12395;&#35201;&#32004;&#12398;&#26085;&#20184;&#12434;&#25551;&#30011;&#12377;&#12427;&#12398;&#12395;&#31354;&#30333;&#12364;&#22475;&#12417;&#36796;&#12414;&#12428;&#12394;&#12367;&#12394;&#12426;&#12414;&#12377;&#12290;</p><p>&#20986;&#21147;&#12373;&#12428;&#12427;&#34920;&#12399;&#12289; (<code class="option">-noTabs</code> &#12364;&#28961;&#12369;&#12428;&#12400;) &#12479;&#12502;&#21306;&#20999;&#12426;&#12391;&#27425;&#12395;&#31034;&#12377;&#12459;&#12521;&#12512;&#12363;&#12425;&#25104;&#12426;&#12414;&#12377; :</p><div class="table"><a name="mineBugHistoryColumns"></a><p class="title"><b>&#34920;12.4 mineBugHistory &#20986;&#21147;&#12398;&#12459;&#12521;&#12512;&#19968;&#35239;</b></p><div class="table-contents"><table summary="mineBugHistory &#20986;&#21147;&#12398;&#12459;&#12521;&#12512;&#19968;&#35239;" border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">&#34920;&#38988;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">seq</td><td align="left">&#12471;&#12540;&#12465;&#12531;&#12473;&#30058;&#21495; (0 &#22987;&#12414;&#12426;&#12398;&#36899;&#32154;&#12375;&#12383;&#25972;&#25968;&#20516;)</td></tr><tr><td align="left">version</td><td align="left">&#12496;&#12540;&#12472;&#12519;&#12531;&#21517;</td></tr><tr><td align="left">time</td><td align="left">&#12522;&#12522;&#12540;&#12473;&#12373;&#12428;&#12383;&#26085;&#26178;</td></tr><tr><td align="left">classes</td><td align="left">&#20998;&#26512;&#12373;&#12428;&#12383;&#12463;&#12521;&#12473;&#25968;</td></tr><tr><td align="left">NCSS</td><td align="left">&#12467;&#12513;&#12531;&#12488;&#25991;&#12434;&#38500;&#12356;&#12383;&#21629;&#20196;&#25968; (Non Commenting Source Statements)</td></tr><tr><td align="left">added</td><td align="left">&#21069;&#22238;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23384;&#22312;&#12375;&#12383;&#12463;&#12521;&#12473;&#12395;&#12362;&#12369;&#12427;&#26032;&#35215;&#35686;&#21578;&#25968;</td></tr><tr><td align="left">newCode</td><td align="left">&#21069;&#22238;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23384;&#22312;&#12375;&#12394;&#12363;&#12387;&#12383;&#12463;&#12521;&#12473;&#12395;&#12362;&#12369;&#12427;&#26032;&#35215;&#35686;&#21578;&#25968;</td></tr><tr><td align="left">fixed</td><td align="left">&#29694;&#22312;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23384;&#22312;&#12377;&#12427;&#12463;&#12521;&#12473;&#12395;&#12362;&#12369;&#12427;&#38500;&#21435;&#12373;&#12428;&#12383;&#35686;&#21578;&#25968;</td></tr><tr><td align="left">removed</td><td align="left">&#29694;&#22312;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23384;&#22312;&#12375;&#12394;&#12356;&#12463;&#12521;&#12473;&#12398;&#21069;&#22238;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#12362;&#12369;&#12427;&#35686;&#21578;&#25968;</td></tr><tr><td align="left">retained</td><td align="left">&#29694;&#22312;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12392;&#21069;&#22238;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#20001;&#26041;&#12395;&#23384;&#22312;&#12377;&#12427;&#35686;&#21578;&#12398;&#25968;</td></tr><tr><td align="left">dead</td><td align="left">&#20197;&#21069;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23384;&#22312;&#12375;&#12383;&#12364;&#29694;&#22312;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#12418;&#30452;&#21069;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#12418;&#23384;&#22312;&#12375;&#12394;&#12356;&#35686;&#21578;&#12398;&#25968;</td></tr><tr><td align="left">active</td><td align="left">&#29694;&#22312;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#23384;&#22312;&#12377;&#12427;&#35686;&#21578;&#32207;&#25968;</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.5. defectDensity"><div class="titlepage"><div><div><h3 class="title"><a name="defectDensity"></a>1.5. defectDensity</h3></div></div></div><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#20840;&#20307;&#12362;&#12424;&#12403;&#12463;&#12521;&#12473;&#27598;&#12539;&#12497;&#12483;&#12465;&#12540;&#12472;&#27598;&#12398;&#19981;&#33391;&#23494;&#24230; (1000 NCSS &#27598;&#12398;&#35686;&#21578;&#25968;) &#12395;&#38306;&#12377;&#12427;&#24773;&#22577;&#12434;&#19968;&#35239;&#34920;&#31034;&#12391;&#12365;&#12414;&#12377;&#12290;&#27161;&#28310;&#20837;&#21147;&#12363;&#12425;&#35501;&#12415;&#36796;&#12416;&#22580;&#21512;&#12399;&#12501;&#12449;&#12452;&#12523;&#25351;&#23450;&#12394;&#12375;&#12391;&#12289;&#12381;&#12358;&#12391;&#12394;&#12369;&#12428;&#12400;&#12289;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12391;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12390;&#12289;&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12375;&#12414;&#12377;&#12290;</p><p>&#20986;&#21147;&#12373;&#12428;&#12427;&#34920;&#12399;&#12289;&#27425;&#12395;&#31034;&#12377;&#12459;&#12521;&#12512;&#12363;&#12425;&#25104;&#12426;&#12414;&#12377;&#12290;&#12414;&#12383;&#12289;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#20840;&#20307;&#24773;&#22577;&#12398;&#34892;&#12289;&#12362;&#12424;&#12403;&#12289;4 &#20491;&#20197;&#19978;&#12398;&#35686;&#21578;&#12434;&#21547;&#12435;&#12391;&#12356;&#12427;&#21508;&#12497;&#12483;&#12465;&#12540;&#12472;&#24773;&#22577;&#12414;&#12383;&#12399;&#21508;&#12463;&#12521;&#12473;&#24773;&#22577;&#12398;&#34892;&#12418;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</p><div class="table"><a name="defectDensityColumns"></a><p class="title"><b>&#34920;12.5 defectDensity &#20986;&#21147;&#12398;&#12459;&#12521;&#12512;&#19968;&#35239;</b></p><div class="table-contents"><table summary="defectDensity &#20986;&#21147;&#12398;&#12459;&#12521;&#12512;&#19968;&#35239;" border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">&#34920;&#38988;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">kind</td><td align="left">&#12503;&#12525;&#12472;&#12455;&#12463;&#12488; (project)&#12289;&#12497;&#12483;&#12465;&#12540;&#12472; (package) &#12414;&#12383;&#12399;&#12463;&#12521;&#12473; (class)</td></tr><tr><td align="left">name</td><td align="left">&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12289;&#12497;&#12483;&#12465;&#12540;&#12472;&#12414;&#12383;&#12399;&#12463;&#12521;&#12473;&#12398;&#21517;&#21069;</td></tr><tr><td align="left">density</td><td align="left"> 1000 NCSS &#27598;&#12398;&#35686;&#21578;&#25968;</td></tr><tr><td align="left">bugs</td><td align="left">&#35686;&#21578;&#25968;</td></tr><tr><td align="left">NCSS</td><td align="left">&#12467;&#12513;&#12531;&#12488;&#25991;&#12434;&#38500;&#12356;&#12383;&#21629;&#20196;&#25968; (Non Commenting Source Statements) </td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.6. convertXmlToText"><div class="titlepage"><div><div><h3 class="title"><a name="convertXmlToText"></a>1.6. convertXmlToText</h3></div></div></div><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;XML &#24418;&#24335;&#12398;&#12496;&#12464;&#35686;&#21578;&#12434;&#12289; 1 &#34892; 1 &#12496;&#12464;&#12398;&#12486;&#12461;&#12473;&#12488;&#24418;&#24335;&#12289;&#12414;&#12383;&#12399;&#12289;HTML&#24418;&#24335;&#12395;&#22793;&#25563;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12371;&#12398;&#27231;&#33021;&#12399;&#12289; ant &#12363;&#12425;&#12418;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12378;&#27425;&#12395;&#31034;&#12377;&#12424;&#12358;&#12395;&#12289;&#12499;&#12523;&#12489;&#12501;&#12449;&#12452;&#12523;&#12395; <span class="command"><strong>convertXmlToText</strong></span> &#12434; taskdef &#12391;&#23450;&#32681;&#12375;&#12414;&#12377; :</p><pre class="programlisting">
50
51 &lt;taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask"&gt;
52 &lt;classpath refid="findbugs.lib" /&gt;
53 &lt;/taskdef&gt;
54
55 </pre><p>&#12371;&#12398; ant &#12479;&#12473;&#12463;&#12395;&#25351;&#23450;&#12391;&#12365;&#12427;&#23646;&#24615;&#12434;&#12289;&#19979;&#34920;&#12395;&#19968;&#35239;&#12391;&#31034;&#12375;&#12414;&#12377;&#12290;</p><div class="table"><a name="convertXmlToTextTable"></a><p class="title"><b>&#34920;12.6 convertXmlToText &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</b></p><div class="table-contents"><table summary="convertXmlToText &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</th><th align="left">Ant &#23646;&#24615;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;filename&gt;"</td><td align="left">&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;filename&gt;"</td><td align="left">&#20986;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-longBugCodes</td><td align="left">longBugCodes="[true|false]"</td><td align="left">2 &#25991;&#23383;&#12398;&#12496;&#12464;&#30053;&#31216;&#12398;&#20195;&#12431;&#12426;&#12395;&#12289;&#30465;&#30053;&#12394;&#12375;&#12398;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#12467;&#12540;&#12489;&#12434;&#20351;&#29992;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">&nbsp;</td><td align="left">format="text"</td><td align="left">&#12503;&#12524;&#12540;&#12531;&#12486;&#12461;&#12473;&#12488;&#12398;&#20986;&#21147;&#12364;&#20316;&#25104;&#12373;&#12428;&#12414;&#12377;&#12290;1 &#34892;&#12395;&#12388;&#12365; 1 &#12388;&#12398;&#12496;&#12464;&#12364;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#26178;&#12398;&#12487;&#12501;&#12457;&#12523;&#12488;&#12391;&#12377;&#12290;</td></tr><tr><td align="left">-html[:stylesheet]</td><td align="left">format="html:&lt;stylesheet&gt;"</td><td align="left">&#25351;&#23450;&#12373;&#12428;&#12383;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12434;&#20351;&#29992;&#12375;&#12390;&#20986;&#21147;&#12364;&#20316;&#25104;&#12373;&#12428;&#12414;&#12377; (&#19979;&#35352;&#21442;&#29031;) &#12290;&#30465;&#30053;&#12375;&#12383;&#22580;&#21512;&#12399;&#12289; default.xsl &#12364;&#20351;&#29992;&#12373;&#12428;&#12414;&#12377;&#12290;</td></tr></tbody></table></div></div><br class="table-break"><p>-html/format &#12458;&#12503;&#12471;&#12519;&#12531;&#12395;&#12399;&#12289;plain.xsl &#12289; default.xsl &#12289; fancy.xsl &#12289; fancy-hist.xsl &#12414;&#12383;&#12399; &#12518;&#12540;&#12470;&#33258;&#36523;&#12364;&#20316;&#25104;&#12375;&#12383; XSL &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12398;&#12356;&#12378;&#12428;&#12363;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12458;&#12503;&#12471;&#12519;&#12531;&#21517;&#12434;&#12424;&#12381;&#12395;&#12289; html &#20197;&#22806;&#12398;&#24418;&#24335;&#12434;&#20986;&#21147;&#12377;&#12427;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12414;&#12377;&#12290;FindBugs &#12395;&#21547;&#12414;&#12428;&#12390;&#12356;&#12427;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;(&#19978;&#36848;)&#20197;&#22806;&#12398;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12434;&#20351;&#29992;&#12377;&#12427;&#22580;&#21512;&#12399;&#12289;&#12458;&#12503;&#12471;&#12519;&#12531; -html/format &#12391;&#24403;&#35442;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12408;&#12398;&#12497;&#12473;&#12414;&#12383;&#12399; URL &#12434;&#25351;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></div><div class="sect2" title="1.7. setBugDatabaseInfo"><div class="titlepage"><div><div><h3 class="title"><a name="setBugDatabaseInfo"></a>1.7. setBugDatabaseInfo</h3></div></div></div><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#25351;&#23450;&#12375;&#12383;&#12496;&#12464;&#35686;&#21578;&#12395;&#12513;&#12479;&#24773;&#22577;&#12434;&#35373;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12395;&#12399;&#27425;&#12395;&#31034;&#12377;&#12458;&#12503;&#12471;&#12519;&#12531;&#12364;&#12354;&#12426;&#12414;&#12377;:</p><p>&#12371;&#12398;&#27231;&#33021;&#12399;&#12289; ant &#12363;&#12425;&#12418;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12378;&#27425;&#12395;&#31034;&#12377;&#12424;&#12358;&#12395;&#12289;&#12499;&#12523;&#12489;&#12501;&#12449;&#12452;&#12523;&#12395; <span class="command"><strong>setBugDatabaseInfo</strong></span> &#12434; taskdef &#12391;&#23450;&#32681;&#12375;&#12414;&#12377; :</p><pre class="programlisting">
56
57 &lt;taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask"&gt;
58 &lt;classpath refid="findbugs.lib" /&gt;
59 &lt;/taskdef&gt;
60
61 </pre><p>&#12371;&#12398; ant &#12479;&#12473;&#12463;&#12395;&#25351;&#23450;&#12391;&#12365;&#12427;&#23646;&#24615;&#12434;&#12289;&#19979;&#34920;&#12395;&#19968;&#35239;&#12391;&#31034;&#12375;&#12414;&#12377;&#12290;&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12377;&#12427;&#12395;&#12399;&#12289; <code class="literal">input</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12377;&#12427;&#12363;&#12289; <code class="literal">&lt;datafile&gt;</code> &#35201;&#32032;&#12434;&#20837;&#12428;&#23376;&#12395;&#12375;&#12390;&#20837;&#12428;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#27425;&#12395;&#12289;&#20363;&#12434;&#31034;&#12375;&#12414;&#12377;:</p><pre class="programlisting">
62
63 &lt;setBugDatabaseInfo home="${findbugs.home}" ...&gt;
64 &lt;datafile name="analyze.xml"/&gt;
65 &lt;/setBugDatabaseInfo&gt;
66
67 </pre><div class="table"><a name="setBugDatabaseInfoOptions"></a><p class="title"><b>&#34920;12.7 setBugDatabaseInfo &#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</b></p><div class="table-contents"><table summary="setBugDatabaseInfo &#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</th><th align="left">Ant &#23646;&#24615;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align="left">&#20837;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;file&gt;"</td><td align="left">&#20986;&#21147;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-name &lt;name&gt;</td><td align="left">name="&lt;name&gt;"</td><td align="left">&#26368;&#26032;&#12522;&#12499;&#12472;&#12519;&#12531;&#12398;&#21517;&#21069;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-timestamp &lt;when&gt;</td><td align="left">timestamp="&lt;when&gt;"</td><td align="left">&#26368;&#26032;&#12522;&#12499;&#12472;&#12519;&#12531;&#12398;&#12479;&#12452;&#12512;&#12539;&#12473;&#12479;&#12531;&#12503;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-source &lt;directory&gt;</td><td align="left">source="&lt;directory&gt;"</td><td align="left">&#12477;&#12540;&#12473;&#12434;&#26908;&#32034;&#12377;&#12427;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434;&#36861;&#21152;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-findSource &lt;directory&gt;</td><td align="left">findSource="&lt;directory&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#20869;&#12434;&#26908;&#32034;&#12375;&#12390;&#38306;&#36899;&#12377;&#12427;&#12477;&#12540;&#12473;&#12398;&#22580;&#25152;&#12434;&#36861;&#21152;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-suppress &lt;filter file&gt;</td><td align="left">suppress="&lt;filter file&gt;"</td><td align="left">&#25351;&#23450;&#12375;&#12383;&#12501;&#12449;&#12452;&#12523;&#12395;&#19968;&#33268;&#12377;&#12427;&#35686;&#21578;&#12434;&#25233;&#27490;&#12375;&#12414;&#12377; (&#20197;&#21069;&#12395;&#25351;&#23450;&#12375;&#12383;&#25233;&#27490;&#35373;&#23450;&#12399;&#32622;&#12365;&#25563;&#12360;&#12425;&#12428;&#12414;&#12377;)&#12290;</td></tr><tr><td align="left">-withMessages</td><td align="left">withMessages="[true|false]"</td><td align="left">XML&#12395;&#12486;&#12461;&#12473;&#12488;&#12513;&#12483;&#12475;&#12540;&#12472;&#12434;&#36861;&#21152;&#12375;&#12414;&#12377;&#12290;</td></tr><tr><td align="left">-resetSource</td><td align="left">resetSource="[true|false]"</td><td align="left">&#12477;&#12540;&#12473;&#26908;&#32034;&#12497;&#12473;&#12434;&#12377;&#12409;&#12390;&#21066;&#38500;&#12375;&#12414;&#12377;&#12290;</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.8. listBugDatabaseInfo"><div class="titlepage"><div><div><h3 class="title"><a name="listBugDatabaseInfo"></a>1.8. listBugDatabaseInfo</h3></div></div></div><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12398;&#23455;&#34892;&#12395;&#12362;&#12356;&#12390;&#12399;&#12289;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12391; 0 &#20491;&#20197;&#19978;&#12398; xml &#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;1&#12388;&#12418;&#25351;&#23450;&#12375;&#12394;&#12369;&#12428;&#12400;&#12289;&#27161;&#28310;&#20986;&#21147;&#12363;&#12425;&#35501;&#12415;&#36796;&#12415;&#12434;&#34892;&#12356;&#12486;&#12540;&#12502;&#12523;&#12398;&#12504;&#12483;&#12480;&#12540;&#12399;&#29983;&#25104;&#12373;&#12428;&#12414;&#12379;&#12435;&#12290;</p><p>&#12371;&#12398;&#12467;&#12510;&#12531;&#12489;&#12395;&#12399; 1 &#12388;&#12384;&#12369;&#12458;&#12503;&#12471;&#12519;&#12531;&#12364;&#12354;&#12426;&#12414;&#12377; : <code class="option">-formatDates</code> &#12434;&#25351;&#23450;&#12377;&#12427;&#12392;&#12486;&#12461;&#12473;&#12488;&#24418;&#24335;&#12391;&#12487;&#12540;&#12479;&#12364;&#25551;&#30011;&#12373;&#12428;&#12414;&#12377;&#12290;</p><p>&#20986;&#21147;&#12373;&#12428;&#12427;&#34920;&#12399;&#12289;&#21508;&#12496;&#12464;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12372;&#12392;&#12395;&#34892;&#12434;&#25345;&#12385;&#12289;&#27425;&#12395;&#31034;&#12377;&#12459;&#12521;&#12512;&#12363;&#12425;&#25104;&#12426;&#12414;&#12377; :</p><div class="table"><a name="listBugDatabaseInfoColumns"></a><p class="title"><b>&#34920;12.8 listBugDatabaseInfo &#12459;&#12521;&#12512;&#19968;&#35239;</b></p><div class="table-contents"><table summary="listBugDatabaseInfo &#12459;&#12521;&#12512;&#19968;&#35239;" border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">&#12459;&#12521;&#12512;</th><th align="left">&#30446;&#30340;</th></tr></thead><tbody><tr><td align="left">version</td><td align="left">&#12496;&#12540;&#12472;&#12519;&#12531;&#21517;</td></tr><tr><td align="left">time</td><td align="left">&#12522;&#12522;&#12540;&#12473;&#12373;&#12428;&#12383;&#26085;&#26178;</td></tr><tr><td align="left">classes</td><td align="left">&#20998;&#26512;&#12373;&#12428;&#12383;&#12463;&#12521;&#12473;&#25968;</td></tr><tr><td align="left">NCSS</td><td align="left">&#12467;&#12513;&#12531;&#12488;&#25991;&#12434;&#38500;&#12356;&#12383;&#21629;&#20196;&#25968; (Non Commenting Source Statements)</td></tr><tr><td align="left">total</td><td align="left">&#20840;&#35686;&#21578;&#25968;</td></tr><tr><td align="left">high</td><td align="left">&#20778;&#20808;&#24230;(&#39640;)&#12398;&#35686;&#21578;&#12398;&#32207;&#25968;</td></tr><tr><td align="left">medium</td><td align="left">&#20778;&#20808;&#24230;(&#20013;)&#12398;&#35686;&#21578;&#12398;&#32207;&#25968;</td></tr><tr><td align="left">low</td><td align="left">&#20778;&#20808;&#24230;(&#20302;)&#12398;&#35686;&#21578;&#12398;&#32207;&#25968;</td></tr><tr><td align="left">filename</td><td align="left">&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12398;&#12501;&#12449;&#12452;&#12523;&#21517;</td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="sect1" title="2. &#20363;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="examples"></a>2. &#20363;</h2></div></div></div><div class="sect2" title="2.1. &#25552;&#20379;&#12373;&#12428;&#12383;&#12471;&#12455;&#12523;&#12539;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20351;&#29992;&#12375;&#12390;&#12398;&#23653;&#27508;&#12510;&#12452;&#12491;&#12531;&#12464;"><div class="titlepage"><div><div><h3 class="title"><a name="unixscriptsexamples"></a>2.1. &#25552;&#20379;&#12373;&#12428;&#12383;&#12471;&#12455;&#12523;&#12539;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20351;&#29992;&#12375;&#12390;&#12398;&#23653;&#27508;&#12510;&#12452;&#12491;&#12531;&#12464;</h3></div></div></div><p>&#20197;&#19979;&#12399;&#12377;&#12409;&#12390;&#12289; jdk1.6.0-b12, jdk1.6.0-b13, ..., jdk1.6.0-b60 &#12398;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12395;&#23550;&#12375;&#12390;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;</p><p>&#20197;&#19979;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12375;&#12390;&#12415;&#12414;&#12377; :</p><pre class="screen">
68 computeBugHistory jdk1.6.0-b* | filterBugs -bugPattern IL_ | mineBugHistory -formatDates
69 </pre><p>&#12377;&#12427;&#12392;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394;&#20986;&#21147;&#12364;&#34892;&#12431;&#12428;&#12414;&#12377; :</p><pre class="screen">
70 seq version time classes NCSS added newCode fixed removed retained dead active
71 0 jdk1.6.0-b12 "Thu Nov 11 09:07:20 EST 2004" 13128 811569 0 4 0 0 0 0 4
72 1 jdk1.6.0-b13 "Thu Nov 18 06:02:06 EST 2004" 13128 811570 0 0 0 0 4 0 4
73 2 jdk1.6.0-b14 "Thu Dec 02 06:12:26 EST 2004" 13145 811786 0 0 2 0 2 0 2
74 3 jdk1.6.0-b15 "Thu Dec 09 06:07:04 EST 2004" 13174 811693 0 0 1 0 1 2 1
75 4 jdk1.6.0-b16 "Thu Dec 16 06:21:28 EST 2004" 13175 811715 0 0 0 0 1 3 1
76 5 jdk1.6.0-b17 "Thu Dec 23 06:27:22 EST 2004" 13176 811974 0 0 0 0 1 3 1
77 6 jdk1.6.0-b19 "Thu Jan 13 06:41:16 EST 2005" 13176 812011 0 0 0 0 1 3 1
78 7 jdk1.6.0-b21 "Thu Jan 27 05:57:52 EST 2005" 13177 812173 0 0 0 0 1 3 1
79 8 jdk1.6.0-b23 "Thu Feb 10 05:44:36 EST 2005" 13179 812188 0 0 0 0 1 3 1
80 9 jdk1.6.0-b26 "Thu Mar 03 06:04:02 EST 2005" 13199 811770 0 0 0 0 1 3 1
81 10 jdk1.6.0-b27 "Thu Mar 10 04:48:38 EST 2005" 13189 812440 0 0 0 0 1 3 1
82 11 jdk1.6.0-b28 "Thu Mar 17 02:54:22 EST 2005" 13185 812056 0 0 0 0 1 3 1
83 12 jdk1.6.0-b29 "Thu Mar 24 03:09:20 EST 2005" 13117 809468 0 0 0 0 1 3 1
84 13 jdk1.6.0-b30 "Thu Mar 31 02:53:32 EST 2005" 13118 809501 0 0 0 0 1 3 1
85 14 jdk1.6.0-b31 "Thu Apr 07 03:00:14 EDT 2005" 13117 809572 0 0 0 0 1 3 1
86 15 jdk1.6.0-b32 "Thu Apr 14 02:56:56 EDT 2005" 13169 811096 0 0 0 0 1 3 1
87 16 jdk1.6.0-b33 "Thu Apr 21 02:46:22 EDT 2005" 13187 811942 0 0 0 0 1 3 1
88 17 jdk1.6.0-b34 "Thu Apr 28 02:49:00 EDT 2005" 13195 813488 0 1 0 0 1 3 2
89 18 jdk1.6.0-b35 "Thu May 05 02:49:04 EDT 2005" 13457 829837 0 0 0 0 2 3 2
90 19 jdk1.6.0-b36 "Thu May 12 02:59:46 EDT 2005" 13462 831278 0 0 0 0 2 3 2
91 20 jdk1.6.0-b37 "Thu May 19 02:55:08 EDT 2005" 13464 831971 0 0 0 0 2 3 2
92 21 jdk1.6.0-b38 "Thu May 26 03:08:16 EDT 2005" 13564 836565 0 0 0 0 2 3 2
93 22 jdk1.6.0-b39 "Fri Jun 03 03:10:48 EDT 2005" 13856 849992 0 1 0 0 2 3 3
94 23 jdk1.6.0-b40 "Thu Jun 09 03:30:28 EDT 2005" 15972 959619 0 2 0 0 3 3 5
95 24 jdk1.6.0-b41 "Thu Jun 16 03:19:22 EDT 2005" 15972 959619 0 0 0 0 5 3 5
96 25 jdk1.6.0-b42 "Fri Jun 24 03:38:54 EDT 2005" 15966 958581 0 0 0 0 5 3 5
97 26 jdk1.6.0-b43 "Thu Jul 14 03:09:34 EDT 2005" 16041 960544 0 0 0 0 5 3 5
98 27 jdk1.6.0-b44 "Thu Jul 21 03:05:54 EDT 2005" 16041 960547 0 0 0 0 5 3 5
99 28 jdk1.6.0-b45 "Thu Jul 28 03:26:10 EDT 2005" 16037 960606 0 0 1 0 4 3 4
100 29 jdk1.6.0-b46 "Thu Aug 04 03:02:48 EDT 2005" 15936 951355 0 0 0 0 4 4 4
101 30 jdk1.6.0-b47 "Thu Aug 11 03:18:56 EDT 2005" 15964 952387 0 0 1 0 3 4 3
102 31 jdk1.6.0-b48 "Thu Aug 18 08:10:40 EDT 2005" 15970 953421 0 0 0 0 3 5 3
103 32 jdk1.6.0-b49 "Thu Aug 25 03:24:38 EDT 2005" 16048 958940 0 0 0 0 3 5 3
104 33 jdk1.6.0-b50 "Thu Sep 01 01:52:40 EDT 2005" 16287 974937 1 0 0 0 3 5 4
105 34 jdk1.6.0-b51 "Thu Sep 08 01:55:36 EDT 2005" 16362 979377 0 0 0 0 4 5 4
106 35 jdk1.6.0-b52 "Thu Sep 15 02:04:08 EDT 2005" 16477 979399 0 0 0 0 4 5 4
107 36 jdk1.6.0-b53 "Thu Sep 22 02:00:28 EDT 2005" 16019 957900 0 0 1 0 3 5 3
108 37 jdk1.6.0-b54 "Thu Sep 29 01:54:34 EDT 2005" 16019 957900 0 0 0 0 3 6 3
109 38 jdk1.6.0-b55 "Thu Oct 06 01:54:14 EDT 2005" 16051 959014 0 0 0 0 3 6 3
110 39 jdk1.6.0-b56 "Thu Oct 13 01:54:12 EDT 2005" 16211 970835 0 0 0 0 3 6 3
111 40 jdk1.6.0-b57 "Thu Oct 20 01:55:26 EDT 2005" 16279 971627 0 0 0 0 3 6 3
112 41 jdk1.6.0-b58 "Thu Oct 27 01:56:30 EDT 2005" 16283 971945 0 0 0 0 3 6 3
113 42 jdk1.6.0-b59 "Thu Nov 03 01:56:58 EST 2005" 16232 972193 0 0 0 0 3 6 3
114 43 jdk1.6.0-b60 "Thu Nov 10 01:54:18 EST 2005" 16235 972346 0 0 0 0 3 6 3
115 </pre><p>&#27425;&#12395;&#31034;&#12377;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12377;&#12427;&#12392;&#12289;db.xml &#20013;&#38291;&#12501;&#12449;&#12452;&#12523;&#12434;&#29983;&#25104;&#12377;&#12427;&#12371;&#12392;&#12394;&#12367;&#30452;&#25509;&#21516;&#12376;&#24773;&#22577;&#12434;&#20316;&#25104;&#12391;&#12365;&#12414;&#12377;&#12290;</p><pre class="screen">
116 computeBugHistory jdk1.6.0-b*/jre/lib/rt.xml | filterBugs -bugPattern IL_ db.xml | mineBugHistory -formatDates
117 </pre><p>&#12371;&#12398;&#24773;&#22577;&#12434;&#20351;&#12387;&#12390;&#12289; Sun JDK1.6.0 &#12398;&#21508;&#12499;&#12523;&#12489;&#12395;&#12362;&#12356;&#12390; FindBugs &#12395;&#12424;&#12387;&#12390;&#30330;&#35211;&#12373;&#12428;&#12383;&#28961;&#38480;&#20877;&#36215;&#12523;&#12540;&#12503;&#12398;&#25968;&#12434;&#34920;&#12377;&#12464;&#12521;&#12501;&#12434;&#34920;&#31034;&#12375;&#12414;&#12377;&#12290;&#38738;&#33394;&#12398;&#38936;&#22495;&#12399;&#12289;&#24403;&#35442;&#12499;&#12523;&#12489;&#12395;&#12362;&#12369;&#12427;&#28961;&#38480;&#20877;&#36215;&#12523;&#12540;&#12503;&#12398;&#25968;&#12434;&#34920;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12381;&#12398;&#19978;&#12395;&#25551;&#12363;&#12428;&#12390;&#12356;&#12427;&#36196;&#33394;&#12398;&#38936;&#22495;&#12399;&#12289;&#20197;&#21069;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#12399;&#23384;&#22312;&#12375;&#12383;&#12364;&#24403;&#35442;&#12496;&#12540;&#12472;&#12519;&#12531;&#12391;&#12399;&#38500;&#21435;&#12373;&#12428;&#12383;&#28961;&#38480;&#20877;&#36215;&#12523;&#12540;&#12503;&#12398;&#25968;&#12434;&#34920;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290; (&#12375;&#12383;&#12364;&#12387;&#12390;&#12289;&#36196;&#33394;&#12398;&#38936;&#22495;&#12392;&#38738;&#33394;&#12398;&#38936;&#22495;&#12434;&#36275;&#12375;&#21512;&#12431;&#12379;&#12383;&#39640;&#12373;&#12399;&#27770;&#12375;&#12390;&#28187;&#23569;&#12375;&#12394;&#12356;&#12371;&#12392;&#12364;&#20445;&#35388;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;&#12381;&#12375;&#12390;&#12289;&#26032;&#12383;&#12395;&#28961;&#38480;&#20877;&#36215;&#12523;&#12540;&#12503;&#12398;&#12496;&#12464;&#12364;&#25345;&#12385;&#36796;&#12414;&#12428;&#12383;&#26178;&#28857;&#12391;&#22679;&#21152;&#12375;&#12414;&#12377;) &#12290;&#36196;&#33394;&#12398;&#38936;&#22495;&#12398;&#39640;&#12373;&#12399;&#12289;&#24403;&#35442;&#12496;&#12540;&#12472;&#12519;&#12531;&#12395;&#12362;&#12356;&#12390;&#20462;&#27491;&#12414;&#12383;&#12399;&#21066;&#38500;&#12373;&#12428;&#12383;&#12496;&#12464;&#25968;&#12398;&#21512;&#35336;&#12391;&#31639;&#20986;&#12373;&#12428;&#12414;&#12377;&#12290;&#12496;&#12540;&#12472;&#12519;&#12531; 13 &#12362;&#12424;&#12403; 14 &#12395;&#12362;&#12356;&#12390;&#35211;&#12425;&#12428;&#12427;&#28187;&#23569;&#12399;&#12289; FindBugs &#12434;&#20351;&#29992;&#12375;&#12390;&#35211;&#12388;&#12363;&#12387;&#12383; JDK &#12398;&#12496;&#12464;&#12398;&#22577;&#21578;&#12434; Sun &#12364;&#21463;&#12369;&#21462;&#12387;&#12383;&#12371;&#12392;&#12395;&#12424;&#12427;&#12418;&#12398;&#12391;&#12377;&#12290;</p><div class="mediaobject"><img src="infiniteRecursiveLoops.png"></div><p>db.xml &#12501;&#12449;&#12452;&#12523;&#12399;&#12289; jdk1.6.0 &#12398;&#12377;&#12409;&#12390;&#12398;&#12499;&#12523;&#12489;&#12395;&#23550;&#12377;&#12427;&#26908;&#32034;&#32080;&#26524;&#12434;&#20445;&#25345;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12375;&#12383;&#12364;&#12387;&#12390;&#12289;&#27425;&#12395;&#31034;&#12377;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#20778;&#20808;&#24230;(&#39640;)&#12414;&#12383;&#12399;&#20778;&#20808;&#24230;(&#20302;)&#12398;&#27491;&#30906;&#24615;&#12395;&#38306;&#12377;&#12427;&#35686;&#21578;&#12398;&#23653;&#27508;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377; :</p><pre class="screen">
118 filterBugs -priority M -category C db.xml | mineBugHistory -formatDates
119 </pre><p>&#20316;&#25104;&#12373;&#12428;&#12427;&#34920;&#12398;&#20363; :</p><pre class="screen">
120 seq version time classes NCSS added newCode fixed removed retained dead active
121 0 jdk1.6.0-b12 "Thu Nov 11 09:07:20 EST 2004" 13128 811569 0 1075 0 0 0 0 1075
122 1 jdk1.6.0-b13 "Thu Nov 18 06:02:06 EST 2004" 13128 811570 0 0 0 0 1075 0 1075
123 2 jdk1.6.0-b14 "Thu Dec 02 06:12:26 EST 2004" 13145 811786 3 0 6 0 1069 0 1072
124 3 jdk1.6.0-b15 "Thu Dec 09 06:07:04 EST 2004" 13174 811693 2 1 3 0 1069 6 1072
125 4 jdk1.6.0-b16 "Thu Dec 16 06:21:28 EST 2004" 13175 811715 0 0 1 0 1071 9 1071
126 5 jdk1.6.0-b17 "Thu Dec 23 06:27:22 EST 2004" 13176 811974 0 0 1 0 1070 10 1070
127 6 jdk1.6.0-b19 "Thu Jan 13 06:41:16 EST 2005" 13176 812011 0 0 0 0 1070 11 1070
128 7 jdk1.6.0-b21 "Thu Jan 27 05:57:52 EST 2005" 13177 812173 0 0 1 0 1069 11 1069
129 8 jdk1.6.0-b23 "Thu Feb 10 05:44:36 EST 2005" 13179 812188 0 0 0 0 1069 12 1069
130 9 jdk1.6.0-b26 "Thu Mar 03 06:04:02 EST 2005" 13199 811770 0 0 2 1 1066 12 1066
131 10 jdk1.6.0-b27 "Thu Mar 10 04:48:38 EST 2005" 13189 812440 1 0 1 1 1064 15 1065
132 11 jdk1.6.0-b28 "Thu Mar 17 02:54:22 EST 2005" 13185 812056 0 0 0 0 1065 17 1065
133 12 jdk1.6.0-b29 "Thu Mar 24 03:09:20 EST 2005" 13117 809468 3 0 8 26 1031 17 1034
134 13 jdk1.6.0-b30 "Thu Mar 31 02:53:32 EST 2005" 13118 809501 0 0 0 0 1034 51 1034
135 14 jdk1.6.0-b31 "Thu Apr 07 03:00:14 EDT 2005" 13117 809572 0 0 0 0 1034 51 1034
136 15 jdk1.6.0-b32 "Thu Apr 14 02:56:56 EDT 2005" 13169 811096 1 1 0 1 1033 51 1035
137 16 jdk1.6.0-b33 "Thu Apr 21 02:46:22 EDT 2005" 13187 811942 3 0 2 1 1032 52 1035
138 17 jdk1.6.0-b34 "Thu Apr 28 02:49:00 EDT 2005" 13195 813488 0 1 0 0 1035 55 1036
139 18 jdk1.6.0-b35 "Thu May 05 02:49:04 EDT 2005" 13457 829837 0 36 2 0 1034 55 1070
140 19 jdk1.6.0-b36 "Thu May 12 02:59:46 EDT 2005" 13462 831278 0 0 0 0 1070 57 1070
141 20 jdk1.6.0-b37 "Thu May 19 02:55:08 EDT 2005" 13464 831971 0 1 1 0 1069 57 1070
142 21 jdk1.6.0-b38 "Thu May 26 03:08:16 EDT 2005" 13564 836565 1 7 2 6 1062 58 1070
143 22 jdk1.6.0-b39 "Fri Jun 03 03:10:48 EDT 2005" 13856 849992 6 39 5 0 1065 66 1110
144 23 jdk1.6.0-b40 "Thu Jun 09 03:30:28 EDT 2005" 15972 959619 7 147 11 0 1099 71 1253
145 24 jdk1.6.0-b41 "Thu Jun 16 03:19:22 EDT 2005" 15972 959619 0 0 0 0 1253 82 1253
146 25 jdk1.6.0-b42 "Fri Jun 24 03:38:54 EDT 2005" 15966 958581 3 0 1 2 1250 82 1253
147 26 jdk1.6.0-b43 "Thu Jul 14 03:09:34 EDT 2005" 16041 960544 5 11 15 8 1230 85 1246
148 27 jdk1.6.0-b44 "Thu Jul 21 03:05:54 EDT 2005" 16041 960547 0 0 0 0 1246 108 1246
149 28 jdk1.6.0-b45 "Thu Jul 28 03:26:10 EDT 2005" 16037 960606 19 0 2 0 1244 108 1263
150 29 jdk1.6.0-b46 "Thu Aug 04 03:02:48 EDT 2005" 15936 951355 13 1 1 32 1230 110 1244
151 30 jdk1.6.0-b47 "Thu Aug 11 03:18:56 EDT 2005" 15964 952387 163 8 7 20 1217 143 1388
152 31 jdk1.6.0-b48 "Thu Aug 18 08:10:40 EDT 2005" 15970 953421 0 0 0 0 1388 170 1388
153 32 jdk1.6.0-b49 "Thu Aug 25 03:24:38 EDT 2005" 16048 958940 1 11 1 0 1387 170 1399
154 33 jdk1.6.0-b50 "Thu Sep 01 01:52:40 EDT 2005" 16287 974937 19 27 16 7 1376 171 1422
155 34 jdk1.6.0-b51 "Thu Sep 08 01:55:36 EDT 2005" 16362 979377 1 15 3 0 1419 194 1435
156 35 jdk1.6.0-b52 "Thu Sep 15 02:04:08 EDT 2005" 16477 979399 0 0 1 1 1433 197 1433
157 36 jdk1.6.0-b53 "Thu Sep 22 02:00:28 EDT 2005" 16019 957900 13 12 16 20 1397 199 1422
158 37 jdk1.6.0-b54 "Thu Sep 29 01:54:34 EDT 2005" 16019 957900 0 0 0 0 1422 235 1422
159 38 jdk1.6.0-b55 "Thu Oct 06 01:54:14 EDT 2005" 16051 959014 1 4 7 0 1415 235 1420
160 39 jdk1.6.0-b56 "Thu Oct 13 01:54:12 EDT 2005" 16211 970835 6 8 37 0 1383 242 1397
161 40 jdk1.6.0-b57 "Thu Oct 20 01:55:26 EDT 2005" 16279 971627 0 0 0 0 1397 279 1397
162 41 jdk1.6.0-b58 "Thu Oct 27 01:56:30 EDT 2005" 16283 971945 0 1 1 0 1396 279 1397
163 42 jdk1.6.0-b59 "Thu Nov 03 01:56:58 EST 2005" 16232 972193 6 0 5 0 1392 280 1398
164 43 jdk1.6.0-b60 "Thu Nov 10 01:54:18 EST 2005" 16235 972346 0 0 0 0 1398 285 1398
165 44 jdk1.6.0-b61 "Thu Nov 17 01:58:42 EST 2005" 16202 971134 2 0 4 0 1394 285 1396
166 </pre></div><div class="sect2" title="2.2. &#22679;&#20998;&#23653;&#27508;&#12513;&#12531;&#12486;&#12490;&#12531;&#12473;"><div class="titlepage"><div><div><h3 class="title"><a name="incrementalhistory"></a>2.2. &#22679;&#20998;&#23653;&#27508;&#12513;&#12531;&#12486;&#12490;&#12531;&#12473;</h3></div></div></div><p>&#20206;&#12395;&#12289; db.xml &#12364;&#12499;&#12523;&#12489; b12 - b60 &#12395;&#23550;&#12377;&#12427; findbugs &#23455;&#34892;&#32080;&#26524;&#12434;&#20445;&#25345;&#12375;&#12390;&#12356;&#12427;&#22580;&#21512;&#12289;&#27425;&#12395;&#31034;&#12377;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289; db.xml &#12395; b61 &#12395;&#23550;&#12377;&#12427;&#23455;&#34892;&#32080;&#26524;&#12434;&#36861;&#21152;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377; :</p><pre class="screen">
167 computeBugHistory -output db.xml db.xml jdk1.6.0-b61/jre/lib/rt.xml
168 </pre></div></div><div class="sect1" title="3. Ant &#12398;&#20363;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="antexample"></a>3. Ant &#12398;&#20363;</h2></div></div></div><p>findbugs &#12398;&#23455;&#34892;&#12392;&#12381;&#12398;&#24460;&#12398;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;&#12484;&#12540;&#12523;&#12398;&#27963;&#29992;&#12398;&#20001;&#26041;&#12434;&#23455;&#34892;&#12375;&#12390;&#12356;&#12427; ant &#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#23436;&#20840;&#12394;&#20363;&#12434;&#20197;&#19979;&#12395;&#31034;&#12375;&#12414;&#12377; :</p><pre class="screen">
169
170 &lt;project name="analyze_asm_util" default="findbugs"&gt;
171 &lt;!-- findbugs &#12479;&#12473;&#12463;&#23450;&#32681; --&gt;
172 &lt;property name="findbugs.home" value="/Users/ben/Documents/workspace/findbugs/findbugs" /&gt;
173 &lt;property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en -Duser.region=EN -Dfindbugs.home=${findbugs.home}" /&gt;
174
175 &lt;path id="findbugs.lib"&gt;
176 &lt;fileset dir="${findbugs.home}/lib"&gt;
177 &lt;include name="findbugs-ant.jar"/&gt;
178 &lt;/fileset&gt;
179 &lt;/path&gt;
180
181 &lt;taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"&gt;
182 &lt;classpath refid="findbugs.lib" /&gt;
183 &lt;/taskdef&gt;
184
185 &lt;taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask"&gt;
186 &lt;classpath refid="findbugs.lib" /&gt;
187 &lt;/taskdef&gt;
188
189 &lt;taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask"&gt;
190 &lt;classpath refid="findbugs.lib" /&gt;
191 &lt;/taskdef&gt;
192
193 &lt;taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask"&gt;
194 &lt;classpath refid="findbugs.lib" /&gt;
195 &lt;/taskdef&gt;
196
197 &lt;!-- findbugs &#12479;&#12473;&#12463;&#23450;&#32681; --&gt;
198 &lt;target name="findbugs"&gt;
199 &lt;antcall target="analyze" /&gt;
200 &lt;antcall target="mine" /&gt;
201 &lt;/target&gt;
202
203 &lt;!-- &#20998;&#26512;&#12434;&#34892;&#12358;&#12479;&#12473;&#12463;--&gt;
204 &lt;target name="analyze"&gt;
205 &lt;!-- asm-util &#12395;&#23550;&#12375;&#12390; findbugs &#12434;&#23455;&#34892;&#12377;&#12427; --&gt;
206 &lt;findbugs home="${findbugs.home}"
207 output="xml:withMessages"
208 timeout="90000000"
209 reportLevel="experimental"
210 workHard="true"
211 effort="max"
212 adjustExperimental="true"
213 jvmargs="${jvmargs}"
214 failOnError="true"
215 outputFile="out.xml"
216 projectName="Findbugs"
217 debug="false"&gt;
218 &lt;class location="asm-util-3.0.jar" /&gt;
219 &lt;/findbugs&gt;
220 &lt;/target&gt;
221
222 &lt;target name="mine"&gt;
223
224 &lt;!-- &#26368;&#26032;&#12398;&#20998;&#26512;&#32080;&#26524;&#12395;&#24773;&#22577;&#12434;&#35373;&#23450;&#12377;&#12427; --&gt;
225 &lt;setBugDatabaseInfo home="${findbugs.home}"
226 withMessages="true"
227 name="asm-util-3.0.jar"
228 input="out.xml"
229 output="out-rel.xml"/&gt;
230
231 &lt;!-- &#23653;&#27508;&#12501;&#12449;&#12452;&#12523; (out-hist.xml) &#12364;&#26082;&#12395;&#23384;&#22312;&#12377;&#12427;&#12363;&#12393;&#12358;&#12363;&#12434;&#30906;&#35469;&#12377;&#12427; --&gt;
232 &lt;condition property="mining.historyfile.available"&gt;
233 &lt;available file="out-hist.xml"/&gt;
234 &lt;/condition&gt;
235 &lt;condition property="mining.historyfile.notavailable"&gt;
236 &lt;not&gt;
237 &lt;available file="out-hist.xml"/&gt;
238 &lt;/not&gt;
239 &lt;/condition&gt;
240
241 &lt;!-- &#12371;&#12398;&#12479;&#12540;&#12466;&#12483;&#12488;&#12399;&#12289;&#23653;&#27508;&#12501;&#12449;&#12452;&#12523;&#12364;&#23384;&#22312;&#12375;&#12394;&#12356;&#12392;&#12365; (&#21021;&#22238;) &#12384;&#12369;&#23455;&#34892;&#12373;&#12428;&#12414;&#12377; --&gt;
242 &lt;antcall target="history-init"&gt;
243 &lt;param name="data.file" value="out-rel.xml" /&gt;
244 &lt;param name="hist.file" value="out-hist.xml" /&gt;
245 &lt;/antcall&gt;
246 &lt;!-- &#19978;&#35352;&#20197;&#22806;&#12398;&#22580;&#21512;&#12395;&#23455;&#34892;&#12373;&#12428;&#12414;&#12377; --&gt;
247 &lt;antcall target="history"&gt;
248 &lt;param name="data.file" value="out-rel.xml" /&gt;
249 &lt;param name="hist.file" value="out-hist.xml" /&gt;
250 &lt;param name="hist.summary.file" value="out-hist.txt" /&gt;
251 &lt;/antcall&gt;
252 &lt;/target&gt;
253
254 &lt;!-- &#23653;&#27508;&#12501;&#12449;&#12452;&#12523;&#12434;&#21021;&#26399;&#21270;&#12375;&#12414;&#12377; --&gt;
255 &lt;target name="history-init" if="mining.historyfile.notavailable"&gt;
256 &lt;copy file="${data.file}" tofile="${hist.file}" /&gt;
257 &lt;/target&gt;
258
259 &lt;!-- &#12496;&#12464;&#23653;&#27508;&#12434;&#31639;&#20986;&#12375;&#12414;&#12377; --&gt;
260 &lt;target name="history" if="mining.historyfile.available"&gt;
261 &lt;!-- ${data.file} &#12434; ${hist.file} &#12395;&#12510;&#12540;&#12472;&#12375;&#12414;&#12377; --&gt;
262 &lt;computeBugHistory home="${findbugs.home}"
263 withMessages="true"
264 output="${hist.file}"&gt;
265 &lt;dataFile name="${hist.file}"/&gt;
266 &lt;dataFile name="${data.file}"/&gt;
267 &lt;/computeBugHistory&gt;
268
269 &lt;!-- &#23653;&#27508;&#12434;&#31639;&#20986;&#12375;&#12390; ${hist.summary.file} &#12395;&#20986;&#21147;&#12375;&#12414;&#12377; --&gt;
270 &lt;mineBugHistory home="${findbugs.home}"
271 formatDates="true"
272 noTabs="true"
273 input="${hist.file}"
274 output="${hist.summary.file}"/&gt;
275 &lt;/target&gt;
276
277 &lt;/project&gt;
278
279 </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="rejarForAnalysis.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="license.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;11&#31456; rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;13&#31456; &#12521;&#12452;&#12475;&#12531;&#12473;</td></tr></table></div></body></html>
+0
-3
doc/ja/manual/eclipse.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;7&#31456; FindBugs&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="anttask.html" title="&#31532;6&#31456; FindBugs&#8482; Ant &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;"><link rel="next" href="filter.html" title="&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;7&#31456; <span class="application">FindBugs</span>&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="anttask.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="filter.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;7&#31456; FindBugs&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;"><div class="titlepage"><div><div><h2 class="title"><a name="eclipse"></a>&#31532;7&#31456; <span class="application">FindBugs</span>&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="eclipse.html#d0e1604">1. &#24517;&#35201;&#26465;&#20214;</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1611">2. &#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1658">3. &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1681">4. &#12488;&#12521;&#12502;&#12523;&#12471;&#12517;&#12540;&#12486;&#12451;&#12531;&#12464;</a></span></dt></dl></div><p>FindBugs Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12395;&#12424;&#12387;&#12390;&#12289; <span class="application">FindBugs</span> &#12434; <a class="ulink" href="http://www.eclipse.org/" target="_top">Eclipse</a> IDE &#12391;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12371;&#12398;FindBugs Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12399;&#12289; Peter Friese &#27663;&#12398;&#22810;&#22823;&#12394;&#36002;&#29486;&#12395;&#12424;&#12427;&#12418;&#12398;&#12391;&#12377;&#12290;Phil Crosby &#27663; &#12392; Andrei Loskutov &#27663;&#12399;&#12289;&#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#37325;&#35201;&#12394;&#25913;&#33391;&#12395;&#36002;&#29486;&#12375;&#12414;&#12375;&#12383;&#12290;</p><div class="sect1" title="1. &#24517;&#35201;&#26465;&#20214;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1604"></a>1. &#24517;&#35201;&#26465;&#20214;</h2></div></div></div><p><span class="application">FindBugs</span> Eclipse Plugin &#12434;&#20351;&#29992;&#12377;&#12427;&#12383;&#12417;&#12395;&#12399;&#12289; Eclipse 3.3 &#12354;&#12427;&#12356;&#12399;&#12381;&#12428;&#20197;&#38477;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12289;&#12414;&#12383;&#12289; JRE/JDK 1.5 &#12354;&#12427;&#12356;&#12399;&#12381;&#12428;&#20197;&#38477;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12364;&#24517;&#35201;&#12391;&#12377;&#12290;</p></div><div class="sect1" title="2. &#12452;&#12531;&#12473;&#12488;&#12540;&#12523;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1611"></a>2. &#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</h2></div></div></div><p>&#26356;&#26032;&#12469;&#12452;&#12488;&#12364;&#25552;&#20379;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;&#26356;&#26032;&#12469;&#12452;&#12488;&#12434;&#21033;&#29992;&#12375;&#12390;&#12289;&#27231;&#26800;&#30340;&#12395; FindBugs &#12434; Eclipse &#12395;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12383;&#33258;&#21205;&#30340;&#12395;&#12289;&#26368;&#26032;&#29256;&#12398;&#12450;&#12483;&#12503;&#12487;&#12540;&#12488;&#12434;&#29031;&#20250;&#12375;&#12390;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12414;&#12377;&#12290;&#20869;&#23481;&#12398;&#30064;&#12394;&#12427; 3 &#12388;&#12398;&#26356;&#26032;&#12469;&#12452;&#12488;&#12364;&#23384;&#22312;&#12375;&#12414;&#12377;&#12290;</p><div class="variablelist" title="FindBugs Eclipse &#26356;&#26032;&#12469;&#12452;&#12488;&#19968;&#35239;"><p class="title"><b>FindBugs Eclipse &#26356;&#26032;&#12469;&#12452;&#12488;&#19968;&#35239;</b></p><dl><dt><span class="term"><a class="ulink" href="http://findbugs.cs.umd.edu/eclipse/" target="_top">http://findbugs.cs.umd.edu/eclipse/</a></span></dt><dd><p>FindBugs &#12398;&#20844;&#24335;&#12522;&#12522;&#12540;&#12473;&#29289;&#12434;&#25552;&#20379;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><a class="ulink" href="http://findbugs.cs.umd.edu/eclipse-candidate/" target="_top">http://findbugs.cs.umd.edu/eclips-candidate/</a></span></dt><dd><p>FindBugs&#12398;&#20844;&#24335;&#12522;&#12522;&#12540;&#12473;&#29289;&#12395;&#21152;&#12360;&#12390;&#12289;&#20844;&#24335;&#12522;&#12522;&#12540;&#12473;&#20505;&#35036;&#29256;&#12434;&#25552;&#20379;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><a class="ulink" href="http://findbugs.cs.umd.edu/eclipse-daily/" target="_top">http://findbugs.cs.umd.edu/eclipse-daily/</a></span></dt><dd><p>FindBugs&#12398;&#26085;&#27425;&#12499;&#12523;&#12489;&#29289;&#12434;&#25552;&#20379;&#12375;&#12414;&#12377;&#12290;&#12467;&#12531;&#12497;&#12452;&#12523;&#12364;&#12391;&#12365;&#12427;&#12371;&#12392;&#20197;&#19978;&#12398;&#12486;&#12473;&#12488;&#12399;&#34892;&#12431;&#12428;&#12390;&#12356;&#12414;&#12379;&#12435;&#12290;</p></dd></dl></div><p>&#12414;&#12383;&#12289;&#27425;&#12395;&#31034;&#12377;&#12522;&#12531;&#12463;&#12363;&#12425;&#25163;&#21205;&#12391;&#12503;&#12521;&#12464;&#12452;&#12531;&#12434;&#12480;&#12454;&#12531;&#12525;&#12540;&#12489;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12414;&#12377; : <a class="ulink" href="http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122.zip?download" target="_top">http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122.zip?download</a>. &#23637;&#38283;&#12375;&#12390; Eclipse &#12398;&#12300;plugins&#12301;&#12469;&#12502;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12395;&#20837;&#12428;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;(&#12381;&#12358;&#12377;&#12427;&#12392;&#12289; &lt;eclipse &#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540; &gt;/plugins/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122/findbugs.png &#12364; <span class="application">FindBugs</span> &#12398;&#12525;&#12468;&#12501;&#12449;&#12452;&#12523;&#12408;&#12398;&#12497;&#12473;&#12395;&#12394;&#12427;&#12399;&#12378;&#12391;&#12377;&#12290;)</p><p>&#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#23637;&#38283;&#12364;&#12391;&#12365;&#12383;&#12425;&#12289; Eclipse &#12434;&#36215;&#21205;&#12375;&#12390; <span class="guimenu">Help</span> &#8594; <span class="guimenuitem">About Eclipse Platform</span> &#8594; <span class="guimenuitem">Plug-in Details</span> &#12434;&#36984;&#25246;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12300;FindBugs Project&#12301;&#12363;&#12425;&#25552;&#20379;&#12373;&#12428;&#12383;&#12300;FindBugs Plug-in&#12301;&#12392;&#12356;&#12358;&#12503;&#12521;&#12464;&#12452;&#12531;&#12364;&#12354;&#12427;&#12371;&#12392;&#12434;&#30906;&#35469;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></div><div class="sect1" title="3. &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1658"></a>3. &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;</h2></div></div></div><p>&#23455;&#34892;&#12377;&#12427;&#12395;&#12399;&#12289; Java &#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#19978;&#12391;&#21491;&#12463;&#12522;&#12483;&#12463;&#12375;&#12390;&#12300;Find Bugs&#12301;&#12434;&#36984;&#25246;&#12375;&#12414;&#12377;&#12290;<span class="application">FindBugs</span> &#12364;&#23455;&#34892;&#12373;&#12428;&#12390;&#12289;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#12398;&#23455;&#20363;&#12398;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12392;&#35672;&#21029;&#12373;&#12428;&#12383;&#12467;&#12540;&#12489;&#31623;&#25152;&#12395;&#21839;&#38988;&#12510;&#12540;&#12459;&#12540;&#12364;&#12388;&#12365;&#12414;&#12377;&#12290; (&#12477;&#12540;&#12473;&#30011;&#38754;&#12362;&#12424;&#12403; Eclipse &#21839;&#38988;&#12499;&#12517;&#12540;&#12395;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;)</p><p>Java &#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12480;&#12452;&#12450;&#12525;&#12464;&#12434;&#38283;&#12356;&#12390;&#12300;Findbugs&#12301;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12506;&#12540;&#12472;&#12434;&#36984;&#25246;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289; <span class="application">FindBugs</span> &#12398;&#21205;&#20316;&#12434;&#12459;&#12473;&#12479;&#12510;&#12452;&#12474;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#36984;&#25246;&#12391;&#12365;&#12427;&#38917;&#30446;&#12395;&#12399;&#27425;&#12398;&#12424;&#12358;&#12394;&#12418;&#12398;&#12364;&#12354;&#12426;&#12414;&#12377; :</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>&#12300;Run FindBugs Automatically&#12301;&#12481;&#12455;&#12483;&#12463;&#12508;&#12483;&#12463;&#12473;&#12398;&#35373;&#23450;&#12290;&#12481;&#12455;&#12483;&#12463;&#12377;&#12427;&#12392;&#12289;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#20869;&#12398; Java &#12463;&#12521;&#12473;&#12364;&#20462;&#27491;&#12373;&#12428;&#12427;&#12383;&#12403;&#12395; FindBugs &#12364;&#23455;&#34892;&#12373;&#12428;&#12414;&#12377;&#12290;</p></li><li class="listitem"><p>&#20778;&#20808;&#24230;&#12392;&#12496;&#12464;&#12459;&#12486;&#12468;&#12522;&#12540;&#12398;&#36984;&#25246;&#12290;&#12371;&#12428;&#12425;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399;&#12289;&#12393;&#12398;&#35686;&#21578;&#12434;&#34920;&#31034;&#12377;&#12427;&#12363;&#12434;&#36984;&#25246;&#12375;&#12414;&#12377;&#12290;&#20363;&#12360;&#12400;&#12289;&#20778;&#20808;&#24230;&#12391; &#12300;Medium&#12301; &#12434;&#36984;&#25246;&#12377;&#12427;&#12392;&#12289;&#20778;&#20808;&#24230; (&#20013;) &#12362;&#12424;&#12403;&#20778;&#20808;&#24230; (&#39640;) &#12398;&#35686;&#21578;&#12398;&#12415;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;&#21516;&#27096;&#12395;&#12289;&#12300;Style&#12301;&#12481;&#12455;&#12483;&#12463;&#12508;&#12483;&#12463;&#12473;&#12398;&#12481;&#12455;&#12483;&#12463;&#12510;&#12540;&#12463;&#12434;&#22806;&#12377;&#12392;&#12289;Style &#12459;&#12486;&#12468;&#12522;&#12540;&#12395;&#23646;&#12377;&#12427;&#35686;&#21578;&#12399;&#34920;&#31034;&#12373;&#12428;&#12414;&#12379;&#12435;&#12290;</p></li><li class="listitem"><p>&#12487;&#12451;&#12486;&#12463;&#12479;&#12398;&#36984;&#25246;&#12290;&#34920;&#12363;&#12425;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12391;&#26377;&#21177;&#12395;&#12375;&#12383;&#12356;&#12487;&#12451;&#12486;&#12463;&#12479;&#12434;&#36984;&#25246;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></li></ul></div></div><div class="sect1" title="4. &#12488;&#12521;&#12502;&#12523;&#12471;&#12517;&#12540;&#12486;&#12451;&#12531;&#12464;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1681"></a>4. &#12488;&#12521;&#12502;&#12523;&#12471;&#12517;&#12540;&#12486;&#12451;&#12531;&#12464;</h2></div></div></div><p><span class="application">FindBugs</span> Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12399;&#12289;&#12414;&#12384;&#23455;&#39443;&#27573;&#38542;&#12391;&#12377;&#12290;&#12371;&#12398;&#12475;&#12463;&#12471;&#12519;&#12531;&#12391;&#12399;&#12289;&#12503;&#12521;&#12464;&#12452;&#12531;&#12395;&#38306;&#12377;&#12427;&#19968;&#33324;&#30340;&#12394;&#21839;&#38988;&#12392; (&#21028;&#26126;&#12375;&#12390;&#12356;&#12428;&#12400;) &#12381;&#12428;&#12425;&#12398;&#21839;&#38988;&#12398;&#35299;&#27770;&#26041;&#27861;&#12434;&#35352;&#36848;&#12375;&#12414;&#12377;&#12290;</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="application">FindBugs</span> &#21839;&#38988;&#12510;&#12540;&#12459;&#12540;&#12364; (&#12477;&#12540;&#12473;&#30011;&#38754;&#12362;&#12424;&#12403;&#21839;&#38988;&#12499;&#12517;&#12540;&#12395;) &#34920;&#31034;&#12373;&#12428;&#12394;&#12356;&#22580;&#21512;&#12399;&#12289;&#21839;&#38988;&#12499;&#12517;&#12540;&#12398;&#12501;&#12451;&#12523;&#12479;&#12540;&#35373;&#23450;&#12434;&#22793;&#26356;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#35443;&#32048;&#24773;&#22577;&#12399; <a class="ulink" href="http://findbugs.sourceforge.net/FAQ.html#q7" target="_top">http://findbugs.sourceforge.net/FAQ.html#q7</a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="anttask.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="filter.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;6&#31456; <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</td></tr></table></div></body></html>
doc/ja/manual/example-code.png less more
Binary diff not shown
doc/ja/manual/example-details.png less more
Binary diff not shown
doc/ja/manual/example.png less more
Binary diff not shown
+0
-168
doc/ja/manual/filter.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="eclipse.html" title="&#31532;7&#31456; FindBugs&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;"><link rel="next" href="analysisprops.html" title="&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="eclipse.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="analysisprops.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;"><div class="titlepage"><div><div><h2 class="title"><a name="filter"></a>&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="filter.html#d0e1709">1. &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#12398;&#27010;&#35201;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e1759">2. &#12510;&#12483;&#12481;&#12531;&#12464;&#26465;&#20214;&#12398;&#31278;&#39006;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e1958">3. Java &#35201;&#32032;&#21517;&#12510;&#12483;&#12481;&#12531;&#12464;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e1982">4. &#30041;&#24847;&#20107;&#38917;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2012">5. &#20363;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2065">6. &#23436;&#20840;&#12394;&#20363;</a></span></dt></dl></div><p>&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#29305;&#23450;&#12398;&#12463;&#12521;&#12473;&#12420;&#12513;&#12477;&#12483;&#12489;&#12434;&#12496;&#12464;&#22577;&#21578;&#12395;&#21547;&#12417;&#12383;&#12426;&#12496;&#12464;&#22577;&#21578;&#12363;&#12425;&#38500;&#22806;&#12375;&#12383;&#12426;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12371;&#12398;&#31456;&#12391;&#12399;&#12289;&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#12398;&#20351;&#29992;&#26041;&#27861;&#12434;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;</p><div class="note" title="&#35336;&#30011;&#12373;&#12428;&#12390;&#12356;&#12427;&#27231;&#33021;" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note: &#35336;&#30011;&#12373;&#12428;&#12390;&#12356;&#12427;&#27231;&#33021;"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[&#27880;&#35352;]" src="note.png"></td><th align="left">&#35336;&#30011;&#12373;&#12428;&#12390;&#12356;&#12427;&#27231;&#33021;</th></tr><tr><td align="left" valign="top"><p>&#12501;&#12451;&#12523;&#12479;&#12540;&#12399;&#29694;&#22312;&#12289;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12391;&#12398;&#12415;&#12469;&#12509;&#12540;&#12488;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;&#26368;&#32066;&#30340;&#12395;&#12399;&#12289;&#12501;&#12451;&#12523;&#12479;&#12540;&#12398;&#12469;&#12509;&#12540;&#12488;&#12399; GUI &#12395;&#12418;&#36861;&#21152;&#12373;&#12428;&#12427;&#20104;&#23450;&#12391;&#12377;&#12290;</p></td></tr></table></div><p>
3 </p><div class="sect1" title="1. &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#12398;&#27010;&#35201;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1709"></a>1. &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#12398;&#27010;&#35201;</h2></div></div></div><p>&#27010;&#24565;&#30340;&#12395;&#35328;&#12360;&#12400;&#12289;&#12501;&#12451;&#12523;&#12479;&#12540;&#12399;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12434;&#12354;&#12427;&#22522;&#28310;&#12392;&#29031;&#21512;&#12375;&#12414;&#12377;&#12290;&#12501;&#12451;&#12523;&#12479;&#12540;&#12434;&#23450;&#32681;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289; &#29305;&#21029;&#12394;&#21462;&#12426;&#25201;&#12356;&#12434;&#12377;&#12427;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12434;&#36984;&#25246;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#20363;&#12360;&#12400;&#12289;&#12354;&#12427;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12434;&#12496;&#12464;&#22577;&#21578;&#12395;&#21547;&#12417;&#12383;&#12426;&#12289;&#12496;&#12464;&#22577;&#21578;&#12363;&#12425;&#38500;&#22806;&#12375;&#12383;&#12426;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><p>&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#12399;&#12289; <a class="ulink" href="http://www.w3.org/XML/" target="_top">XML</a> &#25991;&#26360;&#12391;&#12377;&#12290;&#26368;&#19978;&#20301;&#35201;&#32032;&#12364;&#12288;<code class="literal">FindBugsFilter</code> &#35201;&#32032; &#12391;&#12354;&#12426;&#12289;&#12381;&#12398;&#23376;&#35201;&#32032;&#12392;&#12375;&#12390; <code class="literal">Match</code> &#35201;&#32032;&#12434;&#35079;&#25968;&#20491;&#23450;&#32681;&#12375;&#12414;&#12377;&#12290;&#12381;&#12428;&#12382;&#12428;&#12398; <code class="literal">Match</code> &#35201;&#32032;&#12399;&#12289;&#29983;&#25104;&#12373;&#12428;&#12383;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12395;&#36969;&#29992;&#12373;&#12428;&#12427;&#36848;&#37096;&#12395;&#12354;&#12383;&#12426;&#12414;&#12377;&#12290;&#36890;&#24120;&#12289;&#12501;&#12451;&#12523;&#12479;&#12540;&#12399;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12434;&#38500;&#22806;&#12377;&#12427;&#12383;&#12417;&#12395;&#20351;&#29992;&#12375;&#12414;&#12377;&#12290;&#27425;&#12395;&#12289;&#20363;&#12434;&#31034;&#12375;&#12414;&#12377;:</p><pre class="screen">
4 <code class="prompt">$ </code><span class="command"><strong>findbugs -textui -exclude <em class="replaceable"><code>myExcludeFilter.xml</code></em> <em class="replaceable"><code>myApp.jar</code></em></strong></span>
5 </pre><p>&#12414;&#12383;&#19968;&#26041;&#12391;&#12289;&#30340;&#12434;&#12375;&#12412;&#12387;&#12383;&#22577;&#21578;&#12434;&#24471;&#12427;&#12383;&#12417;&#12395;&#12496;&#12464;&#22577;&#21578;&#32080;&#26524;&#12434;&#36984;&#25246;&#12377;&#12427;&#12383;&#12417;&#12395;&#12501;&#12451;&#12523;&#12479;&#12540;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12418;&#32771;&#12360;&#12425;&#12428;&#12414;&#12377; :</p><pre class="screen">
6 <code class="prompt">$ </code><span class="command"><strong>findbugs -textui -include <em class="replaceable"><code>myIncludeFilter.xml</code></em> <em class="replaceable"><code>myApp.jar</code></em></strong></span>
7 </pre><p>
8 </p><p>
9 <code class="literal">Match</code> &#35201;&#32032;&#12399;&#23376;&#35201;&#32032;&#12434;&#25345;&#12385;&#12414;&#12377;&#12290;&#12381;&#12428;&#12425;&#12398;&#23376;&#35201;&#32032;&#12399;&#35542;&#29702;&#31309;&#12391;&#36848;&#37096;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12388;&#12414;&#12426;&#12289;&#36848;&#37096;&#12364;&#30495;&#12391;&#12354;&#12427;&#12383;&#12417;&#12395;&#12399;&#12289;&#12377;&#12409;&#12390;&#12398;&#23376;&#35201;&#32032;&#12364;&#30495;&#12391;&#12354;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p></div><div class="sect1" title="2. &#12510;&#12483;&#12481;&#12531;&#12464;&#26465;&#20214;&#12398;&#31278;&#39006;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1759"></a>2. &#12510;&#12483;&#12481;&#12531;&#12464;&#26465;&#20214;&#12398;&#31278;&#39006;</h2></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="literal">&lt;Bug&gt;</code></span></dt><dd><p>&#12371;&#12398;&#35201;&#32032;&#12399;&#12289;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#12434;&#25351;&#23450;&#12375;&#12390;&#29031;&#21512;&#12375;&#12414;&#12377;&#12290;<code class="literal">pattern</code> &#23646;&#24615;&#12395;&#12399;&#12289;&#12467;&#12531;&#12510;&#21306;&#20999;&#12426;&#12391;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#39006;&#22411;&#12398;&#12522;&#12473;&#12488;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12393;&#12398;&#35686;&#21578;&#12364;&#12393;&#12398;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#39006;&#22411;&#12395;&#12354;&#12383;&#12427;&#12363;&#12399;&#12289; <span class="command"><strong>-xml</strong></span> &#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#12388;&#12363;&#12387;&#12390;&#20986;&#21147;&#12373;&#12428;&#12383;&#12418;&#12398; (<code class="literal">BugInstance</code> &#35201;&#32032;&#12398; <code class="literal">type</code> &#23646;&#24615;) &#12434;&#35211;&#12427;&#12363;&#12289;&#12414;&#12383;&#12399;&#12289; <a class="ulink" href="../../bugDescriptions.html" target="_top">&#12496;&#12464;&#35299;&#35500;&#12489;&#12461;&#12517;&#12513;&#12531;&#12488;</a>&#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p><p>&#12418;&#12387;&#12392;&#31890;&#24230;&#12398;&#31895;&#12356;&#29031;&#21512;&#12434;&#34892;&#12356;&#12383;&#12356;&#12392;&#12365;&#12399;&#12289; <code class="literal">code</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12496;&#12464;&#30053;&#31216;&#12398;&#12467;&#12531;&#12510;&#21306;&#20999;&#12426;&#12398;&#12522;&#12473;&#12488;&#12391;&#25351;&#23450;&#12391;&#12365;&#12414;&#12377;&#12290;&#12373;&#12425;&#12395;&#31890;&#24230;&#12398;&#31895;&#12356;&#29031;&#21512;&#12434;&#34892;&#12356;&#12383;&#12356;&#12392;&#12365;&#12399;&#12289; <code class="literal">category</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#27425;&#12395;&#31034;&#12377;&#12289;&#12496;&#12464;&#12459;&#12486;&#12468;&#12522;&#12540;&#21517;&#12398;&#12467;&#12531;&#12510;&#21306;&#20999;&#12426;&#12398;&#12522;&#12473;&#12488;&#12391;&#25351;&#23450;&#12391;&#12365;&#12414;&#12377; : <code class="literal">CORRECTNESS</code>, <code class="literal">MT_CORRECTNESS</code>, <code class="literal">BAD_PRACTICICE</code>, <code class="literal">PERFORMANCE</code>, <code class="literal">STYLE</code>.</p><p>&#21516;&#12376; <code class="literal">&lt;Bug&gt;</code> &#35201;&#32032;&#12395;&#19978;&#35352;&#12398;&#23646;&#24615;&#12434;&#35079;&#25968;&#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12399;&#12289;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#21517;&#12289;&#12496;&#12464;&#30053;&#31216;&#12289;&#12496;&#12464;&#12459;&#12486;&#12468;&#12522;&#12540;&#12398;&#12356;&#12378;&#12428;&#12363;1&#12388;&#12391;&#12418;&#35442;&#24403;&#12377;&#12428;&#12400;&#12289;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#12399;&#21512;&#33268;&#12377;&#12427;&#12392;&#21028;&#23450;&#12373;&#12428;&#12414;&#12377;&#12290;</p><p>&#19979;&#20301;&#20114;&#25563;&#24615;&#12434;&#25345;&#12383;&#12379;&#12383;&#12356;&#22580;&#21512;&#12399;&#12289; <code class="literal">&lt;Bug&gt;</code> &#35201;&#32032;&#12398;&#20195;&#12431;&#12426;&#12395; <code class="literal">&lt;BugPattern&gt;</code> &#35201;&#32032;&#12362;&#12424;&#12403; <code class="literal">&lt;BugCode&gt;</code> &#35201;&#32032;&#12434;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12371;&#12428;&#12425;&#12398;&#35201;&#32032;&#12399;&#12381;&#12428;&#12382;&#12428;&#12289; <code class="literal">name</code> &#23646;&#24615;&#12391;&#20516;&#12398;&#12522;&#12473;&#12488;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12371;&#12428;&#12425;&#12398;&#35201;&#32032;&#12399;&#12289;&#23558;&#26469;&#12469;&#12509;&#12540;&#12488;&#12373;&#12428;&#12394;&#12367;&#12394;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">&lt;Priority&gt;</code></span></dt><dd><p>&#12371;&#12398;&#35201;&#32032;&#12399;&#12289;&#29305;&#23450;&#12398;&#20778;&#20808;&#24230;&#12434;&#12418;&#12388;&#35686;&#21578;&#12434;&#29031;&#21512;&#12375;&#12414;&#12377;&#12290;<code class="literal">value</code> &#23646;&#24615;&#12395;&#12399;&#12289;&#25972;&#25968;&#20516;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377; : 1 &#12399;&#20778;&#20808;&#24230;(&#39640;)&#12289;&#12414;&#12383;&#12289; 2 &#12399;&#20778;&#20808;&#24230;(&#20013;) &#12289; 3 &#12399;&#20778;&#20808;&#24230;(&#20302;) &#12434;&#31034;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">&lt;Package&gt;</code></span></dt><dd><p>&#12371;&#12398;&#35201;&#32032;&#12399;&#12289; <code class="literal">name</code> &#23646;&#24615;&#12391;&#25351;&#23450;&#12375;&#12383;&#29305;&#23450;&#12398;&#12497;&#12483;&#12465;&#12540;&#12472;&#20869;&#12395;&#12354;&#12427;&#12463;&#12521;&#12473;&#12395;&#38306;&#36899;&#12375;&#12383;&#35686;&#21578;&#12434;&#29031;&#21512;&#12375;&#12414;&#12377;&#12290;&#20837;&#12428;&#23376;&#12398;&#12497;&#12483;&#12465;&#12540;&#12472;&#12399;&#21547;&#12414;&#12428;&#12414;&#12379;&#12435; (Java import &#25991;&#12395;&#24467;&#12387;&#12390;&#12356;&#12414;&#12377;) &#12290;&#12375;&#12363;&#12375;&#12394;&#12364;&#12425;&#12289;&#27491;&#35215;&#34920;&#29694;&#12434;&#20351;&#12358;&#12392;&#35079;&#25968;&#12497;&#12483;&#12465;&#12540;&#12472;&#12395;&#12510;&#12483;&#12481;&#12373;&#12379;&#12427;&#12371;&#12392;&#12399;&#31777;&#21336;&#12395;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">&lt;Class&gt;</code></span></dt><dd><p>&#12371;&#12398;&#35201;&#32032;&#12399;&#12289;&#29305;&#23450;&#12398;&#12463;&#12521;&#12473;&#12395;&#38306;&#36899;&#12375;&#12383;&#35686;&#21578;&#12434;&#29031;&#21512;&#12375;&#12414;&#12377;&#12290;<code class="literal">name</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12375;&#12390;&#12289;&#29031;&#21512;&#12377;&#12427;&#12463;&#12521;&#12473;&#21517;&#12434;&#12463;&#12521;&#12473;&#21517;&#12381;&#12398;&#12418;&#12398;&#12363;&#12289;&#12414;&#12383;&#12399;&#12289;&#27491;&#35215;&#34920;&#29694;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p><p>&#19979;&#20301;&#20114;&#25563;&#24615;&#12434;&#25345;&#12383;&#12379;&#12383;&#12356;&#22580;&#21512;&#12399;&#12289;&#12371;&#12398;&#35201;&#32032;&#12398;&#20195;&#12431;&#12426;&#12395; <code class="literal">Match</code> &#35201;&#32032;&#12434;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12463;&#12521;&#12473;&#21517;&#12381;&#12398;&#12418;&#12398;&#12398;&#25351;&#23450;&#12399; <code class="literal">class</code> &#23646;&#24615;&#12434;&#12289;&#12463;&#12521;&#12473;&#21517;&#12434;&#27491;&#35215;&#34920;&#29694;&#12391;&#25351;&#23450;&#12377;&#12427;&#22580;&#21512;&#12399; <code class="literal">classregex</code> &#23646;&#24615;&#12434;&#12381;&#12428;&#12382;&#12428;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;</p><p>&#12418;&#12375; <code class="literal">Match</code> &#35201;&#32032;&#12395; <code class="literal">Class</code> &#35201;&#32032;&#12364;&#28961;&#12363;&#12387;&#12383;&#12426;&#12289; <code class="literal">class</code> / <code class="literal">classregex</code> &#23646;&#24615;&#12364;&#28961;&#12363;&#12387;&#12383;&#12426;&#12375;&#12383;&#22580;&#21512;&#12399;&#12289;&#12377;&#12409;&#12390;&#12398;&#12463;&#12521;&#12473;&#12395;&#36969;&#29992;&#12373;&#12428;&#12414;&#12377;&#12290;&#12381;&#12398;&#22580;&#21512;&#12289;&#24819;&#23450;&#22806;&#12395;&#22810;&#12367;&#12398;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12364;&#19968;&#33268;&#12375;&#12390;&#12375;&#12414;&#12358;&#12371;&#12392;&#12364;&#12354;&#12426;&#24471;&#12414;&#12377;&#12290;&#12381;&#12398;&#22580;&#21512;&#12399;&#12289;&#36969;&#24403;&#12394;&#12513;&#12477;&#12483;&#12489;&#12420;&#12501;&#12451;&#12540;&#12523;&#12489;&#12391;&#32094;&#12426;&#36796;&#12435;&#12391;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><code class="literal">&lt;Method&gt;</code></span></dt><dd><p>&#12371;&#12398;&#35201;&#32032;&#12399;&#12289;&#12513;&#12477;&#12483;&#12489;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<code class="literal">name</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12375;&#12390;&#12289;&#29031;&#21512;&#12377;&#12427;&#12513;&#12477;&#12483;&#12489;&#21517;&#12434;&#12513;&#12477;&#12483;&#12489;&#21517;&#12381;&#12398;&#12418;&#12398;&#12363;&#12289;&#12414;&#12383;&#12399;&#12289;&#27491;&#35215;&#34920;&#29694;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<code class="literal">params</code> &#23646;&#24615;&#12395;&#12399;&#12289;&#12467;&#12531;&#12510;&#21306;&#20999;&#12426;&#12391;&#12513;&#12477;&#12483;&#12489;&#24341;&#25968;&#12398;&#22411;&#12398;&#12522;&#12473;&#12488;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<code class="literal">returns</code> &#23646;&#24615;&#12395;&#12399;&#12513;&#12477;&#12483;&#12489;&#12398;&#25147;&#12426;&#20516;&#12398;&#22411;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<code class="literal">params</code> &#12362;&#12424;&#12403; <code class="literal">returns</code> &#12395;&#12362;&#12356;&#12390;&#12399;&#12289;&#12463;&#12521;&#12473;&#21517;&#12399;&#23436;&#20840;&#20462;&#39166;&#21517;&#12391;&#12354;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;(&#20363;&#12360;&#12400;&#12289;&#21336;&#12395; "String" &#12391;&#12399;&#12394;&#12367; "java.lang.String" &#12392;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;) <code class="literal">params</code> <code class="literal">returns</code> &#12398;&#12393;&#12385;&#12425;&#12363;&#19968;&#26041;&#12434;&#25351;&#23450;&#12375;&#12383;&#22580;&#21512;&#12399;&#12289;&#12418;&#12358;&#19968;&#26041;&#12398;&#23646;&#24615;&#12398;&#25351;&#23450;&#12418;&#24517;&#38920;&#12391;&#12377;&#12290;&#12394;&#12380;&#12394;&#12425;&#12400;&#12289;&#12513;&#12477;&#12483;&#12489;&#12471;&#12464;&#12491;&#12481;&#12515;&#12540;&#12434;&#27083;&#31689;&#12398;&#12383;&#12417;&#12395;&#24517;&#35201;&#12384;&#12363;&#12425;&#12391;&#12377;&#12290;<code class="literal">name</code> &#23646;&#24615;&#12289;<code class="literal">params</code> &#23646;&#24615; &#12362;&#12424;&#12403; <code class="literal">returns</code> &#23646;&#24615;&#12414;&#12383;&#12399; 3 &#12388;&#12398; &#23646;&#24615;&#12377;&#12409;&#12390;&#12289;&#12398;&#12393;&#12428;&#12363;&#12434;&#26465;&#20214;&#12392;&#12377;&#12427;&#12371;&#12392;&#12391;&#12365;&#12427;&#12371;&#12392;&#12434;&#24847;&#21619;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12371;&#12398;&#12424;&#12358;&#12395;&#12289;&#21517;&#21069;&#12392;&#12471;&#12464;&#12491;&#12481;&#12515;&#12540;&#12395;&#22522;&#12389;&#12367;&#27096;&#12293;&#12394;&#31278;&#39006;&#12398;&#26465;&#20214;&#12434;&#35215;&#23450;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">&lt;Field&gt;</code></span></dt><dd><p>&#12371;&#12398;&#35201;&#32032;&#12399;&#12289;&#12501;&#12451;&#12540;&#12523;&#12489;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<code class="literal">name</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12375;&#12390;&#12289;&#29031;&#21512;&#12377;&#12427;&#12501;&#12451;&#12540;&#12523;&#12489;&#21517;&#12434;&#12501;&#12451;&#12540;&#12523;&#12489;&#21517;&#12381;&#12398;&#12418;&#12398;&#12363;&#12289;&#12414;&#12383;&#12399;&#12289;&#27491;&#35215;&#34920;&#29694;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12414;&#12383;&#12289;&#12501;&#12451;&#12540;&#12523;&#12489;&#12398;&#12471;&#12464;&#12491;&#12481;&#12515;&#12540;&#12395;&#29031;&#12425;&#12375;&#12383;&#12501;&#12451;&#12523;&#12479;&#12522;&#12531;&#12464;&#12434;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290; <code class="literal">type</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12375;&#12390;&#12289;&#12501;&#12451;&#12540;&#12523;&#12489;&#12398;&#22411;&#12434;&#23436;&#20840;&#20462;&#39166;&#21517;&#12391;&#25351;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#21517;&#21069;&#12392;&#12471;&#12464;&#12491;&#12481;&#12515;&#12540;&#12395;&#22522;&#12389;&#12367;&#26465;&#20214;&#12434;&#35215;&#23450;&#12377;&#12427;&#12383;&#12417;&#12395;&#12289;&#12381;&#12398;2&#12388;&#12398;&#23646;&#24615;&#12434;&#20001;&#26041;&#12392;&#12418;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">&lt;Local&gt;</code></span></dt><dd><p>&#12371;&#12398;&#35201;&#32032;&#12399;&#12289;&#12525;&#12540;&#12459;&#12523;&#22793;&#25968;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;<code class="literal">name</code> &#23646;&#24615;&#12434;&#20351;&#29992;&#12375;&#12390;&#12289;&#29031;&#21512;&#12377;&#12427;&#12525;&#12540;&#12459;&#12523;&#22793;&#25968;&#21517;&#12434;&#12525;&#12540;&#12459;&#12523;&#22793;&#25968;&#21517;&#12381;&#12398;&#12418;&#12398;&#12363;&#12289;&#12414;&#12383;&#12399;&#12289;&#27491;&#35215;&#34920;&#29694;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12525;&#12540;&#12459;&#12523;&#22793;&#25968;&#12392;&#12399;&#12289;&#12513;&#12477;&#12483;&#12489;&#20869;&#12391;&#23450;&#32681;&#12375;&#12383;&#22793;&#25968;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><code class="literal">&lt;Or&gt;</code></span></dt><dd><p>&#12371;&#12398;&#35201;&#32032;&#12399;&#12289;&#35542;&#29702;&#21644;&#12392;&#12375;&#12390; <code class="literal">Match</code> &#26465;&#38917;&#12434;&#32080;&#21512;&#12375;&#12414;&#12377;&#12290;&#12377;&#12394;&#12431;&#12385;&#12289;2&#12388;&#12398; <code class="literal">Method</code> &#35201;&#32032;&#12434; <code class="literal">Or</code> &#26465;&#38917;&#12395;&#20837;&#12428;&#12427;&#12371;&#12392;&#12391;&#12289;&#12393;&#12385;&#12425;&#12363;&#19968;&#26041;&#12398;&#12513;&#12477;&#12483;&#12489;&#12391;&#12510;&#12483;&#12481;&#12373;&#12379;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd></dl></div></div><div class="sect1" title="3. Java &#35201;&#32032;&#21517;&#12510;&#12483;&#12481;&#12531;&#12464;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1958"></a>3. Java &#35201;&#32032;&#21517;&#12510;&#12483;&#12481;&#12531;&#12464;</h2></div></div></div><p><code class="literal">Class</code> &#12289; <code class="literal">Method</code> &#12414;&#12383;&#12399; <code class="literal">Field</code> &#12398; <code class="literal">name</code> &#23646;&#24615;&#12364;&#25991;&#23383; ~ &#12391;&#22987;&#12414;&#12387;&#12390;&#12356;&#12427;&#22580;&#21512;&#12399;&#12289;&#23646;&#24615;&#20516;&#12398;&#27531;&#12426;&#12398;&#37096;&#20998;&#12434; Java &#12398;&#27491;&#35215;&#34920;&#29694;&#12392;&#12375;&#12390;&#35299;&#37320;&#12375;&#12414;&#12377;&#12290;&#12381;&#12358;&#12375;&#12390;&#12289;&#24403;&#35442; Java &#35201;&#32032;&#12398;&#21517;&#21069;&#12395;&#23550;&#12375;&#12390;&#12398;&#29031;&#21512;&#12364;&#34892;&#12431;&#12428;&#12414;&#12377;&#12290;</p><p>&#12497;&#12479;&#12540;&#12531;&#12398;&#29031;&#21512;&#12399;&#35201;&#32032;&#12398;&#21517;&#21069;&#20840;&#20307;&#12395;&#23550;&#12375;&#12390;&#34892;&#12431;&#12428;&#12427;&#12371;&#12392;&#12395;&#27880;&#24847;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12381;&#12398;&#12383;&#12417;&#12289;&#37096;&#20998;&#19968;&#33268;&#29031;&#21512;&#12434;&#34892;&#12356;&#12383;&#12356;&#22580;&#21512;&#12399;&#12497;&#12479;&#12540;&#12531;&#25991;&#23383;&#21015;&#12398;&#21069;&#24460;&#12395; .* &#12434;&#20184;&#21152;&#12375;&#12390;&#20351;&#29992;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p><p>&#12497;&#12479;&#12540;&#12531;&#12398;&#27083;&#25991;&#35215;&#21063;&#12395;&#38306;&#12375;&#12390;&#12399;&#12289; <a class="ulink" href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/util/regex/Pattern.html" target="_top"><code class="literal">java.util.regex.Pattern</code></a> &#12398;&#12489;&#12461;&#12517;&#12513;&#12531;&#12488;&#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></div><div class="sect1" title="4. &#30041;&#24847;&#20107;&#38917;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1982"></a>4. &#30041;&#24847;&#20107;&#38917;</h2></div></div></div><p>
10 <code class="literal">Match</code> &#26465;&#38917;&#12399;&#12289;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12395;&#23455;&#38555;&#12395;&#21547;&#12414;&#12428;&#12390;&#12356;&#12427;&#24773;&#22577;&#12395;&#12398;&#12415;&#19968;&#33268;&#12375;&#12414;&#12377;&#12290;&#12377;&#12409;&#12390;&#12398;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12399;&#12463;&#12521;&#12473;&#12434;&#25345;&#12387;&#12390;&#12356;&#12414;&#12377;&#12290;&#12375;&#12383;&#12364;&#12387;&#12390;&#12289;&#19968;&#33324;&#30340;&#12395;&#35328;&#12387;&#12390;&#12289;&#12496;&#12464;&#12434;&#38500;&#22806;&#12377;&#12427;&#12383;&#12417;&#12395;&#12399;&#12463;&#12521;&#12473;&#12434;&#29992;&#12356;&#12390;&#34892;&#12358;&#12392;&#12358;&#12414;&#12367;&#12356;&#12367;&#12371;&#12392;&#12364;&#22810;&#12356;&#12391;&#12377;&#12290;</p><p>&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12398;&#20013;&#12395;&#12399;&#12289;2&#20491;&#20197;&#19978;&#12398;&#12463;&#12521;&#12473;&#12434;&#20445;&#25345;&#12375;&#12390;&#12356;&#12427;&#12418;&#12398;&#12418;&#12354;&#12426;&#12414;&#12377;&#12290;&#20363;&#12360;&#12400;&#12289; DE (dropped exception : &#20363;&#22806;&#12398;&#28961;&#35222;) &#12496;&#12464;&#12399;&#12289; &#20363;&#22806;&#12398;&#28961;&#35222;&#12364;&#30330;&#29983;&#12375;&#12383;&#12513;&#12477;&#12483;&#12489;&#12434;&#25345;&#12387;&#12390;&#12356;&#12427;&#12463;&#12521;&#12473;&#12392;&#12289; &#28961;&#35222;&#12373;&#12428;&#12383;&#20363;&#22806;&#12398;&#22411;&#12434;&#34920;&#12377;&#12463;&#12521;&#12473;&#12398;&#20001;&#26041;&#12434;&#21547;&#12435;&#12384;&#24418;&#12391;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290;<code class="literal">Match</code> &#26465;&#38917;&#12392;&#12399;&#12289; <span class="emphasis"><em>1&#30058;&#30446;</em></span> (&#20027;) &#12398;&#12463;&#12521;&#12473;&#12398;&#12415;&#12364;&#29031;&#21512;&#12373;&#12428;&#12414;&#12377;&#12290;&#12375;&#12383;&#12364;&#12387;&#12390;&#12289;&#20363;&#12360;&#12400;&#12289;&#12463;&#12521;&#12473; "com.foobar.A" &#12289; "com.foobar.B" &#38291;&#12391;&#12398; IC (initialization circularity : &#21021;&#26399;&#21270;&#26178;&#12398;&#20966;&#29702;&#24490;&#29872;) &#12496;&#12464;&#22577;&#21578;&#12434;&#25233;&#27490;&#12375;&#12383;&#12356;&#22580;&#21512;&#12289;&#20197;&#19979;&#12395;&#31034;&#12377;&#12424;&#12358;&#12395; 2&#12388;&#12398; <code class="literal">Match</code> &#26465;&#38917;&#12434;&#20351;&#29992;&#12375;&#12414;&#12377; :</p><pre class="programlisting">
11 &lt;Match&gt;
12 &lt;Class name="com.foobar.A" /&gt;
13 &lt;Bug code="IC" /&gt;
14 &lt;/Match&gt;
15
16 &lt;Match&gt;
17 &lt;Class name="com.foobar.B" /&gt;
18 &lt;Bug code="IC" /&gt;
19 &lt;/Match&gt;
20 </pre><p>&#26126;&#31034;&#30340;&#12395;&#20001;&#26041;&#12398;&#12463;&#12521;&#12473;&#12391;&#29031;&#21512;&#12377;&#12427;&#12371;&#12392;&#12395;&#12424;&#12387;&#12390;&#12289;&#24490;&#29872;&#12375;&#12390;&#12356;&#12427;&#12393;&#12385;&#12425;&#12398;&#12463;&#12521;&#12473;&#12364;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12398; 1 &#30058;&#30446;&#12395;&#12394;&#12387;&#12390;&#12356;&#12427;&#12363;&#12395;&#38306;&#20418;&#12394;&#12367;&#19968;&#33268;&#12373;&#12379;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;(&#12418;&#12385;&#12429;&#12435;&#12371;&#12398;&#26041;&#27861;&#12399;&#12289;&#20966;&#29702;&#24490;&#29872;&#12364; "com.foobar.A" &#12289; "com.foobar.B" &#12395;&#21152;&#12360;&#12390;3&#30058;&#30446;&#12398;&#12463;&#12521;&#12473;&#12418;&#21547;&#12435;&#12391;&#12356;&#12427;&#22580;&#21512;&#12399;&#22259;&#12425;&#12378;&#12418;&#22833;&#25943;&#12375;&#12390;&#12375;&#12414;&#12358;&#24656;&#12428;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;)</p><p>&#22810;&#12367;&#12398;&#31278;&#39006;&#12398;&#12496;&#12464;&#22577;&#21578;&#12399;&#12289;&#33258;&#36523;&#12364;&#20986;&#29694;&#12375;&#12383;&#12513;&#12477;&#12483;&#12489;&#12434;&#22577;&#21578;&#12375;&#12414;&#12377;&#12290;&#12381;&#12428;&#12425;&#12398;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12395;&#23550;&#12375;&#12390;&#12399;&#12289; <code class="literal">Method</code> &#26465;&#38917;&#12434; <code class="literal">Match</code> &#35201;&#32032;&#12395;&#21152;&#12360;&#12427;&#12392;&#26399;&#24453;&#36890;&#12426;&#12398;&#21205;&#20316;&#12434;&#12377;&#12427;&#12391;&#12375;&#12423;&#12358;&#12290;</p></div><div class="sect1" title="5. &#20363;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2012"></a>5. &#20363;</h2></div></div></div><p>1. &#29305;&#23450;&#12398;&#12463;&#12521;&#12473;&#12395;&#23550;&#12377;&#12427;&#12377;&#12409;&#12390;&#12398;&#12496;&#12464;&#22577;&#21578;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;&#12290;</p><pre class="programlisting">
21
22 &lt;Match&gt;
23 &lt;Class name="com.foobar.MyClass" /&gt;
24 &lt;/Match&gt;
25
26 </pre><p>
27
28 </p><p>2. &#12496;&#12464;&#30053;&#31216;&#12434;&#25351;&#23450;&#12375;&#12390;&#12289;&#29305;&#23450;&#12398;&#12463;&#12521;&#12473;&#12395;&#23550;&#12377;&#12427;&#29305;&#23450;&#12398;&#26908;&#26619;&#38917;&#30446;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;&#12290;</p><pre class="programlisting">
29
30 &lt;Match&gt;
31 &lt;Class name="com.foobar.MyClass"/ &gt;
32 &lt;Bug code="DE,UrF,SIC" /&gt;
33 &lt;/Match&gt;
34
35 </pre><p>
36 </p><p>3. &#12496;&#12464;&#30053;&#31216;&#12434;&#25351;&#23450;&#12375;&#12390;&#12289;&#12377;&#12409;&#12390;&#12398;&#12463;&#12521;&#12473;&#12395;&#23550;&#12377;&#12427;&#29305;&#23450;&#12398;&#26908;&#26619;&#38917;&#30446;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;&#12290;</p><pre class="programlisting">
37
38 &lt;Match&gt;
39 &lt;Bug code="DE,UrF,SIC" /&gt;
40 &lt;/Match&gt;
41
42 </pre><p>
43 </p><p>4. &#12496;&#12464;&#12459;&#12486;&#12468;&#12522;&#12540;&#12434;&#25351;&#23450;&#12375;&#12390;&#12289;&#12377;&#12409;&#12390;&#12398;&#12463;&#12521;&#12473;&#12395;&#23550;&#12377;&#12427;&#29305;&#23450;&#12398;&#26908;&#26619;&#38917;&#30446;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;&#12290;</p><pre class="programlisting">
44
45 &lt;Match&gt;
46 &lt;Bug category="PERFORMANCE" /&gt;
47 &lt;/Match&gt;
48
49 </pre><p>
50 </p><p>5. &#12496;&#12464;&#30053;&#31216;&#12434;&#25351;&#23450;&#12375;&#12390;&#12289;&#29305;&#23450;&#12398;&#12463;&#12521;&#12473;&#12398;&#25351;&#23450;&#12373;&#12428;&#12383;&#12513;&#12477;&#12483;&#12489;&#12395;&#23550;&#12377;&#12427;&#29305;&#23450;&#12398;&#12496;&#12464;&#31278;&#21029;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;&#12290;</p><pre class="programlisting">
51
52 &lt;Match&gt;
53 &lt;Class name="com.foobar.MyClass" /&gt;
54 &lt;Or&gt;
55 &lt;Method name="frob" params="int,java.lang.String" returns="void" /&gt;
56 &lt;Method name="blat" params="" returns="boolean" /&gt;
57 &lt;/Or&gt;
58 &lt;Bug code="DC" /&gt;
59 &lt;/Match&gt;
60
61 </pre><p>
62 </p><p>6. &#29305;&#23450;&#12398;&#12513;&#12477;&#12483;&#12489;&#12395;&#23550;&#12377;&#12427;&#29305;&#23450;&#12398;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;&#12290;</p><pre class="programlisting">
63
64 &lt;!-- open stream &#12395;&#38306;&#12377;&#12427;&#35492;&#26908;&#20986;&#12364;&#12354;&#12427;&#12513;&#12477;&#12483;&#12489;&#12290;--&gt;
65 &lt;Match&gt;
66 &lt;Class name="com.foobar.MyClass" /&gt;
67 &lt;Method name="writeDataToFile" /&gt;
68 &lt;Bug pattern="OS_OPEN_STREAM" /&gt;
69 &lt;/Match&gt;
70
71 </pre><p>
72 </p><p>7. &#29305;&#23450;&#12398;&#12513;&#12477;&#12483;&#12489;&#12395;&#23550;&#12377;&#12427;&#29305;&#23450;&#12398;&#20778;&#20808;&#24230;&#12434;&#20184;&#19982;&#12373;&#12428;&#12383;&#29305;&#23450;&#12398;&#12496;&#12464;&#12497;&#12479;&#12540;&#12531;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;&#12290;</p><pre class="programlisting">
73
74 &lt;!-- dead local store (&#20778;&#20808;&#24230; (&#20013;)) &#12395;&#38306;&#12377;&#12427;&#35492;&#26908;&#20986;&#12364;&#12354;&#12427;&#12513;&#12477;&#12483;&#12489;&#12290;--&gt;
75 &lt;Match&gt;
76 &lt;Class name="com.foobar.MyClass" /&gt;
77 &lt;Method name="someMethod" /&gt;
78 &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;
79 &lt;Priority value="2" /&gt;
80 &lt;/Match&gt;
81
82 </pre><p>
83 </p><p>8. AspectJ &#12467;&#12531;&#12497;&#12452;&#12521;&#12540;&#12395;&#12424;&#12387;&#12390;&#24341;&#12365;&#36215;&#12371;&#12373;&#12428;&#12427;&#12510;&#12452;&#12490;&#12540;&#12496;&#12464;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377; (AspectJ &#12398;&#38283;&#30330;&#32773;&#12391;&#12418;&#12394;&#12356;&#38480;&#12426;&#12289;&#12381;&#12428;&#12425;&#12398;&#12496;&#12464;&#12395;&#38306;&#24515;&#12434;&#25345;&#12388;&#12371;&#12392;&#12399;&#12394;&#12356;&#12392;&#32771;&#12360;&#12414;&#12377;)&#12290;</p><pre class="programlisting">
84
85 &lt;Match&gt;
86 &lt;Class name="~.*\$AjcClosure\d+" /&gt;
87 &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;
88 &lt;Method name="run" /&gt;
89 &lt;/Match&gt;
90 &lt;Match&gt;
91 &lt;Bug pattern="UUF_UNUSED_FIELD" /&gt;
92 &lt;Field name="~ajc\$.*" /&gt;
93 &lt;/Match&gt;
94
95 </pre><p>
96 </p><p>9. &#22522;&#30436;&#12467;&#12540;&#12489;&#12398;&#29305;&#23450;&#12398;&#37096;&#20998;&#12395;&#23550;&#12377;&#12427;&#12496;&#12464;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;</p><pre class="programlisting">
97
98 &lt;!-- &#12377;&#12409;&#12390;&#12398;&#12497;&#12483;&#12465;&#12540;&#12472;&#12395;&#12354;&#12427; Messages &#12463;&#12521;&#12473;&#12395;&#23550;&#12377;&#12427; unused fields &#35686;&#21578;&#12395;&#19968;&#33268;&#12290; --&gt;
99 &lt;Match&gt;
100 &lt;Class name="~.*\.Messages" /&gt;
101 &lt;Bug code="UUF" /&gt;
102 &lt;/Match&gt;
103 &lt;!-- &#12377;&#12409;&#12390;&#12398; internal &#12497;&#12483;&#12465;&#12540;&#12472;&#20869;&#12398; mutable statics &#35686;&#21578;&#12395;&#19968;&#33268;&#12290; --&gt;
104 &lt;Match&gt;
105 &lt;Package name="~.*\.internal" /&gt;
106 &lt;Bug code="MS" /&gt;
107 &lt;/Match&gt;
108 &lt;!-- ui &#12497;&#12483;&#12465;&#12540;&#12472;&#38542;&#23652;&#20869;&#12398; anonymoous inner classes &#35686;&#21578;&#12395;&#19968;&#33268;&#12290; --&gt;
109 &lt;Match&gt;
110 &lt;Package name="~com\.foobar\.fooproject\.ui.*" /&gt;
111 &lt;Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" /&gt;
112 &lt;/Match&gt;
113
114 </pre><p>
115 </p><p>10. &#29305;&#23450;&#12398;&#12471;&#12464;&#12491;&#12481;&#12515;&#12540;&#12434;&#25345;&#12388;&#12501;&#12451;&#12540;&#12523;&#12489;&#12414;&#12383;&#12399;&#12513;&#12477;&#12483;&#12489;&#12398;&#12496;&#12464;&#12395;&#19968;&#33268;&#12373;&#12379;&#12414;&#12377;&#12290;</p><pre class="programlisting">
116
117 &lt;!-- &#12377;&#12409;&#12390;&#12398;&#12463;&#12521;&#12473;&#12398; main(String[]) &#12513;&#12477;&#12483;&#12489;&#12395;&#23550;&#12377;&#12427; System.exit(...) usage &#35686;&#21578;&#12395;&#19968;&#33268;&#12290; --&gt;
118 &lt;Match&gt;
119 &lt;Method returns="void" name="main" params="java.lang.String[]" /&gt;
120 &lt;Method pattern="DM_EXIT" /&gt;
121 &lt;/Match&gt;
122 &lt;!-- &#12377;&#12409;&#12390;&#12398;&#12463;&#12521;&#12473;&#12398; com.foobar.DebugInfo &#22411;&#12398;&#12501;&#12451;&#12540;&#12523;&#12489;&#12395;&#23550;&#12377;&#12427; UuF &#35686;&#21578;&#12395;&#19968;&#33268;&#12290; --&gt;
123 &lt;Match&gt;
124 &lt;Field type="com.foobar.DebugInfo" /&gt;
125 &lt;Bug code="UuF" /&gt;
126 &lt;/Match&gt;
127
128 </pre><p>
129
130 </p></div><div class="sect1" title="6. &#23436;&#20840;&#12394;&#20363;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2065"></a>6. &#23436;&#20840;&#12394;&#20363;</h2></div></div></div><pre class="programlisting">
131
132 &lt;FindBugsFilter&gt;
133 &lt;Match&gt;
134 &lt;Class name="com.foobar.ClassNotToBeAnalyzed" /&gt;
135 &lt;/Match&gt;
136
137 &lt;Match&gt;
138 &lt;Class name="com.foobar.ClassWithSomeBugsMatched" /&gt;
139 &lt;Bug code="DE,UrF,SIC" /&gt;
140 &lt;/Match&gt;
141
142 &lt;!-- XYZ &#36949;&#21453;&#12395;&#19968;&#33268;&#12290;--&gt;
143 &lt;Match&gt;
144 &lt;Bug code="XYZ" /&gt;
145 &lt;/Match&gt;
146
147 &lt;!-- "AnotherClass" &#12398;&#29305;&#23450;&#12398;&#12513;&#12477;&#12483;&#12489;&#12398; doublecheck &#36949;&#21453;&#12395;&#19968;&#33268;&#12290;--&gt;
148 &lt;Match&gt;
149 &lt;Class name="com.foobar.AnotherClass" /&gt;
150 &lt;Or&gt;
151 &lt;Method name="nonOverloadedMethod" /&gt;
152 &lt;Method name="frob" params="int,java.lang.String" returns="void" /&gt;
153 &lt;Method name="blat" params="" returns="boolean" /&gt;
154 &lt;/Or&gt;
155 &lt;Bug code="DC" /&gt;
156 &lt;/Match&gt;
157
158 &lt;!-- dead local store (&#20778;&#20808;&#24230; (&#20013;)) &#12395;&#38306;&#12377;&#12427;&#35492;&#26908;&#20986;&#12364;&#12354;&#12427;&#12513;&#12477;&#12483;&#12489;&#12290;--&gt;
159 &lt;Match&gt;
160 &lt;Class name="com.foobar.MyClass" /&gt;
161 &lt;Method name="someMethod" /&gt;
162 &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;
163 &lt;Priority value="2" /&gt;
164 &lt;/Match&gt;
165 &lt;/FindBugsFilter&gt;
166
167 </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="eclipse.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="analysisprops.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;7&#31456; <span class="application">FindBugs</span>&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;</td></tr></table></div></body></html>
+0
-5
doc/ja/manual/gui.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;5&#31456; FindBugs GUI &#12398;&#20351;&#29992;&#26041;&#27861;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="running.html" title="&#31532;4&#31456; FindBugs&#8482; &#12398;&#23455;&#34892;"><link rel="next" href="anttask.html" title="&#31532;6&#31456; FindBugs&#8482; Ant &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;5&#31456; <span class="application">FindBugs</span> GUI &#12398;&#20351;&#29992;&#26041;&#27861;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="running.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="anttask.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;5&#31456; FindBugs GUI &#12398;&#20351;&#29992;&#26041;&#27861;"><div class="titlepage"><div><div><h2 class="title"><a name="gui"></a>&#31532;5&#31456; <span class="application">FindBugs</span> GUI &#12398;&#20351;&#29992;&#26041;&#27861;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="gui.html#d0e1058">1. &#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398;&#20316;&#25104;</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1099">2. &#20998;&#26512;&#12398;&#23455;&#34892;</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1104">3. &#32080;&#26524;&#12398;&#38322;&#35239;</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1119">4. &#20445;&#23384;&#12392;&#35501;&#12415;&#36796;&#12415;</a></span></dt></dl></div><p>&#12371;&#12398;&#31456;&#12391;&#12399;&#12289;<span class="application">FindBugs</span> &#12464;&#12521;&#12501;&#12451;&#12459;&#12523;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473; (GUI) &#12398;&#20351;&#29992;&#26041;&#27861;&#12434;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;</p><div class="sect1" title="1. &#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398;&#20316;&#25104;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1058"></a>1. &#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398;&#20316;&#25104;</h2></div></div></div><p><span class="command"><strong>findbugs</strong></span> &#12467;&#12510;&#12531;&#12489;&#12391; <span class="application">FindBugs</span> &#12434;&#36215;&#21205;&#12375;&#12390;&#12363;&#12425;&#12289;&#12513;&#12491;&#12517;&#12540;&#12391; <span class="guimenu">File</span> &#8594; <span class="guimenuitem">New Project</span> &#12434;&#36984;&#25246;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12381;&#12358;&#12377;&#12427;&#12392;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394;&#12480;&#12452;&#12450;&#12525;&#12464;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;:</p><div class="mediaobject"><img src="project-dialog.png"></div><p>
3 </p><p>&#12300;Class archives and directories to analyze&#12301;&#12486;&#12461;&#12473;&#12488;&#12501;&#12451;&#12540;&#12523;&#12489;&#12398;&#27178;&#12395;&#12354;&#12427; &#12300;Add&#12301;&#12508;&#12479;&#12531;&#12434;&#25276;&#12377;&#12392;&#12289;&#12496;&#12464;&#12434;&#20998;&#26512;&#12377;&#12427; java &#12463;&#12521;&#12473;&#12434;&#21547;&#12435;&#12391;&#12356;&#12427; Java &#12450;&#12540;&#12459;&#12452;&#12502;&#12501;&#12449;&#12452;&#12523; (zip, jar, ear, or war file) &#12434;&#36984;&#25246;&#12375;&#12390;&#25351;&#23450;&#12391;&#12365;&#12414;&#12377;&#12290;&#35079;&#25968;&#12398; &#12450;&#12540;&#12459;&#12452;&#12502;/&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434;&#36861;&#21152;&#12377;&#12427;&#12371;&#12392;&#12364;&#21487;&#33021;&#12391;&#12377;&#12290;</p><p>&#12414;&#12383;&#12289;&#20998;&#26512;&#12434;&#34892;&#12358; Java &#12450;&#12540;&#12459;&#12452;&#12502;&#12398;&#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12434;&#21547;&#12435;&#12384;&#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12414;&#12377;&#12290;&#12381;&#12358;&#12377;&#12427;&#12392;&#12289;&#12496;&#12464;&#12398;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12398;&#22580;&#25152;&#12364;&#12289;<span class="application">FindBugs</span> &#19978;&#12391;&#12495;&#12452;&#12521;&#12452;&#12488;&#12375;&#12390;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;&#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12399;&#12289;Java &#12497;&#12483;&#12465;&#12540;&#12472;&#38542;&#23652;&#12398;&#12523;&#12540;&#12488;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434;&#25351;&#23450;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#20363;&#12360;&#12400;&#12289;&#12518;&#12540;&#12470;&#12398;&#12450;&#12503;&#12522;&#12465;&#12540;&#12471;&#12519;&#12531;&#12364; <code class="varname">org.foobar.myapp</code> &#12497;&#12483;&#12465;&#12540;&#12472;&#12398;&#20013;&#12395;&#12354;&#12427;&#22580;&#21512;&#12399;&#12289; <code class="filename">org</code> &#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12398;&#35242;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434;&#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12522;&#12473;&#12488;&#12395;&#25351;&#23450;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p><p>&#12418;&#12358;&#12402;&#12392;&#12388;&#12289;&#20219;&#24847;&#25351;&#23450;&#12398;&#25163;&#38918;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#12381;&#12428;&#12399;&#12289;&#35036;&#21161;&#29992;&#12398; Jar &#12501;&#12449;&#12452;&#12523;&#12362;&#12424;&#12403;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434; &#12300;Auxiliary classpath locations&#12301;&#12398;&#12456;&#12531;&#12488;&#12522;&#12540;&#12395;&#36861;&#21152;&#12377;&#12427;&#12371;&#12392;&#12391;&#12377;&#12290;&#20998;&#26512;&#12377;&#12427;&#12450;&#12540;&#12459;&#12452;&#12502;/&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12395;&#12418;&#27161;&#28310;&#12398;&#23455;&#34892;&#26178;&#12463;&#12521;&#12473;&#12497;&#12473;&#12395;&#12418;&#21547;&#12414;&#12428;&#12390;&#12356;&#12394;&#12356;&#12463;&#12521;&#12473;&#12434;&#12289;&#20998;&#26512;&#12377;&#12427;&#12450;&#12540;&#12459;&#12452;&#12502;/&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12364;&#21442;&#29031;&#12375;&#12390;&#12356;&#12427;&#22580;&#21512;&#12399;&#12289;&#12371;&#12398;&#38917;&#30446;&#12434;&#35373;&#23450;&#12375;&#12383;&#26041;&#12364;&#12356;&#12356;&#12391;&#12375;&#12423;&#12358;&#12290;&#12463;&#12521;&#12473;&#38542;&#23652;&#12395;&#38306;&#12377;&#12427;&#24773;&#22577;&#12434;&#20351;&#29992;&#12377;&#12427;&#12496;&#12464;&#12487;&#12451;&#12486;&#12463;&#12479;&#12364;&#12289; <span class="application">FindBugs</span> &#12395;&#12399;&#12356;&#12367;&#12388;&#12363;&#12354;&#12426;&#12414;&#12377;&#12290;&#12375;&#12383;&#12364;&#12387;&#12390;&#12289;<span class="application">FindBugs</span> &#12364;&#20998;&#26512;&#12434;&#34892;&#12358;&#12463;&#12521;&#12473;&#12398;&#23436;&#20840;&#12394;&#12463;&#12521;&#12473;&#38542;&#23652;&#12434;&#21442;&#29031;&#12391;&#12365;&#12428;&#12400;&#12289;&#12424;&#12426;&#27491;&#30906;&#12394;&#20998;&#26512;&#32080;&#26524;&#12434;&#21462;&#24471;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></div><div class="sect1" title="2. &#20998;&#26512;&#12398;&#23455;&#34892;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1099"></a>2. &#20998;&#26512;&#12398;&#23455;&#34892;</h2></div></div></div><p>&#12450;&#12540;&#12459;&#12452;&#12502;&#12289;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12362;&#12424;&#12403;&#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12398;&#25351;&#23450;&#12364;&#12391;&#12365;&#12428;&#12400;&#12289;&#12300;Finish&#12301;&#12508;&#12479;&#12531;&#12434;&#25276;&#12375;&#12390; Jar &#12501;&#12449;&#12452;&#12523;&#12395;&#21547;&#12414;&#12428;&#12427;&#12463;&#12521;&#12473;&#12395;&#23550;&#12377;&#12427;&#20998;&#26512;&#12434;&#23455;&#34892;&#12375;&#12414;&#12377;&#12290;&#24040;&#22823;&#12394;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12434;&#21476;&#12356;&#12467;&#12531;&#12500;&#12517;&#12540;&#12479;&#19978;&#12391;&#23455;&#34892;&#12377;&#12427;&#12392;&#12289;&#12363;&#12394;&#12426;&#12398;&#26178;&#38291;(&#25968;&#21313;&#20998;)&#12364;&#12363;&#12363;&#12427;&#12371;&#12392;&#12395;&#27880;&#24847;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#22823;&#23481;&#37327;&#12513;&#12514;&#12522;&#12391;&#12354;&#12427;&#26368;&#36817;&#12398;&#12467;&#12531;&#12500;&#12517;&#12540;&#12479;&#12394;&#12425;&#12289;&#22823;&#12365;&#12394;&#12503;&#12525;&#12464;&#12521;&#12512;&#12391;&#12354;&#12387;&#12390;&#12418;&#25968;&#20998;&#31243;&#24230;&#12391;&#20998;&#26512;&#12391;&#12365;&#12414;&#12377;&#12290;</p></div><div class="sect1" title="3. &#32080;&#26524;&#12398;&#38322;&#35239;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1104"></a>3. &#32080;&#26524;&#12398;&#38322;&#35239;</h2></div></div></div><p>&#20998;&#26512;&#12364;&#23436;&#20102;&#12377;&#12427;&#12392;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394;&#30011;&#38754;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377; :</p><div class="mediaobject"><img src="example-details.png"></div><p>
4 </p><p>&#24038;&#19978;&#12398;&#12506;&#12452;&#12531;&#12395;&#12399;&#12496;&#12464;&#38542;&#23652;&#12484;&#12522;&#12540;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;&#12371;&#12428;&#12399;&#12289;&#20998;&#26512;&#12391;&#12415;&#12388;&#12363;&#12387;&#12383;&#12496;&#12464;&#12398;&#26908;&#32034;&#32080;&#26524;&#12364;&#38542;&#23652;&#30340;&#12395;&#34920;&#31034;&#12373;&#12428;&#12383;&#12418;&#12398;&#12391;&#12377;&#12290;</p><p>&#19978;&#37096;&#12398;&#12506;&#12452;&#12531;&#12391;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12434;&#36984;&#25246;&#12377;&#12427;&#12392;&#12289;&#19979;&#37096;&#12398;&#12300;Details&#12301;&#12506;&#12452;&#12531;&#12395;&#12496;&#12464;&#12398;&#35443;&#32048;&#35500;&#26126;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;&#26356;&#12395;&#12289;&#12477;&#12540;&#12473;&#12364;&#12415;&#12388;&#12363;&#12428;&#12400;&#12289;&#21491;&#19978;&#12398;&#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12506;&#12452;&#12531;&#12395;&#12496;&#12464;&#12398;&#20986;&#29694;&#31623;&#25152;&#12395;&#35442;&#24403;&#12377;&#12427;&#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12364;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;&#19978;&#22259;&#12398;&#20363;&#12391;&#34920;&#31034;&#12373;&#12428;&#12390;&#12356;&#12427;&#12496;&#12464;&#12399;&#12289;&#12473;&#12488;&#12522;&#12540;&#12512;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12364;&#12463;&#12525;&#12540;&#12474;&#12373;&#12428;&#12390;&#12356;&#12394;&#12356;&#12392;&#12356;&#12358;&#12418;&#12398;&#12391;&#12377;&#12290;&#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12539;&#12454;&#12451;&#12531;&#12489;&#12454;&#12395;&#12362;&#12356;&#12390;&#24403;&#35442;&#12473;&#12488;&#12522;&#12540;&#12512;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12434;&#29983;&#25104;&#12375;&#12390;&#12356;&#12427;&#34892;&#12364;&#12495;&#12452;&#12521;&#12452;&#12488;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;</p><p>&#12496;&#12464;&#12398;&#26908;&#32034;&#32080;&#26524;&#12395;&#23550;&#12375;&#12390;&#12486;&#12461;&#12473;&#12488;&#12391;&#27880;&#37320;&#12434;&#20837;&#12428;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#38542;&#23652;&#12484;&#12522;&#12540;&#22259;&#12398;&#12377;&#12368;&#19979;&#12395;&#12354;&#12427;&#12486;&#12461;&#12473;&#12488;&#12508;&#12483;&#12463;&#12473;&#12395;&#27880;&#37320;&#12434;&#20837;&#21147;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#35352;&#37682;&#12375;&#12390;&#12362;&#12365;&#12383;&#12356;&#24773;&#22577;&#12434;&#20309;&#12391;&#12418;&#33258;&#30001;&#12395;&#20837;&#21147;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12496;&#12464;&#32080;&#26524;&#12501;&#12449;&#12452;&#12523;&#12398;&#20445;&#23384;&#12362;&#12424;&#12403;&#35501;&#12415;&#36796;&#12415;&#12434;&#34892;&#12387;&#12383;&#12392;&#12365;&#12395;&#12289;&#27880;&#37320;&#12418;&#20445;&#23384;&#12373;&#12428;&#12414;&#12377;&#12290;</p></div><div class="sect1" title="4. &#20445;&#23384;&#12392;&#35501;&#12415;&#36796;&#12415;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1119"></a>4. &#20445;&#23384;&#12392;&#35501;&#12415;&#36796;&#12415;</h2></div></div></div><p>&#12513;&#12491;&#12517;&#12540;&#38917;&#30446;&#12363;&#12425; <span class="guimenu">File</span> &#8594; <span class="guimenuitem">Save as...</span> &#12434;&#36984;&#25246;&#12377;&#12427;&#12392;&#12289;&#12518;&#12540;&#12470;&#12540;&#12398;&#20316;&#26989;&#32080;&#26524;&#12434;&#20445;&#23384;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12300;Save as...&#12301;&#12480;&#12452;&#12450;&#12525;&#12464;&#12395;&#12354;&#12427;&#12489;&#12525;&#12483;&#12503;&#12480;&#12454;&#12531;&#12539;&#12522;&#12473;&#12488;&#12398;&#20013;&#12363;&#12425;&#12300;FindBugs analysis results (.xml)&#12301;&#12434;&#36984;&#25246;&#12371;&#12392;&#12391;&#12289;&#12518;&#12540;&#12470;&#12540;&#12364;&#25351;&#23450;&#12375;&#12383; jar &#12501;&#12449;&#12452;&#12523;&#12522;&#12473;&#12488;&#12420;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12394;&#12393;&#12398;&#20316;&#26989;&#32080;&#26524;&#12434;&#20445;&#23384;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12414;&#12383;&#12289;jar &#12501;&#12449;&#12452;&#12523;&#12522;&#12473;&#12488;&#12398;&#12415;&#12434;&#20445;&#23384;&#12377;&#12427;&#36984;&#25246;&#32930; (&#12300;FindBugs project file (.fbp)&#12301;) &#12420;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12398;&#12415;&#12434;&#20445;&#23384;&#12377;&#12427;&#36984;&#25246;&#32930; (&#12300;FindBugs analysis file (.fba)&#12301;) &#12418;&#12354;&#12426;&#12414;&#12377;&#12290;&#20445;&#23384;&#12375;&#12383;&#12501;&#12449;&#12452;&#12523;&#12399;&#12289;&#12513;&#12491;&#12517;&#12540;&#38917;&#30446;&#12363;&#12425; <span class="guimenu">File</span> &#8594; <span class="guimenuitem">Open...</span> &#12434;&#36984;&#25246;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#35501;&#12415;&#36796;&#12416;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="running.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="anttask.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;4&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;6&#31456; <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;</td></tr></table></div></body></html>
doc/ja/manual/important.png less more
Binary diff not shown
+0
-3
doc/ja/manual/index.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="next" href="introduction.html" title="&#31532;1&#31456; &#12399;&#12376;&#12417;&#12395;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="application">FindBugs</span>&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="introduction.html">&#27425;&#12408;</a></td></tr></table><hr></div><div lang="ja" class="book" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><div class="titlepage"><div><div><h1 class="title"><a name="findbugs-manual"></a><span class="application">FindBugs</span>&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="surname">Hovemeyer</span> <span class="firstname">David</span> [FAMILY Given]</h3></div><div class="author"><h3 class="author"><span class="surname">Pugh</span> <span class="firstname">William</span> [FAMILY Given]</h3></div></div></div><div><p class="copyright">&#35069;&#20316;&#33879;&#20316; &copy; 2003, 2004, 2005, 2006, 2008 University of Maryland</p></div><div><div class="legalnotice" title="&#27861;&#24459;&#19978;&#12398;&#36890;&#30693;"><a name="d0e35"></a><p>&#12371;&#12398;&#12510;&#12491;&#12517;&#12450;&#12523;&#12399;&#12289;&#12463;&#12522;&#12456;&#12452;&#12486;&#12451;&#12502;&#12539;&#12467;&#12514;&#12531;&#12474;&#34920;&#31034;-&#38750;&#21942;&#21033;-&#32153;&#25215;&#12395;&#22522;&#12389;&#12367;&#20351;&#29992;&#35377;&#35582;&#12364;&#12394;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;&#20351;&#29992;&#35377;&#35582;&#26360;&#12434;&#12372;&#35239;&#12395;&#12394;&#12427;&#22580;&#21512;&#12399;&#12289; <a class="ulink" href="http://creativecommons.org/licenses/by-nc-sa/1.0/deed.ja" target="_top">http://creativecommons.org/licenses/by-nc-sa/1.0/</a> &#12395;&#12450;&#12463;&#12475;&#12473;&#12377;&#12427;&#12363;&#12289;&#12463;&#12522;&#12456;&#12452;&#12486;&#12451;&#12502;&#12539;&#12467;&#12514;&#12531;&#12474;(559 Nathan Abbott Way, Stanford, California 94305, USA)&#12395;&#26360;&#31777;&#12434;&#36865;&#20184;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p><p>&#21517;&#31216;&#12300;FindBugs&#12301;&#12362;&#12424;&#12403; FindBugs &#12398;&#12525;&#12468;&#12399;&#12289;&#12513;&#12522;&#12540;&#12521;&#12531;&#12489;&#22823;&#23398;&#12398;&#30331;&#37682;&#21830;&#27161;&#12391;&#12377;&#12290;</p></div></div><div><p class="pubdate">17:16:15 EST, 22 November, 2013</p></div></div><hr></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="chapter"><a href="introduction.html">1. &#12399;&#12376;&#12417;&#12395;</a></span></dt><dd><dl><dt><span class="sect1"><a href="introduction.html#d0e74">1. &#24517;&#35201;&#26465;&#20214;</a></span></dt></dl></dd><dt><span class="chapter"><a href="installing.html">2. <span class="application">FindBugs</span>&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</a></span></dt><dd><dl><dt><span class="sect1"><a href="installing.html#d0e102">1. &#37197;&#24067;&#29289;&#12398;&#23637;&#38283;</a></span></dt></dl></dd><dt><span class="chapter"><a href="building.html">3. <span class="application">FindBugs</span>&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;</a></span></dt><dd><dl><dt><span class="sect1"><a href="building.html#d0e175">1. &#21069;&#25552;&#26465;&#20214;</a></span></dt><dt><span class="sect1"><a href="building.html#d0e258">2. &#12477;&#12540;&#12473;&#37197;&#24067;&#29289;&#12398;&#23637;&#38283;</a></span></dt><dt><span class="sect1"><a href="building.html#d0e271">3. <code class="filename">local.properties</code> &#12398;&#20462;&#27491;</a></span></dt><dt><span class="sect1"><a href="building.html#d0e326">4. <span class="application">Ant</span> &#12398;&#23455;&#34892;</a></span></dt><dt><span class="sect1"><a href="building.html#d0e420">5. &#12477;&#12540;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12363;&#12425;&#12398; <span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</a></span></dt></dl></dd><dt><span class="chapter"><a href="running.html">4. <span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</a></span></dt><dd><dl><dt><span class="sect1"><a href="running.html#d0e455">1. &#12463;&#12452;&#12483;&#12463;&#12539;&#12473;&#12479;&#12540;&#12488;</a></span></dt><dt><span class="sect1"><a href="running.html#d0e493">2. <span class="application">FindBugs</span> &#12398;&#36215;&#21205;</a></span></dt><dt><span class="sect1"><a href="running.html#commandLineOptions">3. &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</a></span></dt></dl></dd><dt><span class="chapter"><a href="gui.html">5. <span class="application">FindBugs</span> GUI &#12398;&#20351;&#29992;&#26041;&#27861;</a></span></dt><dd><dl><dt><span class="sect1"><a href="gui.html#d0e1058">1. &#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398;&#20316;&#25104;</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1099">2. &#20998;&#26512;&#12398;&#23455;&#34892;</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1104">3. &#32080;&#26524;&#12398;&#38322;&#35239;</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1119">4. &#20445;&#23384;&#12392;&#35501;&#12415;&#36796;&#12415;</a></span></dt></dl></dd><dt><span class="chapter"><a href="anttask.html">6. <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#20351;&#29992;&#26041;&#27861;</a></span></dt><dd><dl><dt><span class="sect1"><a href="anttask.html#d0e1173">1. <span class="application">Ant</span> &#12479;&#12473;&#12463;&#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1209">2. build.xml &#12398;&#26360;&#12365;&#26041;</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1278">3. &#12479;&#12473;&#12463;&#12398;&#23455;&#34892;</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1303">4. &#12497;&#12521;&#12513;&#12540;&#12479;&#12540;</a></span></dt></dl></dd><dt><span class="chapter"><a href="eclipse.html">7. <span class="application">FindBugs</span>&#8482; Eclipse &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;</a></span></dt><dd><dl><dt><span class="sect1"><a href="eclipse.html#d0e1604">1. &#24517;&#35201;&#26465;&#20214;</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1611">2. &#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1658">3. &#12503;&#12521;&#12464;&#12452;&#12531;&#12398;&#20351;&#29992;&#26041;&#27861;</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1681">4. &#12488;&#12521;&#12502;&#12523;&#12471;&#12517;&#12540;&#12486;&#12451;&#12531;&#12464;</a></span></dt></dl></dd><dt><span class="chapter"><a href="filter.html">8. &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</a></span></dt><dd><dl><dt><span class="sect1"><a href="filter.html#d0e1709">1. &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;&#12398;&#27010;&#35201;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e1759">2. &#12510;&#12483;&#12481;&#12531;&#12464;&#26465;&#20214;&#12398;&#31278;&#39006;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e1958">3. Java &#35201;&#32032;&#21517;&#12510;&#12483;&#12481;&#12531;&#12464;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e1982">4. &#30041;&#24847;&#20107;&#38917;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2012">5. &#20363;</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2065">6. &#23436;&#20840;&#12394;&#20363;</a></span></dt></dl></dd><dt><span class="chapter"><a href="analysisprops.html">9. &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;</a></span></dt><dt><span class="chapter"><a href="annotations.html">10. &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;</a></span></dt><dt><span class="chapter"><a href="rejarForAnalysis.html">11. rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;</a></span></dt><dt><span class="chapter"><a href="datamining.html">12. <span class="application">FindBugs</span>&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;</a></span></dt><dd><dl><dt><span class="sect1"><a href="datamining.html#commands">1. &#12467;&#12510;&#12531;&#12489;</a></span></dt><dt><span class="sect1"><a href="datamining.html#examples">2. &#20363;</a></span></dt><dt><span class="sect1"><a href="datamining.html#antexample">3. Ant &#12398;&#20363;</a></span></dt></dl></dd><dt><span class="chapter"><a href="license.html">13. &#12521;&#12452;&#12475;&#12531;&#12473;</a></span></dt><dt><span class="chapter"><a href="acknowledgments.html">14. &#35613;&#36766;</a></span></dt><dd><dl><dt><span class="sect1"><a href="acknowledgments.html#d0e3438">1. &#36002;&#29486;&#32773;</a></span></dt><dt><span class="sect1"><a href="acknowledgments.html#d0e3561">2. &#20351;&#29992;&#12375;&#12390;&#12356;&#12427;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;</a></span></dt></dl></dd></dl></div><div class="list-of-tables"><p><b>&#34920;&#12398;&#19968;&#35239;</b></p><dl><dt>9.1. <a href="analysisprops.html#analysisproptable">&#35373;&#23450;&#21487;&#33021;&#12394;&#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;</a></dt><dt>12.1. <a href="datamining.html#computeBugHistoryTable">computeBugHistory &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</a></dt><dt>12.2. <a href="datamining.html#filterOptionsTable">filterBugs &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</a></dt><dt>12.3. <a href="datamining.html#mineBugHistoryOptionsTable">mineBugHistory &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</a></dt><dt>12.4. <a href="datamining.html#mineBugHistoryColumns">mineBugHistory &#20986;&#21147;&#12398;&#12459;&#12521;&#12512;&#19968;&#35239;</a></dt><dt>12.5. <a href="datamining.html#defectDensityColumns">defectDensity &#20986;&#21147;&#12398;&#12459;&#12521;&#12512;&#19968;&#35239;</a></dt><dt>12.6. <a href="datamining.html#convertXmlToTextTable">convertXmlToText &#12467;&#12510;&#12531;&#12489;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</a></dt><dt>12.7. <a href="datamining.html#setBugDatabaseInfoOptions">setBugDatabaseInfo &#12458;&#12503;&#12471;&#12519;&#12531;&#19968;&#35239;</a></dt><dt>12.8. <a href="datamining.html#listBugDatabaseInfoColumns">listBugDatabaseInfo &#12459;&#12521;&#12512;&#19968;&#35239;</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="introduction.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right" valign="top">&nbsp;&#31532;1&#31456; &#12399;&#12376;&#12417;&#12395;</td></tr></table></div></body></html>
doc/ja/manual/infiniteRecursiveLoops.png less more
Binary diff not shown
+0
-9
doc/ja/manual/installing.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;2&#31456; FindBugs&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="introduction.html" title="&#31532;1&#31456; &#12399;&#12376;&#12417;&#12395;"><link rel="next" href="building.html" title="&#31532;3&#31456; FindBugs&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;2&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="introduction.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="building.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;2&#31456; FindBugs&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;"><div class="titlepage"><div><div><h2 class="title"><a name="installing"></a>&#31532;2&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="installing.html#d0e102">1. &#37197;&#24067;&#29289;&#12398;&#23637;&#38283;</a></span></dt></dl></div><p>&#12371;&#12398;&#31456;&#12391;&#12399;&#12289; <span class="application">FindBugs</span> &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#26041;&#27861;&#12434;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;</p><div class="sect1" title="1. &#37197;&#24067;&#29289;&#12398;&#23637;&#38283;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e102"></a>1. &#37197;&#24067;&#29289;&#12398;&#23637;&#38283;</h2></div></div></div><p><span class="application">FindBugs</span> &#12434;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12377;&#12427;&#26368;&#12418;&#31777;&#21336;&#12394;&#26041;&#27861;&#12399;&#12289;&#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12434;&#12480;&#12454;&#12531;&#12525;&#12540;&#12489;&#12377;&#12427;&#12371;&#12392;&#12391;&#12377;&#12290; &#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12399;&#12289; <a class="ulink" href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.tar.gz?download" target="_top">gzipped tar &#24418;&#24335;</a> &#12362;&#12424;&#12403; <a class="ulink" href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.zip?download" target="_top">zip &#24418;&#24335;</a> &#12364;&#12381;&#12428;&#12382;&#12428;&#20837;&#25163;&#21487;&#33021;&#12391;&#12377;&#12290;&#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12434;&#12480;&#12454;&#12531;&#12525;&#12540;&#12489;&#12375;&#12390;&#12365;&#12383;&#12425;&#12289;&#12381;&#12428;&#12434;&#20219;&#24847;&#12398;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12395;&#23637;&#38283;&#12375;&#12414;&#12377;&#12290;</p><p>gzipped tar &#24418;&#24335;&#37197;&#24067;&#29289;&#12398;&#23637;&#38283;&#26041;&#27861;&#20363;:</p><pre class="screen">
3 <code class="prompt">$ </code><span class="command"><strong>gunzip -c findbugs-2.0.3.tar.gz | tar xvf -</strong></span>
4 </pre><p>
5 </p><p>zip &#24418;&#24335;&#37197;&#24067;&#29289;&#12398;&#23637;&#38283;&#26041;&#27861;&#20363;:</p><pre class="screen">
6 <code class="prompt">C:\Software&gt;</code><span class="command"><strong>unzip findbugs-2.0.3.zip</strong></span>
7 </pre><p>
8 </p><p>&#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12398;&#23637;&#38283;&#12377;&#12427;&#12392;&#12289;&#36890;&#24120;&#12399; <code class="filename">findbugs-2.0.3</code> &#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12364;&#20316;&#25104;&#12373;&#12428;&#12414;&#12377;&#12290;&#20363;&#12360;&#12400;&#12289;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540; <code class="filename">C:\Software</code> &#12391;&#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12434;&#23637;&#38283;&#12377;&#12427;&#12392;&#12289;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540; <code class="filename">C:\Software\findbugs-2.0.3</code> &#12395; <span class="application">FindBugs</span> &#12399;&#23637;&#38283;&#12373;&#12428;&#12414;&#12377;&#12290;&#12371;&#12398;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12364; <span class="application">FindBugs</span> &#12398;&#12507;&#12540;&#12512;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12371;&#12398;&#12510;&#12491;&#12517;&#12450;&#12523;&#12391;&#12399;&#12289;&#12371;&#12398;&#12507;&#12540;&#12512;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434; <em class="replaceable"><code>$FINDBUGS_HOME</code></em> (Windows&#12391;&#12399; <em class="replaceable"><code>%FINDBUGS_HOME%</code></em>) &#12434;&#29992;&#12356;&#12390;&#21442;&#29031;&#12375;&#12414;&#12377;&#12290;</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="introduction.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="building.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;1&#31456; &#12399;&#12376;&#12417;&#12395;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;3&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;</td></tr></table></div></body></html>
+0
-3
doc/ja/manual/introduction.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;1&#31456; &#12399;&#12376;&#12417;&#12395;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="next" href="installing.html" title="&#31532;2&#31456; FindBugs&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;1&#31456; &#12399;&#12376;&#12417;&#12395;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="installing.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;1&#31456; &#12399;&#12376;&#12417;&#12395;"><div class="titlepage"><div><div><h2 class="title"><a name="introduction"></a>&#31532;1&#31456; &#12399;&#12376;&#12417;&#12395;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="introduction.html#d0e74">1. &#24517;&#35201;&#26465;&#20214;</a></span></dt></dl></div><p><span class="application">FindBugs</span>&#8482; &#12399;&#12289;Java &#12503;&#12525;&#12464;&#12521;&#12512;&#12398;&#20013;&#12398;&#12496;&#12464;&#12434;&#35211;&#12388;&#12369;&#12427;&#12503;&#12525;&#12464;&#12521;&#12512;&#12391;&#12377;&#12290;&#12371;&#12398;&#12503;&#12525;&#12464;&#12521;&#12512;&#12399;&#12289;&#12300;&#12496;&#12464; &#12497;&#12479;&#12540;&#12531;&#12301;&#12398;&#23455;&#20363;&#12434;&#25506;&#12375;&#12414;&#12377;&#12290;&#12300;&#12496;&#12464; &#12497;&#12479;&#12540;&#12531;&#12301;&#12392;&#12399;&#12289;&#12456;&#12521;&#12540;&#12392;&#12394;&#12427;&#21487;&#33021;&#24615;&#12398;&#39640;&#12356;&#12467;&#12540;&#12489;&#12398;&#20107;&#20363;&#12391;&#12377;&#12290;</p><p>&#12371;&#12398;&#25991;&#26360;&#12399;&#12289;<span class="application">FindBugs</span> &#12496;&#12540;&#12472;&#12519;&#12531; 2.0.3 &#12395;&#12388;&#12356;&#12390;&#35500;&#26126;&#12375;&#12390;&#12414;&#12377;&#12290;&#31169;&#12383;&#12385;&#12399;&#12289; <span class="application">FindBugs</span> &#12395;&#23550;&#12377;&#12427;&#12501;&#12451;&#12540;&#12489;&#12496;&#12483;&#12463;&#12434;&#24515;&#24453;&#12385;&#12395;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12393;&#12358;&#12382;&#12289; <a class="ulink" href="http://findbugs.sourceforge.net" target="_top"><span class="application">FindBugs</span> Web &#12506;&#12540;&#12472;</a> &#12395;&#12450;&#12463;&#12475;&#12473;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;<span class="application">FindBugs</span> &#12395;&#12388;&#12356;&#12390;&#12398;&#26368;&#26032;&#24773;&#22577;&#12289;&#36899;&#32097;&#20808;&#12362;&#12424;&#12403; <span class="application">FindBugs</span> &#12513;&#12540;&#12522;&#12531;&#12464;&#12522;&#12473;&#12488;&#12394;&#12393;&#12398;&#12469;&#12509;&#12540;&#12488;&#24773;&#22577;&#12434;&#20837;&#25163;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><div class="sect1" title="1. &#24517;&#35201;&#26465;&#20214;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e74"></a>1. &#24517;&#35201;&#26465;&#20214;</h2></div></div></div><p><span class="application">FindBugs</span> &#12434;&#20351;&#29992;&#12377;&#12427;&#12395;&#12399;&#12289; <a class="ulink" href="http://java.sun.com/j2se" target="_top">Java 2 Standard Edition</a>, &#12496;&#12540;&#12472;&#12519;&#12531; 1.5 &#20197;&#38477;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12392;&#20114;&#25563;&#24615;&#12398;&#12354;&#12427;&#12521;&#12531;&#12479;&#12452;&#12512;&#29872;&#22659;&#12364;&#24517;&#35201;&#12391;&#12377;&#12290;<span class="application">FindBugs</span> &#12399;&#12289;&#12503;&#12521;&#12483;&#12488;&#12501;&#12457;&#12540;&#12512;&#38750;&#20381;&#23384;&#12391;&#12354;&#12426;&#12289; GNU/Linux &#12289; Windows &#12289; MacOS X &#12503;&#12521;&#12483;&#12488;&#12501;&#12457;&#12540;&#12512;&#19978;&#12391;&#21205;&#20316;&#12377;&#12427;&#12371;&#12392;&#12364;&#30693;&#12425;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;</p><p><span class="application">FindBugs</span> &#12434;&#20351;&#29992;&#12377;&#12427;&#12383;&#12417;&#12395;&#12399;&#12289;&#23569;&#12394;&#12367;&#12392;&#12418; 512 MB &#12398;&#12513;&#12514;&#12522;&#12364;&#24517;&#35201;&#12391;&#12377;&#12290;&#24040;&#22823;&#12394;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12434;&#35299;&#26512;&#12377;&#12427;&#12383;&#12417;&#12395;&#12399;&#12289;&#12381;&#12428;&#12424;&#12426;&#22810;&#12367;&#12398;&#12513;&#12514;&#12522;&#12364;&#24517;&#35201;&#12392;&#12373;&#12428;&#12427;&#12371;&#12392;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="installing.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">FindBugs</span>&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;2&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</td></tr></table></div></body></html>
+0
-3
doc/ja/manual/license.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;13&#31456; &#12521;&#12452;&#12475;&#12531;&#12473;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="datamining.html" title="&#31532;12&#31456; FindBugs&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;"><link rel="next" href="acknowledgments.html" title="&#31532;14&#31456; &#35613;&#36766;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;13&#31456; &#12521;&#12452;&#12475;&#12531;&#12473;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="datamining.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="acknowledgments.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;13&#31456; &#12521;&#12452;&#12475;&#12531;&#12473;"><div class="titlepage"><div><div><h2 class="title"><a name="license"></a>&#31532;13&#31456; &#12521;&#12452;&#12475;&#12531;&#12473;</h2></div></div></div><p>&#21517;&#31216;&#12300;FindBugs&#12301;&#12362;&#12424;&#12403; FindBugs &#12398;&#12525;&#12468;&#12399;&#12289;&#12513;&#12522;&#12540;&#12521;&#12531;&#12489;&#22823;&#23398;&#12398;&#30331;&#37682;&#21830;&#27161;&#12391;&#12377;&#12290;FindBugs &#12399;&#12501;&#12522;&#12540;&#12477;&#12501;&#12488;&#12454;&#12455;&#12450;&#12391;&#12354;&#12426;&#12289; <a class="ulink" href="http://www.gnu.org/licenses/lgpl.html" target="_top">Lesser GNU Public License</a> &#12398;&#26465;&#20214;&#12391;&#37197;&#24067;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;&#20351;&#29992;&#25215;&#35582;&#26360;&#12434;&#20837;&#25163;&#12375;&#12383;&#12356;&#22580;&#21512;&#12399;&#12289; <span class="application">FindBugs</span> &#37197;&#24067;&#29289;&#12395;&#21547;&#12414;&#12428;&#12427; <code class="filename">LICENSE.txt</code> &#12501;&#12449;&#12452;&#12523;&#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p><p>&#26368;&#26032;&#12496;&#12540;&#12472;&#12519;&#12531;&#12398; FindBugs &#12362;&#12424;&#12403; &#12381;&#12398;&#12477;&#12540;&#12473;&#12467;&#12540;&#12489;&#12399; <a class="ulink" href="http://findbugs.sourceforge.net" target="_top">FindBugs web &#12506;&#12540;&#12472;</a> &#12391;&#20837;&#25163;&#12391;&#12365;&#12414;&#12377;&#12290;</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="datamining.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="acknowledgments.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;12&#31456; <span class="application">FindBugs</span>&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;14&#31456; &#35613;&#36766;</td></tr></table></div></body></html>
doc/ja/manual/note.png less more
Binary diff not shown
doc/ja/manual/project-dialog.png less more
Binary diff not shown
+0
-3
doc/ja/manual/rejarForAnalysis.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;11&#31456; rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="annotations.html" title="&#31532;10&#31456; &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;"><link rel="next" href="datamining.html" title="&#31532;12&#31456; FindBugs&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;11&#31456; rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="annotations.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="datamining.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;11&#31456; rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;"><div class="titlepage"><div><div><h2 class="title"><a name="rejarForAnalysis"></a>&#31532;11&#31456; rejarForAnalysis &#12398;&#20351;&#29992;&#26041;&#27861;</h2></div></div></div><p>&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12395;&#22810;&#12367;&#12398; jar &#12501;&#12449;&#12452;&#12523; &#12364;&#12354;&#12387;&#12383;&#12426;&#12289; jar &#12501;&#12449;&#12452;&#12523;&#12364;&#22810;&#12367;&#12398;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12395;&#28857;&#22312;&#12375;&#12383;&#12426;&#12377;&#12427;&#22580;&#21512;&#12399;&#12289; <span class="command"><strong>rejarForAnalysis </strong></span> &#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20351;&#29992;&#12377;&#12427;&#12392; FindBugs &#12398;&#23455;&#34892;&#12364;&#27604;&#36611;&#30340;&#31777;&#21336;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12371;&#12398;&#12473;&#12463;&#12522;&#12503;&#12488;&#12399;&#12289;&#25968;&#22810;&#12356; jar &#12501;&#12449;&#12452;&#12523;&#12434;&#38598;&#12417;&#12390; 1 &#12388;&#12398;&#22823;&#12365;&#12394; jar &#12501;&#12449;&#12452;&#12523;&#12395;&#32080;&#21512;&#12375;&#12414;&#12377;&#12290;&#12381;&#12358;&#12377;&#12427;&#12392;&#12289;&#20998;&#26512;&#26178;&#12395;FindBugs &#12395; jar &#12501;&#12449;&#12452;&#12523;&#12434;&#35373;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#27604;&#36611;&#30340;&#31777;&#21336;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12371;&#12398;&#12473;&#12463;&#12522;&#12503;&#12488;&#12399;&#12289; unix &#12471;&#12473;&#12486;&#12512;&#12398; 'find' &#12467;&#12510;&#12531;&#12489;&#12392;&#32068;&#12415;&#21512;&#12431;&#12379;&#12427;&#12392;&#12392;&#12426;&#12431;&#12369;&#26377;&#29992;&#12395;&#12394;&#12426;&#12414;&#12377; ; &#27425;&#12395;&#20363;&#12434;&#31034;&#12375;&#12414;&#12377;&#12290; <span class="command"><strong>find . -name '*.jar' | xargs rejarForAnalysis </strong></span>.</p><p>&#12414;&#12383;&#12289; <span class="command"><strong>rejarForAnalysis</strong></span> &#12473;&#12463;&#12522;&#12503;&#12488;&#12399;&#24040;&#22823;&#12394;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12434;&#35079;&#25968;&#12398; jar &#12501;&#12449;&#12452;&#12523;&#12395;&#20998;&#21106;&#12377;&#12427;&#12371;&#12392;&#12395;&#20351;&#29992;&#12391;&#12365;&#12414;&#12377;&#12290;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12398;&#12463;&#12521;&#12473;&#12501;&#12449;&#12452;&#12523;&#12399;&#12289;&#35079;&#25968;&#12398; jar &#12501;&#12449;&#12452;&#12523;&#12395;&#22343;&#31561;&#12395;&#37197;&#20998;&#12373;&#12428;&#12414;&#12377;&#12290;&#12371;&#12428;&#12399;&#12289;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#20840;&#20307;&#12395;&#23550;&#12375;&#12390; FindBugs &#12434;&#23455;&#34892;&#12377;&#12427;&#12392;&#26178;&#38291;&#12392;&#12513;&#12514;&#12522;&#28040;&#36027;&#12364;&#33879;&#12375;&#12356;&#22580;&#21512;&#12395;&#26377;&#29992;&#12391;&#12377;&#12290;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#20840;&#20307;&#12395;&#23550;&#12375;&#12390; FindBugs &#12434;&#23455;&#34892;&#12377;&#12427;&#20195;&#12431;&#12426;&#12395;&#12289; <span class="command"><strong> rejarForAnalysis</strong></span> &#12391;&#12377;&#12409;&#12390;&#12398;&#12463;&#12521;&#12473;&#12434;&#21547;&#12416;&#22823;&#12365;&#12394; jar &#12501;&#12449;&#12452;&#12523;&#12434;&#27083;&#31689;&#12375;&#12414;&#12377;&#12290;&#32154;&#12356;&#12390;&#12289; <span class="command"><strong>rejarForAnalysis</strong></span> &#12434;&#20877;&#12403;&#23455;&#34892;&#12375;&#12390;&#35079;&#25968;&#12398; jar &#12501;&#12449;&#12452;&#12523;&#12395;&#20998;&#21106;&#12375;&#12414;&#12377;&#12290;&#12381;&#12375;&#12390;&#12289;&#21508;&#12293;&#12398; jar &#12501;&#12449;&#12452;&#12523;&#12395;&#23550;&#12375;&#12390;&#38918;&#12395; FindBugs &#12434;&#23455;&#34892;&#12375;&#12414;&#12377;&#12290;&#12381;&#12398;&#38555;&#12289; <span class="command"><strong>-auxclasspath</strong></span> &#12395;&#26368;&#21021;&#12395; 1 &#12388;&#12395;&#12414;&#12392;&#12417;&#12383; jar &#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p><p><span class="command"><strong>rejarForAnalysis</strong></span> &#12473;&#12463;&#12522;&#12503;&#12488;&#12395;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#20197;&#19979;&#12395;&#31034;&#12375;&#12414;&#12377; :</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-maxAge</strong></span> <em class="replaceable"><code>&#26085;&#25968;</code></em></span></dt><dd><p>&#26368;&#24460;&#12395;&#26356;&#26032;&#12373;&#12428;&#12383;&#26085;&#12363;&#12425;&#12398;&#32076;&#36942;&#26178;&#38291;&#12434;&#26085;&#21336;&#20301;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377; (&#25351;&#23450;&#12375;&#12383;&#26085;&#25968;&#12424;&#12426;&#21476;&#12356; jar &#12501;&#12449;&#12452;&#12523;&#12399;&#28961;&#35222;&#12373;&#12428;&#12414;&#12377;)&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-inputFileList</strong></span> <em class="replaceable"><code>&#12501;&#12449;&#12452;&#12523;&#21517;</code></em></span></dt><dd><p>jar &#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#35352;&#36617;&#12375;&#12383;&#12486;&#12461;&#12473;&#12488;&#12501;&#12449;&#12452;&#12523;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-maxClasses</strong></span> <em class="replaceable"><code>&#12463;&#12521;&#12473;&#25968;</code></em></span></dt><dd><p>analysis*.jar &#12501;&#12449;&#12452;&#12523; 1 &#12501;&#12449;&#12452;&#12523;&#12395;&#23550;&#12377;&#12427;&#12463;&#12521;&#12473;&#12398;&#26368;&#22823;&#25968;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-prefix</strong></span> <em class="replaceable"><code>&#12503;&#12524;&#12501;&#12451;&#12483;&#12463;&#12473;</code></em></span></dt><dd><p>&#20998;&#26512;&#12377;&#12427;&#12463;&#12521;&#12473;&#21517;&#12398;&#12503;&#12524;&#12501;&#12451;&#12483;&#12463;&#12473;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377; (&#20363;&#12289; edu.umd.cs.) &#12290;</p></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="annotations.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="datamining.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;10&#31456; &#12450;&#12494;&#12486;&#12540;&#12471;&#12519;&#12531;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;12&#31456; <span class="application">FindBugs</span>&#8482; &#12395;&#12424;&#12427;&#12487;&#12540;&#12479;&#12539;&#12510;&#12452;&#12491;&#12531;&#12464;</td></tr></table></div></body></html>
+0
-22
doc/ja/manual/running.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>&#31532;4&#31456; FindBugs&#8482; &#12398;&#23455;&#34892;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="up" href="index.html" title="FindBugs&#8482; &#12510;&#12491;&#12517;&#12450;&#12523;"><link rel="prev" href="building.html" title="&#31532;3&#31456; FindBugs&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;"><link rel="next" href="gui.html" title="&#31532;5&#31456; FindBugs GUI &#12398;&#20351;&#29992;&#26041;&#27861;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">&#31532;4&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="building.html">&#25147;&#12427;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="gui.html">&#27425;&#12408;</a></td></tr></table><hr></div><div class="chapter" title="&#31532;4&#31456; FindBugs&#8482; &#12398;&#23455;&#34892;"><div class="titlepage"><div><div><h2 class="title"><a name="running"></a>&#31532;4&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#23455;&#34892;</h2></div></div></div><div class="toc"><p><b>&#30446;&#27425;</b></p><dl><dt><span class="sect1"><a href="running.html#d0e455">1. &#12463;&#12452;&#12483;&#12463;&#12539;&#12473;&#12479;&#12540;&#12488;</a></span></dt><dt><span class="sect1"><a href="running.html#d0e493">2. <span class="application">FindBugs</span> &#12398;&#36215;&#21205;</a></span></dt><dt><span class="sect1"><a href="running.html#commandLineOptions">3. &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</a></span></dt></dl></div><p><span class="application">FindBugs</span> &#12395;&#12399;2&#12388;&#12398;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#12377;&#12394;&#12431;&#12385;&#12289;&#12464;&#12521;&#12501;&#12451;&#12459;&#12523;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473; (GUI) &#12362;&#12424;&#12403; &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12391;&#12377;&#12290;&#12371;&#12398;&#31456;&#12391;&#12399;&#12289;&#12381;&#12428;&#12382;&#12428;&#12398;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12398;&#23455;&#34892;&#26041;&#27861;&#12395;&#12388;&#12356;&#12390;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;</p><div class="warning" title="&#35686;&#21578;" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[&#35686;&#21578;]" src="warning.png"></td><th align="left">&#35686;&#21578;</th></tr><tr><td align="left" valign="top"><p>&#12371;&#12398;&#31456;&#12399;&#12289;&#29694;&#22312;&#26360;&#12365;&#30452;&#12375;&#20013;&#12391;&#12377;&#12290;&#26360;&#12365;&#30452;&#12375;&#12399;&#12414;&#12384;&#23436;&#20102;&#12375;&#12390;&#12356;&#12414;&#12379;&#12435;&#12290;</p></td></tr></table></div><div class="sect1" title="1. &#12463;&#12452;&#12483;&#12463;&#12539;&#12473;&#12479;&#12540;&#12488;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e455"></a>1. &#12463;&#12452;&#12483;&#12463;&#12539;&#12473;&#12479;&#12540;&#12488;</h2></div></div></div><p>Windows &#12471;&#12473;&#12486;&#12512;&#12391; <span class="application">FindBugs</span> &#12434;&#36215;&#21205;&#12377;&#12427;&#22580;&#21512;&#12399;&#12289; <code class="filename"><em class="replaceable"><code>%FINDBUGS_HOME%</code></em>\lib\findbugs.jar</code> &#12501;&#12449;&#12452;&#12523;&#12434;&#12480;&#12502;&#12523;&#12463;&#12522;&#12483;&#12463;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290; <span class="application">FindBugs</span> GUI &#12364;&#36215;&#21205;&#12375;&#12414;&#12377;&#12290;</p><p>Unix &#12289; Linux &#12414;&#12383;&#12399; Mac OS X &#12471;&#12473;&#12486;&#12512;&#12398;&#22580;&#21512;&#12399;&#12289;<code class="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/bin/findbugs</code> &#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#23455;&#34892;&#12377;&#12427;&#12363;&#12289;&#20197;&#19979;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12375;&#12414;&#12377;&#12290;</p><pre class="screen">
3 <span class="command"><strong>java -jar <em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbugs.jar</strong></span></pre><p>&#12371;&#12428;&#12391;&#12289; <span class="application">FindBugs</span> GUI &#12364;&#36215;&#21205;&#12375;&#12414;&#12377;&#12290;</p><p>GUI &#12398;&#20351;&#29992;&#26041;&#27861;&#12395;&#12388;&#12356;&#12390;&#12399;&#12289; <a class="xref" href="gui.html" title="&#31532;5&#31456; FindBugs GUI &#12398;&#20351;&#29992;&#26041;&#27861;">5&#31456;<i><span class="application">FindBugs</span> GUI &#12398;&#20351;&#29992;&#26041;&#27861;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></div><div class="sect1" title="2. FindBugs &#12398;&#36215;&#21205;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e493"></a>2. <span class="application">FindBugs</span> &#12398;&#36215;&#21205;</h2></div></div></div><p>&#12371;&#12398;&#12475;&#12463;&#12471;&#12519;&#12531;&#12391;&#12399;&#12289; <span class="application">FindBugs</span> &#12398;&#36215;&#21205;&#26041;&#27861;&#12434;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;<span class="application">FindBugs</span> &#12434;&#36215;&#21205;&#12377;&#12427;&#12395;&#12399;2&#12388;&#12398;&#26041;&#27861;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#12377;&#12394;&#12431;&#12385;&#12289;&#30452;&#25509;&#36215;&#21205;&#12377;&#12427;&#26041;&#27861;&#12289;&#12362;&#12424;&#12403;&#12289;&#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20351;&#29992;&#12377;&#12427;&#26041;&#27861;&#12391;&#12377;&#12290;</p><div class="sect2" title="2.1. FindBugs &#12398;&#30452;&#25509;&#36215;&#21205;"><div class="titlepage"><div><div><h3 class="title"><a name="directInvocation"></a>2.1. <span class="application">FindBugs</span> &#12398;&#30452;&#25509;&#36215;&#21205;</h3></div></div></div><p>&#26368;&#21021;&#12395;&#36848;&#12409;&#12427; <span class="application">FindBugs</span> &#12398;&#36215;&#21205;&#26041;&#27861;&#12399;&#12289; <code class="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbugs.jar</code> &#12434;&#30452;&#25509;&#23455;&#34892;&#12377;&#12427;&#26041;&#27861;&#12391;&#12377;&#12290;JVM (<span class="command"><strong>java</strong></span>) &#23455;&#34892;&#12503;&#12525;&#12464;&#12521;&#12512;&#12398; <span class="command"><strong>-jar</strong></span> &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12473;&#12452;&#12483;&#12481;&#12434;&#20351;&#29992;&#12375;&#12414;&#12377;&#12290;(<span class="application">FindBugs</span>&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12364; 1.3.5 &#12424;&#12426;&#21069;&#12398;&#22580;&#21512;&#12399;&#12289;&#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20351;&#29992;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;)</p><p><span class="application">FindBugs</span> &#12434;&#30452;&#25509;&#36215;&#21205;&#12377;&#12427;&#12383;&#12417;&#12398;&#12289;&#19968;&#33324;&#30340;&#12394;&#27083;&#25991;&#12399;&#20197;&#19979;&#12398;&#12424;&#12358;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;</p><pre class="screen">
4 <span class="command"><strong>java <em class="replaceable"><code>[JVM &#24341;&#25968;]</code></em> -jar <em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbugs.jar <em class="replaceable"><code>&#12458;&#12503;&#12471;&#12519;&#12531;&#8230;</code></em></strong></span>
5 </pre><p>
6 </p><div class="sect3" title="2.1.1. &#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12398;&#36984;&#25246;"><div class="titlepage"><div><div><h4 class="title"><a name="chooseUI"></a>2.1.1. &#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12398;&#36984;&#25246;</h4></div></div></div><p>1 &#30058;&#30446;&#12398;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399;&#12289;&#36215;&#21205;&#12377;&#12427; <span class="application">FindBugs</span> &#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12434;&#36984;&#25246;&#12377;&#12427;&#12383;&#12417;&#12398;&#12418;&#12398;&#12391;&#12377;&#12290;&#25351;&#23450;&#21487;&#33021;&#12394;&#20516;&#12399;&#27425;&#12398;&#36890;&#12426;&#12391;&#12377;:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
7 <span class="command"><strong>-gui</strong></span>: &#12464;&#12521;&#12501;&#12451;&#12459;&#12523;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473; (GUI) &#12434;&#36215;&#21205;&#12375;&#12414;&#12377;&#12290;</p></li><li class="listitem"><p>
8 <span class="command"><strong>-textui</strong></span>: &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12434;&#36215;&#21205;&#12375;&#12414;&#12377;&#12290;</p></li><li class="listitem"><p>
9 <span class="command"><strong>-version</strong></span>: <span class="application">FindBugs</span> &#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#30058;&#21495;&#12434;&#34920;&#31034;&#12375;&#12414;&#12377;&#12290;</p></li><li class="listitem"><p>
10 <span class="command"><strong>-help</strong></span>: <span class="application">FindBugs</span> &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12398;&#12504;&#12523;&#12503;&#24773;&#22577;&#12434;&#34920;&#31034;&#12375;&#12414;&#12377;&#12290;</p></li><li class="listitem"><p>
11 <span class="command"><strong>-gui1</strong></span>: &#26368;&#21021;&#12395;&#20316;&#25104;&#12373;&#12428;&#12383; <span class="application">FindBugs</span> &#12464;&#12521;&#12501;&#12451;&#12459;&#12523;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;(&#12377;&#12391;&#12395;&#24259;&#27490;&#12373;&#12428;&#12469;&#12509;&#12540;&#12488;&#12373;&#12428;&#12390;&#12356;&#12394;&#12356;)&#12434;&#36215;&#21205;&#12375;&#12414;&#12377;&#12290;</p></li></ul></div></div><div class="sect3" title="2.1.2. Java &#20206;&#24819;&#12510;&#12471;&#12531; (JVM) &#24341;&#25968;"><div class="titlepage"><div><div><h4 class="title"><a name="jvmArgs"></a>2.1.2. Java &#20206;&#24819;&#12510;&#12471;&#12531; (JVM) &#24341;&#25968;</h4></div></div></div><p><span class="application">FindBugs</span> &#12434;&#36215;&#21205;&#12377;&#12427;&#38555;&#12395;&#26377;&#29992;&#12394; Java &#20206;&#24819;&#12510;&#12471;&#12531; &#24341;&#25968;&#12434;&#12356;&#12367;&#12388;&#12363;&#32057;&#20171;&#12375;&#12414;&#12377;&#12290;</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-Xmx<em class="replaceable"><code>NN</code></em>m</strong></span></span></dt><dd><p>Java &#12498;&#12540;&#12503;&#12469;&#12452;&#12474;&#12398;&#26368;&#22823;&#20516;&#12434; <em class="replaceable"><code>NN</code></em> &#12513;&#12460;&#12496;&#12452;&#12488;&#12395;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;<span class="application">FindBugs</span> &#12399;&#19968;&#33324;&#30340;&#12395;&#22823;&#23481;&#37327;&#12398;&#12513;&#12514;&#12522;&#12469;&#12452;&#12474;&#12434;&#24517;&#35201;&#12392;&#12375;&#12414;&#12377;&#12290;&#22823;&#12365;&#12394;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12391;&#12399;&#12289; 1500 &#12513;&#12460;&#12496;&#12452;&#12488;&#12434;&#20351;&#29992;&#12377;&#12427;&#12371;&#12392;&#12418;&#29645;&#12375;&#12367;&#12354;&#12426;&#12414;&#12379;&#12435;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-D<em class="replaceable"><code>name</code></em>=<em class="replaceable"><code>value</code></em></strong></span></span></dt><dd><p>Java &#12471;&#12473;&#12486;&#12512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;&#20363;&#12360;&#12400;&#12289;&#24341;&#25968; <span class="command"><strong>-Duser.language=ja</strong></span> &#12434;&#20351;&#29992;&#12377;&#12427;&#12392; GUI &#25991;&#35328;&#12364;&#26085;&#26412;&#35486;&#12391;&#34920;&#31034;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd></dl></div></div></div><div class="sect2" title="2.2. &#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20351;&#29992;&#12375;&#12383; FindBugs &#12398;&#36215;&#21205;"><div class="titlepage"><div><div><h3 class="title"><a name="wrapperScript"></a>2.2. &#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20351;&#29992;&#12375;&#12383; <span class="application">FindBugs</span> &#12398;&#36215;&#21205;</h3></div></div></div><p><span class="application">FindBugs</span> &#12434;&#36215;&#21205;&#12377;&#12427;&#12418;&#12358;&#12402;&#12392;&#12388;&#12398;&#26041;&#27861;&#12399;&#12289;&#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#20351;&#29992;&#12377;&#12427;&#26041;&#27861;&#12391;&#12377;&#12290;</p><p>Unix &#31995;&#12398;&#12471;&#12473;&#12486;&#12512;&#12395;&#12362;&#12356;&#12390;&#12399;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394;&#12467;&#12510;&#12531;&#12489;&#12391;&#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#36215;&#21205;&#12375;&#12414;&#12377; :</p><pre class="screen">
12 <code class="prompt">$ </code><span class="command"><strong><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/bin/findbugs <em class="replaceable"><code>&#12458;&#12503;&#12471;&#12519;&#12531;&#8230;</code></em></strong></span>
13 </pre><p>
14 </p><p>Windows &#12471;&#12473;&#12486;&#12512;&#12395;&#12362;&#12356;&#12390;&#12399;&#12289;&#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#36215;&#21205;&#12377;&#12427;&#12467;&#12510;&#12531;&#12489;&#12399;&#27425;&#12398;&#12424;&#12358;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;</p><pre class="screen">
15 <code class="prompt">C:\My Directory&gt;</code><span class="command"><strong><em class="replaceable"><code>%FINDBUGS_HOME%</code></em>\bin\findbugs.bat <em class="replaceable"><code>&#12458;&#12503;&#12471;&#12519;&#12531;&#8230;</code></em></strong></span>
16 </pre><p>
17 </p><p>Unix &#31995;&#12471;&#12473;&#12486;&#12512; &#12362;&#12424;&#12403; Windows &#12471;&#12473;&#12486;&#12512;&#12398;&#12393;&#12385;&#12425;&#12395;&#12362;&#12356;&#12390;&#12418;&#12289;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540; <code class="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/bin</code> &#12434;&#29872;&#22659;&#22793;&#25968; <code class="filename">PATH</code> &#12395;&#36861;&#21152;&#12377;&#12427;&#12384;&#12369;&#12391;&#12289; <span class="command"><strong>findbugs</strong></span> &#12467;&#12510;&#12531;&#12489;&#12434;&#20351;&#29992;&#12375;&#12390; FindBugs &#12434;&#36215;&#21205;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p><div class="sect3" title="2.2.1. &#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;"><div class="titlepage"><div><div><h4 class="title"><a name="wrapperOptions"></a>2.2.1. &#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</h4></div></div></div><p><span class="application">FindBugs</span> &#12398;&#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12399;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#12469;&#12509;&#12540;&#12488;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12371;&#12428;&#12425;&#12398;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399; <span class="application">FindBugs</span> &#12503;&#12525;&#12464;&#12521;&#12512; &#33258;&#20307;&#12364;&#25805;&#20316;&#12377;&#12427;&#12398;&#12391;&#12399;<span class="emphasis"><em>&#12394;&#12367;</em></span>&#12289;&#12393;&#12385;&#12425;&#12363;&#12392;&#12356;&#12360;&#12400;&#12289;&#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#26041;&#12364;&#20966;&#29702;&#12434;&#34892;&#12356;&#12414;&#12377;&#12290;</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-jvmArgs <em class="replaceable"><code>&#24341;&#25968;</code></em></strong></span></span></dt><dd><p>JVM &#12395;&#21463;&#12369;&#28193;&#12373;&#12428;&#12427;&#24341;&#25968;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#20363;&#12360;&#12400;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394; JVM &#12503;&#12525;&#12497;&#12486;&#12451;&#12364;&#35373;&#23450;&#12391;&#12365;&#12414;&#12377;:</p><pre class="screen">
18 <code class="prompt">$ </code><span class="command"><strong>findbugs -textui -jvmArgs "-Duser.language=ja" <em class="replaceable"><code>myApp.jar</code></em></strong></span>
19 </pre><p>
20 </p></dd><dt><span class="term"><span class="command"><strong>-javahome <em class="replaceable"><code>&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;</code></em></strong></span></span></dt><dd><p><span class="application">FindBugs</span> &#12398;&#23455;&#34892;&#12395;&#20351;&#29992;&#12377;&#12427; JRE (Java &#12521;&#12531;&#12479;&#12452;&#12512;&#29872;&#22659;) &#12364;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12373;&#12428;&#12390;&#12356;&#12427;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-maxHeap <em class="replaceable"><code>&#12469;&#12452;&#12474;</code></em></strong></span></span></dt><dd><p>Java &#12498;&#12540;&#12503;&#12469;&#12452;&#12474;&#12398;&#26368;&#22823;&#20516;&#12434;&#12513;&#12460;&#12496;&#12452;&#12488;&#21336;&#20301;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12399;&#12289; 256 &#12391;&#12377;&#12290;&#24040;&#22823;&#12394;&#12503;&#12525;&#12464;&#12521;&#12512;&#12420;&#12521;&#12452;&#12502;&#12521;&#12522;&#12434;&#20998;&#26512;&#12377;&#12427;&#12395;&#12399;&#12289;&#12418;&#12387;&#12392;&#22823;&#12365;&#12394;&#12513;&#12514;&#12522;&#12540;&#23481;&#37327;&#12364;&#24517;&#35201;&#12395;&#12394;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-debug</strong></span></span></dt><dd><p>&#12487;&#12451;&#12486;&#12463;&#12479;&#23455;&#34892;&#12362;&#12424;&#12403;&#12463;&#12521;&#12473;&#20998;&#26512;&#12398;&#12488;&#12524;&#12540;&#12473;&#24773;&#22577;&#12364;&#27161;&#28310;&#20986;&#21147;&#12395;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;&#20998;&#26512;&#12364;&#20104;&#26399;&#12379;&#12378;&#22833;&#25943;&#12375;&#12383;&#38555;&#12398;&#12289;&#12488;&#12521;&#12502;&#12523;&#12471;&#12517;&#12540;&#12486;&#12451;&#12531;&#12464;&#12395;&#26377;&#29992;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-property</strong></span> <em class="replaceable"><code>name=value</code></em></span></dt><dd><p>&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#20351;&#29992;&#12375;&#12390;&#12471;&#12473;&#12486;&#12512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12434;&#35373;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290; <span class="application">FindBugs</span> &#12399;&#12471;&#12473;&#12486;&#12512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;&#12434;&#20351;&#29992;&#12375;&#12390;&#20998;&#26512;&#29305;&#24615;&#12398;&#35373;&#23450;&#12434;&#34892;&#12356;&#12414;&#12377;&#12290;<a class="xref" href="analysisprops.html" title="&#31532;9&#31456; &#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;">9&#31456;<i>&#20998;&#26512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12540;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#35079;&#25968;&#25351;&#23450;&#12375;&#12390;&#12289;&#35079;&#25968;&#12398;&#12471;&#12473;&#12486;&#12512;&#12503;&#12525;&#12497;&#12486;&#12451;&#12434;&#35373;&#23450;&#12377;&#12427;&#12371;&#12392;&#12364;&#21487;&#33021;&#12391;&#12377;&#12290;&#27880;: Windows &#12398;&#22810;&#12367;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12391;&#12399;&#12289; <em class="replaceable"><code>name=value</code></em> &#25991;&#23383;&#21015;&#12434;&#24341;&#29992;&#31526;&#12391;&#22258;&#12416;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p></dd></dl></div></div></div></div><div class="sect1" title="3. &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="commandLineOptions"></a>3. &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</h2></div></div></div><p>&#12371;&#12398;&#12475;&#12463;&#12471;&#12519;&#12531;&#12391;&#12399;&#12289; <span class="application">FindBugs</span> &#12364;&#12469;&#12509;&#12540;&#12488;&#12377;&#12427;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;&#12395;&#12388;&#12356;&#12390;&#35500;&#26126;&#12375;&#12414;&#12377;&#12290;&#12371;&#12371;&#12391;&#31034;&#12377;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399;&#12289; <span class="application">FindBugs</span> &#30452;&#25509;&#36215;&#21205;&#12289;&#12414;&#12383;&#12399;&#12289;&#12521;&#12483;&#12503;&#12375;&#12390;&#12356;&#12427;&#12473;&#12463;&#12522;&#12503;&#12488;&#12395;&#12424;&#12427;&#36215;&#21205;&#12391;&#20351;&#29992;&#12391;&#12365;&#12414;&#12377;&#12290;</p><div class="sect2" title="3.1. &#20849;&#36890;&#12398;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;"><div class="titlepage"><div><div><h3 class="title"><a name="d0e778"></a>3.1. &#20849;&#36890;&#12398;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12458;&#12503;&#12471;&#12519;&#12531;</h3></div></div></div><p>&#12371;&#12371;&#12391;&#31034;&#12377;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399;&#12289; GUI &#12362;&#12424;&#12403; &#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12398;&#20001;&#26041;&#12391;&#20351;&#29992;&#12391;&#12365;&#12414;&#12377;&#12290;</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-effort:min</strong></span></span></dt><dd><p>&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#25351;&#23450;&#12377;&#12427;&#12392;&#12289;&#31934;&#24230;&#12434;&#19978;&#12370;&#12427;&#12383;&#12417;&#12395;&#22823;&#37327;&#12398;&#12513;&#12514;&#12522;&#12540;&#12434;&#28040;&#36027;&#12377;&#12427;&#20998;&#26512;&#12364;&#28961;&#21177;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;<span class="application">FindBugs</span> &#12398;&#23455;&#34892;&#26178;&#12395;&#12513;&#12514;&#12522;&#12540;&#19981;&#36275;&#12395;&#12394;&#12387;&#12383;&#12426;&#12289;&#20998;&#26512;&#12434;&#23436;&#20102;&#12377;&#12427;&#12414;&#12391;&#12395;&#30064;&#24120;&#12395;&#38263;&#12356;&#26178;&#38291;&#12364;&#12363;&#12363;&#12427;&#22580;&#21512;&#12395;&#35430;&#12375;&#12390;&#12415;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-effort:max</strong></span></span></dt><dd><p>&#31934;&#24230;&#12364;&#39640;&#12367;&#12289;&#12424;&#12426;&#22810;&#12367;&#12398;&#12496;&#12464;&#12434;&#26908;&#20986;&#12377;&#12427;&#20998;&#26512;&#12434;&#26377;&#21177;&#12395;&#12375;&#12414;&#12377;&#12290;&#12383;&#12384;&#12375;&#12289;&#22810;&#12367;&#12398;&#12513;&#12514;&#12522;&#12540;&#23481;&#37327;&#12434;&#24517;&#35201;&#12392;&#12375;&#12289;&#12414;&#12383;&#12289;&#23436;&#20102;&#12414;&#12391;&#12398;&#26178;&#38291;&#12364;&#22810;&#12367;&#12363;&#12363;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-project</strong></span> <em class="replaceable"><code>project</code></em></span></dt><dd><p>&#20998;&#26512;&#12377;&#12427;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#25351;&#23450;&#12377;&#12427;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12501;&#12449;&#12452;&#12523;&#12395;&#12399;&#12289; GUI &#12434;&#20351;&#12387;&#12390;&#20316;&#25104;&#12375;&#12383;&#12418;&#12398;&#12434;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12501;&#12449;&#12452;&#12523;&#12398;&#25313;&#24373;&#23376;&#12399;&#12289;&#19968;&#33324;&#30340;&#12395;&#12399; <code class="filename">.fb</code> &#12414;&#12383;&#12399; <code class="filename">.fbp</code> &#12391;&#12377;&#12290;</p></dd></dl></div></div><div class="sect2" title="3.2. GUI &#12458;&#12503;&#12471;&#12519;&#12531;"><div class="titlepage"><div><div><h3 class="title"><a name="d0e818"></a>3.2. GUI &#12458;&#12503;&#12471;&#12519;&#12531;</h3></div></div></div><p>&#12371;&#12371;&#12391;&#31034;&#12377;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399;&#12289;&#12464;&#12521;&#12501;&#12451;&#12459;&#12523;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12391;&#12398;&#12415;&#20351;&#29992;&#12391;&#12365;&#12414;&#12377;&#12290;</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-look:</strong></span><em class="replaceable"><code>plastic|gtk|native</code></em></span></dt><dd><p>Swing &#12398;&#12523;&#12483;&#12463;&#12539;&#12450;&#12531;&#12489;&#12539;&#12501;&#12451;&#12540;&#12523;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;</p></dd></dl></div><p>
21 </p></div><div class="sect2" title="3.3. &#12486;&#12461;&#12473;&#12488;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12458;&#12503;&#12471;&#12519;&#12531;"><div class="titlepage"><div><div><h3 class="title"><a name="d0e834"></a>3.3. &#12486;&#12461;&#12473;&#12488;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12458;&#12503;&#12471;&#12519;&#12531;</h3></div></div></div><p>&#12371;&#12371;&#12391;&#31034;&#12377;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399;&#12289;&#12486;&#12461;&#12473;&#12488;&#12518;&#12540;&#12470;&#12540;&#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#12391;&#12398;&#12415;&#20351;&#29992;&#12391;&#12365;&#12414;&#12377;&#12290;</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-sortByClass</strong></span></span></dt><dd><p>&#22577;&#21578;&#12373;&#12428;&#12427;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12434;&#12463;&#12521;&#12473;&#21517;&#12391;&#12477;&#12540;&#12488;&#12375;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-include</strong></span> <em class="replaceable"><code>filterFile.xml</code></em></span></dt><dd><p><em class="replaceable"><code>filterFile.xml</code></em> &#12391;&#25351;&#23450;&#12375;&#12383;&#12501;&#12451;&#12523;&#12479;&#12540;&#12395;&#19968;&#33268;&#12375;&#12383;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12398;&#12415;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290;<a class="xref" href="filter.html" title="&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;">8&#31456;<i>&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-exclude</strong></span> <em class="replaceable"><code>filterFile.xml</code></em></span></dt><dd><p><em class="replaceable"><code>filterFile.xml</code></em> &#12391;&#25351;&#23450;&#12375;&#12383;&#12501;&#12451;&#12523;&#12479;&#12540;&#12395;&#19968;&#33268;&#12375;&#12383;&#12496;&#12464;&#26908;&#32034;&#32080;&#26524;&#12399;&#22577;&#21578;&#12373;&#12428;&#12414;&#12379;&#12435;&#12290;<a class="xref" href="filter.html" title="&#31532;8&#31456; &#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;">8&#31456;<i>&#12501;&#12451;&#12523;&#12479;&#12540;&#12501;&#12449;&#12452;&#12523;</i></a> &#12434;&#21442;&#29031;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-onlyAnalyze</strong></span> <em class="replaceable"><code>com.foobar.MyClass,com.foobar.mypkg.*</code></em></span></dt><dd><p>&#12467;&#12531;&#12510;&#21306;&#20999;&#12426;&#12391;&#25351;&#23450;&#12375;&#12383;&#12463;&#12521;&#12473;&#12362;&#12424;&#12403;&#12497;&#12483;&#12465;&#12540;&#12472;&#12398;&#12415;&#12395;&#38480;&#23450;&#12375;&#12390;&#12289;&#12496;&#12464;&#26908;&#20986;&#12398;&#20998;&#26512;&#12434;&#34892;&#12358;&#12424;&#12358;&#12395;&#12375;&#12414;&#12377;&#12290;&#12501;&#12451;&#12523;&#12479;&#12540;&#12392;&#36949;&#12387;&#12390;&#12289;&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#20351;&#12358;&#12392;&#19968;&#33268;&#12375;&#12394;&#12356;&#12463;&#12521;&#12473;&#12362;&#12424;&#12403;&#12497;&#12483;&#12465;&#12540;&#12472;&#12395;&#23550;&#12377;&#12427;&#20998;&#26512;&#12398;&#23455;&#34892;&#12434;&#22238;&#36991;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#22823;&#12365;&#12394;&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;&#12395;&#12362;&#12356;&#12390;&#12289;&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#27963;&#29992;&#12377;&#12427;&#12392;&#20998;&#26512;&#12395;&#12363;&#12363;&#12427;&#26178;&#38291;&#12434;&#22823;&#12365;&#12367;&#21066;&#28187;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;(&#12375;&#12363;&#12375;&#12394;&#12364;&#12425;&#12289;&#12450;&#12503;&#12522;&#12465;&#12540;&#12471;&#12519;&#12531;&#12398;&#20840;&#20307;&#12391;&#23455;&#34892;&#12375;&#12390;&#12356;&#12394;&#12356;&#12383;&#12417;&#12395;&#19981;&#27491;&#30906;&#12394;&#32080;&#26524;&#12434;&#20986;&#12375;&#12390;&#12375;&#12414;&#12358;&#12487;&#12451;&#12486;&#12463;&#12479;&#12364;&#12354;&#12427;&#21487;&#33021;&#24615;&#12418;&#12354;&#12426;&#12414;&#12377;&#12290;) &#12463;&#12521;&#12473;&#12399;&#12497;&#12483;&#12465;&#12540;&#12472;&#12418;&#21547;&#12435;&#12384;&#23436;&#20840;&#12394;&#21517;&#21069;&#12434;&#25351;&#23450;&#12377;&#12427;&#24517;&#35201;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#12414;&#12383;&#12289;&#12497;&#12483;&#12465;&#12540;&#12472;&#12399;&#12289; Java &#12398; <code class="literal">import</code> &#25991;&#12391;&#12497;&#12483;&#12465;&#12540;&#12472;&#19979;&#12398;&#12377;&#12409;&#12390;&#12398;&#12463;&#12521;&#12473;&#12434;&#12452;&#12531;&#12509;&#12540;&#12488;&#12377;&#12427;&#12392;&#12365;&#12392;&#21516;&#12376;&#26041;&#27861;&#12391;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290; (&#12377;&#12394;&#12431;&#12385;&#12289;&#12497;&#12483;&#12465;&#12540;&#12472;&#12398;&#23436;&#20840;&#12394;&#21517;&#21069;&#12395; <code class="literal">.*</code> &#12434;&#20184;&#12369;&#21152;&#12360;&#12383;&#24418;&#12391;&#12377;&#12290;)<code class="literal">.*</code> &#12398;&#20195;&#12431;&#12426;&#12395; <code class="literal">.-</code> &#12434;&#25351;&#23450;&#12377;&#12427;&#12392;&#12289;&#12469;&#12502;&#12497;&#12483;&#12465;&#12540;&#12472;&#12418;&#21547;&#12417;&#12390;&#12377;&#12409;&#12390;&#12364;&#20998;&#26512;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-low</strong></span></span></dt><dd><p>&#12377;&#12409;&#12390;&#12398;&#12496;&#12464;&#12364;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-medium</strong></span></span></dt><dd><p>&#20778;&#20808;&#24230; (&#20013;) &#12362;&#12424;&#12403;&#20778;&#20808;&#24230; (&#39640;) &#12398;&#12496;&#12464;&#12364;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290;&#12371;&#12428;&#12399;&#12289;&#12487;&#12501;&#12457;&#12523;&#12488;&#12398;&#35373;&#23450;&#20516;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-high</strong></span></span></dt><dd><p>&#20778;&#20808;&#24230; (&#39640;) &#12398;&#12496;&#12464;&#12398;&#12415;&#12364;&#22577;&#21578;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-relaxed</strong></span></span></dt><dd><p>&#25163;&#25244;&#12365;&#22577;&#21578;&#12514;&#12540;&#12489;&#12391;&#12377;&#12290;&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12434;&#25351;&#23450;&#12377;&#12427;&#12392;&#12289;&#22810;&#12367;&#12398;&#12487;&#12451;&#12486;&#12463;&#12479;&#12395;&#12362;&#12356;&#12390; &#35492;&#26908;&#20986;&#12434;&#22238;&#36991;&#12377;&#12427;&#12383;&#12417;&#12398;&#12498;&#12517;&#12540;&#12522;&#12473;&#12486;&#12451;&#12483;&#12463;&#27231;&#33021;&#12364;&#25233;&#27490;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-xml</strong></span></span></dt><dd><p>&#12496;&#12464;&#22577;&#21578;&#12364; XML &#12391;&#20316;&#25104;&#12373;&#12428;&#12414;&#12377;&#12290;&#20316;&#25104;&#12373;&#12428;&#12383; XML &#12487;&#12540;&#12479;&#12399; &#12289;&#24460;&#12391; GUI &#12391;&#35211;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399; <span class="command"><strong>-xml:withMessages</strong></span> &#12392;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12414;&#12377;&#12290;&#12371;&#12358;&#12377;&#12427;&#12392; &#20986;&#21147; XML &#12395;&#12399; &#21508;&#12496;&#12464;&#12395;&#38306;&#12375;&#12390;&#20154;&#38291;&#12395;&#35501;&#12416;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#12513;&#12483;&#12475;&#12540;&#12472;&#12364;&#21547;&#12414;&#12428;&#12427;&#12424;&#12358;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12391;&#20316;&#25104;&#12373;&#12428;&#12383; XML &#12501;&#12449;&#12452;&#12523;&#12399; &#22577;&#21578;&#26360;&#12395;&#22793;&#25563;&#12377;&#12427;&#12398;&#12364;&#31777;&#21336;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-html</strong></span></span></dt><dd><p>HTML &#20986;&#21147;&#12364;&#29983;&#25104;&#12373;&#12428;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12391;&#12399; <span class="application">FindBugs</span> &#12399; <code class="filename">default.xsl</code> <a class="ulink" href="http://www.w3.org/TR/xslt" target="_top">XSLT</a> &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12434;&#20351;&#29992;&#12375;&#12390; HTML &#20986;&#21147;&#12434;&#29983;&#25104;&#12375;&#12414;&#12377;: &#12371;&#12398;&#12501;&#12449;&#12452;&#12523;&#12399;&#12289; <code class="filename">findbugs.jar</code> &#12398;&#20013;&#12289;&#12414;&#12383;&#12399;&#12289; <span class="application">FindBugs</span> &#12398;&#12477;&#12540;&#12473;&#37197;&#24067;&#29289;&#12418;&#12375;&#12367;&#12399;&#12496;&#12452;&#12490;&#12522;&#37197;&#24067;&#29289;&#12398;&#20013;&#12395;&#12354;&#12426;&#12414;&#12377;&#12290;&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12395;&#12399;&#12289;&#27425;&#12398;&#12424;&#12358;&#12394;&#12496;&#12522;&#12456;&#12540;&#12471;&#12519;&#12531;&#12418;&#23384;&#22312;&#12375;&#12414;&#12377;&#12290;&#12377;&#12394;&#12431;&#12385;&#12289; <span class="command"><strong>-html:plain.xsl</strong></span> &#12289; <span class="command"><strong>-html:fancy.xsl</strong></span> &#12362;&#12424;&#12403; <span class="command"><strong>-html:fancy-hist.xsl</strong></span> &#12391;&#12377;&#12290;<code class="filename">plain.xsl</code> &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12399; Javascript &#12420; DOM &#12434;&#21033;&#29992;&#12375;&#12414;&#12379;&#12435;&#12290;&#12375;&#12383;&#12364;&#12387;&#12390;&#12289;&#21476;&#12356;Web &#12502;&#12521;&#12454;&#12470;&#20351;&#29992;&#26178;&#12420;&#21360;&#21047;&#26178;&#12395;&#12418;&#27604;&#36611;&#30340;&#12358;&#12414;&#12367;&#34920;&#31034;&#12373;&#12428;&#12427;&#12391;&#12375;&#12423;&#12358;&#12290;<code class="filename">fancy.xsl</code> &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12399; DOM &#12392; Javascript &#12434;&#21033;&#29992;&#12375;&#12390;&#12490;&#12499;&#12466;&#12540;&#12471;&#12519;&#12531;&#12434;&#34892;&#12356;&#12414;&#12377;&#12290;&#12414;&#12383;&#12289;&#12499;&#12472;&#12517;&#12450;&#12523;&#34920;&#31034;&#12395; CSS &#12434;&#20351;&#29992;&#12375;&#12414;&#12377;&#12290;<span class="command"><strong>fancy-hist.xsl</strong></span> &#12399; <span class="command"><strong>fancy.xsl</strong></span> &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12434;&#26356;&#12395;&#36914;&#21270;&#12373;&#12379;&#12383;&#12418;&#12398;&#12391;&#12377;&#12290;DOM &#12420; Javascript &#12434;&#12405;&#12435;&#12384;&#12435;&#12395;&#39366;&#20351;&#12375;&#12390;&#12289;&#12496;&#12464;&#12398;&#19968;&#35239;&#12434;&#21205;&#30340;&#12395;&#12501;&#12451;&#12523;&#12479;&#12522;&#12531;&#12464;&#12375;&#12414;&#12377;&#12290;</p><p>&#12518;&#12540;&#12470;&#12540;&#33258;&#36523;&#12398; XSLT &#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12434;&#29992;&#12356;&#12390; HTML &#12408;&#12398;&#22793;&#25563;&#12434;&#34892;&#12356;&#12383;&#12356;&#22580;&#21512;&#12399;&#12289; <span class="command"><strong>-html:<em class="replaceable"><code>myStylesheet.xsl</code></em></strong></span> &#12398;&#12424;&#12358;&#12395;&#25351;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#12371;&#12371;&#12391;&#12289; <em class="replaceable"><code>myStylesheet.xsl</code></em> &#12399;&#12518;&#12540;&#12470;&#12540;&#12364;&#20351;&#29992;&#12375;&#12383;&#12356;&#12473;&#12479;&#12452;&#12523;&#12471;&#12540;&#12488;&#12398;&#12501;&#12449;&#12452;&#12523;&#21517;&#12391;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-emacs</strong></span></span></dt><dd><p>&#12496;&#12464;&#22577;&#21578;&#12364; Emacs &#24418;&#24335;&#12391;&#20316;&#25104;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-xdocs</strong></span></span></dt><dd><p>&#12496;&#12464;&#22577;&#21578;&#12364; xdoc XML &#24418;&#24335;&#12391;&#20316;&#25104;&#12373;&#12428;&#12414;&#12377;&#12290;Apache Maven&#12391;&#20351;&#29992;&#12391;&#12365;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-output</strong></span> <em class="replaceable"><code>&#12501;&#12449;&#12452;&#12523;&#21517;</code></em></span></dt><dd><p>&#25351;&#23450;&#12375;&#12383;&#12501;&#12449;&#12452;&#12523;&#12395;&#20986;&#21147;&#32080;&#26524;&#12364;&#20316;&#25104;&#12373;&#12428;&#12414;&#12377;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-outputFile</strong></span> <em class="replaceable"><code>&#12501;&#12449;&#12452;&#12523;&#21517;</code></em></span></dt><dd><p>&#12371;&#12398;&#24341;&#25968;&#12399;&#12289;&#20351;&#29992;&#12377;&#12409;&#12365;&#12391;&#12399;&#12354;&#12426;&#12414;&#12379;&#12435;&#12290;&#20195;&#12431;&#12426;&#12395;&#12289; <span class="command"><strong>-output</strong></span> &#12434;&#20351;&#29992;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-nested</strong></span><em class="replaceable"><code>[:true|false]</code></em></span></dt><dd><p>&#12371;&#12398;&#12458;&#12503;&#12471;&#12519;&#12531;&#12399;&#12289;&#12501;&#12449;&#12452;&#12523;&#12420;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12398;&#20013;&#12391;&#20837;&#12428;&#23376;&#12395;&#12394;&#12387;&#12383; jar &#12362;&#12424;&#12403; zip &#12501;&#12449;&#12452;&#12523;&#12434;&#20998;&#26512;&#12377;&#12427;&#12363;&#12393;&#12358;&#12363;&#12434;&#25351;&#23450;&#12375;&#12414;&#12377;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12391;&#12399;&#12289;&#20837;&#12428;&#23376;&#12395;&#12394;&#12387;&#12383; jar &#12362;&#12424;&#12403; zip &#12501;&#12449;&#12452;&#12523;&#12418;&#20998;&#26512;&#12375;&#12414;&#12377;&#12290;&#20837;&#12428;&#23376;&#12395;&#12394;&#12387;&#12383; jar &#12362;&#12424;&#12403; zip &#12501;&#12449;&#12452;&#12523;&#12398;&#20998;&#26512;&#12377;&#12427;&#12434;&#28961;&#21177;&#12395;&#12377;&#12427;&#22580;&#21512;&#12399;&#12289; <span class="command"><strong>-nested:false</strong></span> &#12434;&#12467;&#12510;&#12531;&#12489;&#12521;&#12452;&#12531;&#24341;&#25968;&#12395;&#36861;&#21152;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p></dd><dt><span class="term"><span class="command"><strong>-auxclasspath</strong></span> <em class="replaceable"><code>&#12463;&#12521;&#12473;&#12497;&#12473;</code></em></span></dt><dd><p>&#20998;&#26512;&#26178;&#12395;&#20351;&#29992;&#12377;&#12427;&#35036;&#21161;&#12463;&#12521;&#12473;&#12497;&#12473;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;&#12290;&#20998;&#26512;&#12377;&#12427;&#12503;&#12525;&#12464;&#12521;&#12512;&#12391;&#20351;&#29992;&#12377;&#12427;jar&#12501;&#12449;&#12452;&#12523;&#12420;&#12463;&#12521;&#12473;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12540;&#12434;&#12377;&#12409;&#12390;&#25351;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&#35036;&#21161;&#12463;&#12521;&#12473;&#12497;&#12473;&#12395;&#25351;&#23450;&#12375;&#12383;&#12463;&#12521;&#12473;&#12399;&#20998;&#26512;&#12398;&#23550;&#35937;&#12395;&#12399;&#12394;&#12426;&#12414;&#12379;&#12435;&#12290;</p></dd></dl></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="building.html">&#25147;&#12427;</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="gui.html">&#27425;&#12408;</a></td></tr><tr><td width="40%" align="left" valign="top">&#31532;3&#31456; <span class="application">FindBugs</span>&#8482; &#12398;&#12477;&#12540;&#12523;&#12363;&#12425;&#12398;&#12499;&#12523;&#12489;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">&#12507;&#12540;&#12512;</a></td><td width="40%" align="right" valign="top">&nbsp;&#31532;5&#31456; <span class="application">FindBugs</span> GUI &#12398;&#20351;&#29992;&#26041;&#27861;</td></tr></table></div></body></html>
doc/ja/manual/warning.png less more
Binary diff not shown
+0
-126
doc/links.html less more
0 <html>
1 <head>
2 <title>FindBugs Links</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%"><tr>
9
10
11 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
12 <table width="100%" cellspacing="0" border="0">
13 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
14
15 <tr><td>&nbsp;</td></tr>
16
17 <tr><td><b>Docs and Info</b></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
30
31 <tr><td>&nbsp;</td></tr>
32
33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
34
35 <tr><td>&nbsp;</td></tr>
36
37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39 <tr><td>&nbsp;</td></tr>
40
41 <tr><td><b>Development</b></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
51 </table>
52 </td>
53
54 <td align="left" valign="top">
55
56 <h1>FindBugs Links</h1>
57
58 <p> This page contains links to related projects,
59 including tools that are similar to FindBugs.
60
61 <h2>FindBugs Add-Ons</h2>
62
63 <ul>
64 <li> <a href="http://fb-contrib.sourceforge.net/">fb-contrib</a>: additional bug detectors for use with
65 FindBugs. The lead FindBugs team does not vouch for the relevance, accuracy or wisdom of the warnings
66 generated by any third-party plugin.
67 <li> <a href="http://www.tobject.de/development/findbugs.html">FindBugs Eclipse plugin</a>.&nbsp;
68 This is now included as part of FindBugs.
69 <!--<li> <a href="http://maven-plugins.sourceforge.net/maven-findbugs-plugin/index.html">Maven FindBugs plugin</a>.&nbsp;-->
70 <!--Maven is a Java project management and project comprehension tool.&nbsp;-->
71 <!--The Maven FindBugs plugin allows FindBugs reports to be generated-->
72 <!--from within Maven.-->
73 <li> <a href="http://mojo.codehaus.org/findbugs-maven-plugin/">Maven2 FindBugs plugin</a>.&nbsp;
74 Maven2 is the latest version of the Java project management and project comprehension tool.&nbsp;
75 The Maven2 FindBugs plugin allows FindBugs reports to be generated
76 from within Maven.
77 <li> <a href="http://qalab.sourceforge.net/">QALab</a> records and aggregates
78 the results of static analysis (including FindBugs results)
79 over time.&nbsp; Features include charts of warnings over time
80 and summary reports showing hot spots in the source code.</li>
81 </ul>
82
83 <h2>Similar Tools</h2>
84
85 <h3>Open source tools</h3>
86
87 <ul>
88 <li> <a href="http://artho.com/jlint/index.shtml">JLint</a>.&nbsp; A static analysis tool
89 to find race conditions, locking errors, null pointer uses,
90 and a number of other problems in Java programs.
91 <li> <a href="http://pmd.sourceforge.net/">PMD</a>.&nbsp; PMD scans Java
92 source code for potential problems.
93 <li> <a href="http://checkstyle.sourceforge.net/">Checkstyle</a>.&nbsp;
94 Checkstyle is a style checker for Java.
95 </ul>
96
97 <h3>Commercial tools and services</h3>
98
99 <ul>
100 <li> <a href="http://www.jutils.com">lint4j</a>: lint tool for Java programs
101 <li> <a href="http://www.parasoft.com/">JTest</a>: automatically generates
102 <a href="http://junit.org/">JUnit</a> tests for Java classes.&nbsp;
103 Also checks for many kinds of coding errors.
104 <li> <a href="http://www.sureshotsoftware.com/javalint/">JiveLint</a>.&nbsp; Another
105 lint utility for Java programs.&nbsp; Finds hashcode/equals problems,
106 string reference comparisons, and more.&nbsp; Free 15 day demo.
107 </ul>
108
109
110 <hr> <p>
111 <script language="JavaScript" type="text/javascript">
112 <!---//hide script from old browsers
113 document.write( "Last updated "+ document.lastModified + "." );
114 //end hiding contents --->
115 </script>
116 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
117 <p>
118 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
119
120 </td>
121
122 </tr></table>
123
124 </body>
125 </html>
+0
-85
doc/mailingLists.html less more
0 <html>
1 <head>
2 <title>FindBugs Mailing Lists</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%"><tr>
9
10
11 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
12 <table width="100%" cellspacing="0" border="0">
13 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
14
15 <tr><td>&nbsp;</td></tr>
16
17 <tr><td><b>Docs and Info</b></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
30
31 <tr><td>&nbsp;</td></tr>
32
33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
34
35 <tr><td>&nbsp;</td></tr>
36
37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39 <tr><td>&nbsp;</td></tr>
40
41 <tr><td><b>Development</b></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
51 </table>
52 </td>
53
54 <td align="left" valign="top">
55
56 <h1>FindBugs Mailing Lists</h1>
57
58 <p> There are two mailing lists for FindBugs.
59 <ul>
60 <li> <a href="http://www.cs.umd.edu/mailman/listinfo/findbugs-announce">Findbugs-announce</a>
61 is a low volume (moderated) list for announcements of new releases.
62 </li><li> <a href="http://www.cs.umd.edu/mailman/listinfo/findbugs-discuss">Findbugs-discuss</a>
63 is for discussion of planned features, bugs, development issues, etc.&nbsp; Note
64 that you must be a subscriber in order to post messages to the list.
65 </li>
66 </ul>
67
68
69 <hr> <p>
70 <script language="JavaScript" type="text/javascript">
71 <!---//hide script from old browsers
72 document.write( "Last updated "+ document.lastModified + "." );
73 //end hiding contents --->
74 </script>
75 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
76 <p>
77 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
78
79 </td>
80
81 </tr></table>
82
83 </body>
84 </html>
+0
-124
doc/manual/acknowledgments.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;14.&nbsp;Acknowledgments</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="license.html" title="Chapter&nbsp;13.&nbsp;License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;14.&nbsp;Acknowledgments</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="license.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;14.&nbsp;Acknowledgments"><div class="titlepage"><div><div><h2 class="title"><a name="acknowledgments"></a>Chapter&nbsp;14.&nbsp;Acknowledgments</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="acknowledgments.html#d0e3629">1. Contributors</a></span></dt><dt><span class="sect1"><a href="acknowledgments.html#d0e3752">2. Software Used</a></span></dt></dl></div><div class="sect1" title="1.&nbsp;Contributors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3629"></a>1.&nbsp;Contributors</h2></div></div></div><p><span class="application">FindBugs</span> was originally written by Bill Pugh (<code class="email">&lt;<a class="email" href="mailto:pugh@cs.umd.edu">pugh@cs.umd.edu</a>&gt;</code>).
3 David Hovemeyer (<code class="email">&lt;<a class="email" href="mailto:daveho@cs.umd.edu">daveho@cs.umd.edu</a>&gt;</code>) implemented some of the
4 detectors, added the Swing GUI, and is a co-maintainer.</p><p>Mike Fagan (<code class="email">&lt;<a class="email" href="mailto:mfagan@tde.com">mfagan@tde.com</a>&gt;</code>) contributed the <span class="application">Ant</span> build script,
5 the <span class="application">Ant</span> task, and several enhancements and bug fixes to the GUI.</p><p>Germano Leichsenring contributed Japanese translations of the bug
6 summaries.</p><p>David Li contributed the Emacs bug report format.</p><p>Peter D. Stout contributed recursive detection of Class-Path
7 attributes in analyzed Jar files, German translations of
8 text used in the Swing GUI, and other fixes.</p><p>Peter Friese wrote the <span class="application">FindBugs</span> Eclipse plugin.</p><p>Rohan Lloyd contributed several Mac OS X enhancements,
9 bug detector improvements,
10 and maintains the Fink package for <span class="application">FindBugs</span>.</p><p>Hiroshi Okugawa translated the <span class="application">FindBugs</span> manual and
11 more of the bug summaries into Japanese.</p><p>Phil Crosby enhanced the Eclipse plugin to add a view
12 to display the bug details.</p><p>Dave Brosius fixed a number of bugs, added user preferences
13 to the Swing GUI, improved several bug detectors, and
14 contributed the string concatenation detector.</p><p>Thomas Klaeger contributed a number of bug fixes and
15 bug detector improvements.</p><p>Andrei Loskutov made a number of improvements to the
16 Eclipse plugin.</p><p>Brian Goetz contributed a major refactoring of the
17 visitor classes to improve readability and understandability.</p><p> Pete Angstadt fixed several problems in the Swing GUI.</p><p>Francis Lalonde provided a task resource file for the
18 FindBugs Ant task.</p><p>Garvin LeClaire contributed support for output in
19 Xdocs format, for use by Maven.</p><p>Holger Stenzhorn contributed improved German translations of items
20 in the Swing GUI.</p><p>Juha Knuutila contributed Finnish translations of items
21 in the Swing GUI.</p><p>Tanel Lebedev contributed Estonian translations of items
22 in the Swing GUI.</p><p>Hanai Shisei (ruimo) contributed full Japanese translations of
23 bug messages, and text used in the Swing GUI.</p><p>David Cotton contributed Fresh translations for bug
24 messages and for the Swing GUI.</p><p>Michael Tamm contributed support for the "errorProperty" attribute
25 in the Ant task.</p><p>Thomas Kuehne improved the German translation of the Swing GUI.</p><p>Len Trigg improved source file support for the Emacs output mode.</p><p>Greg Bentz provided a fix for the hashcode/equals detector.</p><p>K. Hashimoto contributed internationalization fixes and several other
26 bug fixes.</p><p>
27 Glenn Boysko contributed support for ignoring specified local
28 variables in the dead local store detector.
29 </p><p>
30 Jay Dunning contributed a detector to find equality comparisons
31 of floating-point values, and overhauled the analysis summary
32 report and its representation in the saved XML format.
33 </p><p>
34 Olivier Parent contributed updated French translations for bug descriptions and
35 Swing GUI.
36 </p><p>
37 Chris Nappin contributed the <code class="filename">plain.xsl</code>
38 stylesheet.
39 </p><p>
40 Etienne Giraudy contributed the <code class="filename">fancy.xsl</code> and <code class="filename">fancy-hist.xsl</code>
41 stylesheets, and made improvements to the <span class="command"><strong>-xml:withMessages</strong></span>
42 option.
43 </p><p>
44 Takashi Okamoto fixed bugs in the project preferences dialog
45 in the Eclipse plugin, and contributed to its internationalization and localization.
46 </p><p>Thomas Einwaller fixed bugs in the project preferences dialog in the Eclipse plugin.</p><p>Jeff Knox contributed support for the warningsProperty attribute
47 in the Ant task.</p><p>Peter Hendriks extended the Eclipse plugin preferences,
48 and fixed a bug related to renaming the Eclipse plugin ID.</p><p>Mark McKay contributed an Ant task to launch the findbugs frame.</p><p>Dieter von Holten (dvholten) contributed
49 some German improvements to findbugs_de.properties.</p><p>If you have contributed to <span class="application">FindBugs</span>, but aren't mentioned above,
50 please send email to <code class="email">&lt;<a class="email" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>&gt;</code> (and also accept
51 our humble apologies).</p></div><div class="sect1" title="2.&nbsp;Software Used"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3752"></a>2.&nbsp;Software Used</h2></div></div></div><p><span class="application">FindBugs</span> uses several open-source software packages, without which its
52 development would have been much more difficult.</p><div class="sect2" title="2.1.&nbsp;BCEL"><div class="titlepage"><div><div><h3 class="title"><a name="d0e3759"></a>2.1.&nbsp;BCEL</h3></div></div></div><p><span class="application">FindBugs</span> includes software developed by the Apache Software Foundation
53 (<a class="ulink" href="http://www.apache.org/" target="_top">http://www.apache.org/</a>).
54 Specifically, it uses the <a class="ulink" href="http://jakarta.apache.org/bcel/" target="_top">Byte Code
55 Engineering Library</a>.</p></div><div class="sect2" title="2.2.&nbsp;ASM"><div class="titlepage"><div><div><h3 class="title"><a name="d0e3772"></a>2.2.&nbsp;ASM</h3></div></div></div><p><span class="application">FindBugs</span> uses the <a class="ulink" href="http://asm.objectweb.org/" target="_top">ASM</a>
56 bytecode framework, which is distributed under the following license:</p><div class="blockquote"><blockquote class="blockquote"><p>
57 Copyright (c) 2000-2005 INRIA, France Telecom
58 All rights reserved.
59 </p><p>
60 Redistribution and use in source and binary forms, with or without
61 modification, are permitted provided that the following conditions
62 are met:
63 </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
64 Redistributions of source code must retain the above copyright
65 notice, this list of conditions and the following disclaimer.
66 </p></li><li class="listitem"><p>
67 Redistributions in binary form must reproduce the above copyright
68 notice, this list of conditions and the following disclaimer in the
69 documentation and/or other materials provided with the distribution.
70 </p></li><li class="listitem"><p>
71 Neither the name of the copyright holders nor the names of its
72 contributors may be used to endorse or promote products derived from
73 this software without specific prior written permission.
74 </p></li></ol></div><p>
75 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
76 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
77 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
78 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
79 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
80 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
81 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
82 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
83 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
84 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
85 THE POSSIBILITY OF SUCH DAMAGE.
86 </p></blockquote></div></div><div class="sect2" title="2.3.&nbsp;DOM4J"><div class="titlepage"><div><div><h3 class="title"><a name="d0e3799"></a>2.3.&nbsp;DOM4J</h3></div></div></div><p><span class="application">FindBugs</span> uses <a class="ulink" href="http://dom4j.org" target="_top">DOM4J</a>, which is
87 distributed under the following license:</p><div class="blockquote"><blockquote class="blockquote"><p>
88 Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
89 </p><p>
90 Redistribution and use of this software and associated documentation
91 ("Software"), with or without modification, are permitted provided that
92 the following conditions are met:
93 </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
94 Redistributions of source code must retain copyright statements and
95 notices. Redistributions must also contain a copy of this document.
96 </p></li><li class="listitem"><p>
97 Redistributions in binary form must reproduce the above copyright
98 notice, this list of conditions and the following disclaimer in the
99 documentation and/or other materials provided with the distribution.
100 </p></li><li class="listitem"><p>
101 The name "DOM4J" must not be used to endorse or promote products
102 derived from this Software without prior written permission
103 of MetaStuff, Ltd. For written permission, please contact
104 <code class="email">&lt;<a class="email" href="mailto:dom4j-info@metastuff.com">dom4j-info@metastuff.com</a>&gt;</code>.
105 </p></li><li class="listitem"><p>
106 Products derived from this Software may not be called "DOM4J" nor may
107 "DOM4J" appear in their names without prior written permission of
108 MetaStuff, Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
109 </p></li><li class="listitem"><p>
110 Due credit should be given to the DOM4J Project (<a class="ulink" href="http://dom4j.org/" target="_top">http://dom4j.org/</a>).
111 </p></li></ol></div><p>
112 THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS''
113 AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
114 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
115 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS
116 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
117 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
118 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
119 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
120 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
121 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
122 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
123 </p></blockquote></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="license.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;13.&nbsp;License&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>
+0
-45
doc/manual/analysisprops.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;9.&nbsp;Analysis Properties</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="filter.html" title="Chapter&nbsp;8.&nbsp;Filter Files"><link rel="next" href="annotations.html" title="Chapter&nbsp;10.&nbsp;Annotations"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;9.&nbsp;Analysis Properties</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="filter.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="annotations.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;9.&nbsp;Analysis Properties"><div class="titlepage"><div><div><h2 class="title"><a name="analysisprops"></a>Chapter&nbsp;9.&nbsp;Analysis Properties</h2></div></div></div><p>
3 <span class="application">FindBugs</span> allows several aspects of the analyses it performs to be
4 customized. System properties are used to configure these options.
5 This chapter describes the configurable analysis options.
6 </p><p>
7 The analysis options have two main purposes. First, they allow you
8 to inform <span class="application">FindBugs</span> about the meaning of methods in your application,
9 so that it can produce more accurate results, or produce fewer
10 false warnings. Second, they allow you to configure the precision
11 of the analysis performed. Reducing analysis precision can save
12 memory and analysis time, at the expense of missing some real bugs,
13 or producing more false warnings.
14 </p><p>
15 The analysis options are set using the <span class="command"><strong>-property</strong></span>
16 command line option. For example:
17 </p><pre class="screen">
18 <code class="prompt">$ </code><span class="command"><strong>findbugs -textui -property "cfg.noprune=true" <em class="replaceable"><code>myApp.jar</code></em></strong></span>
19 </pre><p>
20 </p><p>
21 The list of configurable analysis properties is shown in
22 <a class="xref" href="analysisprops.html#analysisproptable" title="Table&nbsp;9.1.&nbsp;Configurable Analysis Properties">Table&nbsp;9.1, &#8220;Configurable Analysis Properties&#8221;</a>.
23 </p><div class="table"><a name="analysisproptable"></a><p class="title"><b>Table&nbsp;9.1.&nbsp;Configurable Analysis Properties</b></p><div class="table-contents"><table summary="Configurable Analysis Properties" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Property Name</th><th align="left">Value</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">findbugs.assertionmethods</td><td align="left">Comma-separated list of fully qualified method names:
24 e.g., "com.foo.MyClass.checkAssertion"</td><td align="left">This property specifies the names of methods that are used
25 to check program assertions. Specifying these methods allows
26 the null pointer dereference bug detector to avoid reporting
27 false warnings for values which are checked by assertion
28 methods.</td></tr><tr><td align="left">findbugs.de.comment</td><td align="left">true or false</td><td align="left">If true, the DroppedException detector scans source code
29 for empty catch blocks for a comment, and if one is found, does
30 not report a warning.</td></tr><tr><td align="left">findbugs.maskedfields.locals</td><td align="left">true or false</td><td align="left">If true, emit low priority warnings for local variables
31 which obscure fields. Default is false.</td></tr><tr><td align="left">findbugs.nullderef.assumensp</td><td align="left">true or false</td><td align="left">not used
32 (intention: If true, the null dereference detector assumes that any
33 reference value returned from a method or passed to a method
34 in a parameter might be null. Default is false. Note that
35 enabling this property will very likely cause a large number
36 of false warnings to be produced.)</td></tr><tr><td align="left">findbugs.refcomp.reportAll</td><td align="left">true or false</td><td align="left">If true, all suspicious reference comparisons
37 using the == and != operators are reported.&nbsp; If false,
38 only one such warning is issued per method.&nbsp; Default
39 is false.</td></tr><tr><td align="left">findbugs.sf.comment</td><td align="left">true or false</td><td align="left">If true, the SwitchFallthrough detector will only report
40 warnings for cases where the source code does not have a comment
41 containing the words "fall" or "nobreak". (An accurate source
42 path must be used for this feature to work correctly.)
43 This helps find cases where the switch fallthrough is likely
44 to be unintentional.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="filter.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="annotations.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;8.&nbsp;Filter Files&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;10.&nbsp;Annotations</td></tr></table></div></body></html>
+0
-101
doc/manual/annotations.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;10.&nbsp;Annotations</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="analysisprops.html" title="Chapter&nbsp;9.&nbsp;Analysis Properties"><link rel="next" href="rejarForAnalysis.html" title="Chapter&nbsp;11.&nbsp;Using rejarForAnalysis"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;10.&nbsp;Annotations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="analysisprops.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="rejarForAnalysis.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;10.&nbsp;Annotations"><div class="titlepage"><div><div><h2 class="title"><a name="annotations"></a>Chapter&nbsp;10.&nbsp;Annotations</h2></div></div></div><p>
3 <span class="application">FindBugs</span> supports several annotations to express the developer's intent
4 so that FindBugs can issue warnings more appropriately. You need to use
5 Java 5 to use annotations, and must place the annotations.jar and jsr305.jar
6 files in the classpath while compiling your program.
7 </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.CheckForNull</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
8 <p>
9 The annotated element might be null, and uses of the element should check for null.
10 When this annotation is applied to a method it applies to the method return value.
11 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.CheckReturnValue</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Method, Constructor
12 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
13 <span class="command"><strong>priority:</strong></span>The priority of the warning (HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
14 </p><p>
15 <span class="command"><strong>explanation:</strong></span>A textual explaination of why the return value should be checked. Default value:"".
16 </p></dd></dl></div><p>
17 This annotation is used to denote a method whose return value should always be checked after invoking the method.
18 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.DefaultAnnotation</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Package
19 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
20 <span class="command"><strong>value:</strong></span>Annotation class objects. More than one class can be specified.
21 </p><p>
22 <span class="command"><strong>priority:</strong></span>Default priority(HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
23 </p></dd></dl></div><p>
24 Indicates that all members of the class or package should be annotated with the default
25 value of the supplied annotation classes. This would be used for behavior annotations
26 such as @NonNull, @CheckForNull, or @CheckReturnValue. In particular, you can use
27 @DefaultAnnotation(NonNull.class) on a class or package, and then use @Nullable only
28 on those parameters, methods or fields that you want to allow to be null.
29 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.DefaultAnnotationForFields</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Package
30 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
31 <span class="command"><strong>value:</strong></span>Annotation class objects. More than one class can be specified.
32 </p><p>
33 <span class="command"><strong>priority:</strong></span>Default priority(HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
34 </p></dd></dl></div><p>
35 This is same as the DefaultAnnotation except it only applys to fields.
36 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.DefaultAnnotationForMethods</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Package
37 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
38 <span class="command"><strong>value:</strong></span>Annotation class objects. More than one class can be specified.
39 </p><p>
40 <span class="command"><strong>priority:</strong></span>Default priority(HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
41 </p></dd></dl></div><p>
42 This is same as the DefaultAnnotation except it only applys to methods.
43 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.DefaultAnnotationForParameters</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Package
44 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
45 <span class="command"><strong>value:</strong></span>Annotation class objects. More than one class can be specified.
46 </p><p>
47 <span class="command"><strong>priority:</strong></span>Default priority(HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
48 </p></dd></dl></div><p>
49 This is same as the DefaultAnnotation except it only applys to method parameters.
50 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.NonNull</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
51 <p>
52 The annotated element must not be null.
53 Annotated fields must not be null after construction has completed. Annotated methods must have non-null return values.
54 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.Nullable</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
55 <p>
56 The annotated element could be null under some circumstances. In general, this means
57 developers will have to read the documentation to determine when a null value is
58 acceptable and whether it is neccessary to check for a null value. FindBugs will
59 treat the annotated items as though they had no annotation.
60 </p><p>
61 In pratice this annotation is useful only for overriding an overarching NonNull
62 annotation.
63 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.OverrideMustInvoke</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Method
64 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
65 <span class="command"><strong>value:</strong></span>Specify when the super invocation should be
66 performed (FIRST, ANYTIME, LAST). Default value:ANYTIME.
67 </p></dd></dl></div><p>
68 Used to annotate a method that, if overridden, must (or should) be invoke super
69 in the overriding method. Examples of such methods include finalize() and clone().
70 The argument to the method indicates when the super invocation should occur:
71 at any time, at the beginning of the overriding method, or at the end of the overriding method.
72 (This anotation is not implmemented in FindBugs as of September 8, 2006).
73 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.PossiblyNull</strong></span></span></dt><dd><p>
74 This annotation is deprecated. Use CheckForNull instead.
75 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.SuppressWarnings</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Type, Field, Method, Parameter, Constructor, Package
76 <div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>[Parameter]</strong></span></span></dt><dd><p>
77 <span class="command"><strong>value:</strong></span>The name of the warning. More than one name can be specified.
78 </p><p>
79 <span class="command"><strong>justification:</strong></span>Reason why the warning should be ignored. Default value:"".
80 </p></dd></dl></div><p>
81 The set of warnings that are to be suppressed by the compiler in the annotated element.
82 Duplicate names are permitted. The second and successive occurrences of a name are ignored.
83 The presence of unrecognized warning names is <span class="emphasis"><em>not</em></span> an error: Compilers
84 must ignore any warning names they do not recognize. They are, however, free to emit a
85 warning if an annotation contains an unrecognized warning name. Compiler vendors should
86 document the warning names they support in conjunction with this annotation type. They
87 are encouraged to cooperate to ensure that the same names work across multiple compilers.
88 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.UnknownNullness</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
89 <p>
90 Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
91 </p></dd><dt><span class="term"><span class="command"><strong>edu.umd.cs.findbugs.annotations.UnknownNullness</strong></span></span></dt><dd><span class="command"><strong>[Target]</strong></span> Field, Method, Parameter
92 <p>
93 Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
94 </p></dd></dl></div><p>
95 <span class="application">FindBugs</span> also supports the following annotations:
96 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">net.jcip.annotations.GuardedBy</li><li class="listitem">net.jcip.annotations.Immutable</li><li class="listitem">net.jcip.annotations.NotThreadSafe</li><li class="listitem">net.jcip.annotations.ThreadSafe</li></ul></div><p>
97 </p><p>
98 You can refer the JCIP annotation <a class="ulink" href="http://jcip.net/annotations/doc/index.html" target="_top">
99 API documentation</a> at <a class="ulink" href="http://jcip.net/" target="_top">Java Concurrency in Practice</a>.
100 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="analysisprops.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="rejarForAnalysis.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;9.&nbsp;Analysis Properties&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;11.&nbsp;Using rejarForAnalysis</td></tr></table></div></body></html>
+0
-214
doc/manual/anttask.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;6.&nbsp;Using the FindBugs&#8482; Ant task</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="gui.html" title="Chapter&nbsp;5.&nbsp;Using the FindBugs GUI"><link rel="next" href="eclipse.html" title="Chapter&nbsp;7.&nbsp;Using the FindBugs&#8482; Eclipse plugin"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;6.&nbsp;Using the <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> task</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gui.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="eclipse.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;6.&nbsp;Using the FindBugs&#8482; Ant task"><div class="titlepage"><div><div><h2 class="title"><a name="anttask"></a>Chapter&nbsp;6.&nbsp;Using the <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> task</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="anttask.html#d0e1205">1. Installing the <span class="application">Ant</span> task</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1243">2. Modifying build.xml</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1314">3. Executing the task</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1339">4. Parameters</a></span></dt></dl></div><p>
3 This chapter describes how to integrate <span class="application">FindBugs</span> into a build script
4 for <a class="ulink" href="http://ant.apache.org/" target="_top"><span class="application">Ant</span></a>, which is a popular Java build
5 and deployment tool. Using the <span class="application">FindBugs</span> <span class="application">Ant</span> task, your build script can
6 automatically run <span class="application">FindBugs</span> on your Java code.
7 </p><p>
8 The <span class="application">Ant</span> task was generously contributed by Mike Fagan.
9 </p><div class="sect1" title="1.&nbsp;Installing the Ant task"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1205"></a>1.&nbsp;Installing the <span class="application">Ant</span> task</h2></div></div></div><p>
10 To install the <span class="application">Ant</span> task, simply copy <code class="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbugs-ant.jar</code>
11 into the <code class="filename">lib</code> subdirectory of your <span class="application">Ant</span> installation.
12
13 </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is strongly recommended that you use the <span class="application">Ant</span> task with the version
14 of <span class="application">FindBugs</span> it was included with. We do not guarantee that the <span class="application">Ant</span> task Jar file
15 will work with any version of <span class="application">FindBugs</span> other than the one it was included with.</p></td></tr></table></div><p>
16 </p></div><div class="sect1" title="2.&nbsp;Modifying build.xml"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1243"></a>2.&nbsp;Modifying build.xml</h2></div></div></div><p>
17 To incorporate <span class="application">FindBugs</span> into <code class="filename">build.xml</code> (the build script
18 for <span class="application">Ant</span>), you first need to add a task definition. This should appear as follows:
19
20 </p><pre class="screen">
21 &lt;taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/&gt;
22 </pre><p>
23
24 The task definition specifies that when a <code class="literal">findbugs</code> element is
25 seen in <code class="filename">build.xml</code>, it should use the indicated class to execute the task.
26 </p><p>
27 After you have added the task definition, you can define a target
28 which uses the <code class="literal">findbugs</code> task. Here is an example
29 which could be added to the <code class="filename">build.xml</code> for the
30 Apache <a class="ulink" href="http://jakarta.apache.org/bcel/" target="_top">BCEL</a> library.
31
32 </p><pre class="screen">
33 &lt;property name="findbugs.home" value="/export/home/daveho/work/findbugs" /&gt;
34
35 &lt;target name="findbugs" depends="jar"&gt;
36 &lt;findbugs home="${findbugs.home}"
37 output="xml"
38 outputFile="bcel-fb.xml" &gt;
39 &lt;auxClasspath path="${basedir}/lib/Regex.jar" /&gt;
40 &lt;sourcePath path="${basedir}/src/java" /&gt;
41 &lt;class location="${basedir}/bin/bcel.jar" /&gt;
42 &lt;/findbugs&gt;
43 &lt;/target&gt;
44 </pre><p>
45
46 The <code class="literal">findbugs</code> element must have the <code class="literal">home</code>
47 attribute set to the directory in which <span class="application">FindBugs</span> is installed; in other words,
48 <em class="replaceable"><code>$FINDBUGS_HOME</code></em>. See <a class="xref" href="installing.html" title="Chapter&nbsp;2.&nbsp;Installing FindBugs&#8482;">Chapter&nbsp;2, <i>Installing <span class="application">FindBugs</span>&#8482;</i></a>.
49 </p><p>
50 This target will execute <span class="application">FindBugs</span> on <code class="filename">bcel.jar</code>, which is the
51 Jar file produced by BCEL's build script. (By making it depend on the "jar"
52 target, we ensure that the library is fully compiled before running <span class="application">FindBugs</span> on it.)
53 The output of <span class="application">FindBugs</span> will be saved in XML format to a file called
54 <code class="filename">bcel-fb.xml</code>.
55 An auxiliary Jar file, <code class="filename">Regex.jar</code>, is added to the aux classpath,
56 because it is referenced by the main BCEL library. A source path is specified
57 so that the saved bug data will have accurate references to the BCEL source code.
58 </p></div><div class="sect1" title="3.&nbsp;Executing the task"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1314"></a>3.&nbsp;Executing the task</h2></div></div></div><p>
59 Here is an example of invoking <span class="application">Ant</span> from the command line, using the <code class="literal">findbugs</code>
60 target defined above.
61
62 </p><pre class="screen">
63 <code class="prompt">[daveho@noir]$</code> <span class="command"><strong>ant findbugs</strong></span>
64 Buildfile: build.xml
65
66 init:
67
68 compile:
69
70 examples:
71
72 jar:
73
74 findbugs:
75 [findbugs] Running FindBugs...
76 [findbugs] Bugs were found
77 [findbugs] Output saved to bcel-fb.xml
78
79 BUILD SUCCESSFUL
80 Total time: 35 seconds
81 </pre><p>
82
83 In this case, because we saved the bug results in an XML file, we can
84 use the <span class="application">FindBugs</span> GUI to view the results; see <a class="xref" href="running.html" title="Chapter&nbsp;4.&nbsp;Running FindBugs&#8482;">Chapter&nbsp;4, <i>Running <span class="application">FindBugs</span>&#8482;</i></a>.
85 </p></div><div class="sect1" title="4.&nbsp;Parameters"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1339"></a>4.&nbsp;Parameters</h2></div></div></div><p>This section describes the parameters that may be specified when
86 using the <span class="application">FindBugs</span> task.
87
88 </p><div class="variablelist"><dl><dt><span class="term"><code class="literal">class</code></span></dt><dd><p>
89 A optional nested element specifying which classes to analyze. The <code class="literal">class</code>
90 element must specify a <code class="literal">location</code> attribute which names the
91 archive file (jar, zip, etc.), directory, or class file to be analyzed. Multiple <code class="literal">class</code>
92 elements may be specified as children of a single <code class="literal">findbugs</code> element.
93 </p><p>In addition to or instead of specifying a <code class="literal">class</code> element,
94 the <span class="application">FindBugs</span> task can contain one or more <code class="literal">fileset</code> element(s) that
95 specify files to be analyzed.
96 For example, you might use a fileset to specify that all of the jar files in a directory
97 should be analyzed.
98 </p></dd><dt><span class="term"><code class="literal">auxClasspath</code></span></dt><dd><p>
99 An optional nested element which specifies a classpath (Jar files or directories)
100 containing classes used by the analyzed library or application, but which
101 you don't want to analyze. It is specified the same way as
102 <span class="application">Ant</span>'s <code class="literal">classpath</code> element for the Java task.
103 </p></dd><dt><span class="term"><code class="literal">sourcePath</code></span></dt><dd><p>
104 An optional nested element which specifies a source directory path
105 containing source files used to compile the Java code being analyzed.
106 By specifying a source path, any generated XML bug output will have
107 complete source information, which allows later viewing in the
108 GUI.
109 </p></dd><dt><span class="term"><code class="literal">home</code></span></dt><dd><p>
110 A required attribute.
111 It must be set to the name of the directory where <span class="application">FindBugs</span> is installed.
112 </p></dd><dt><span class="term"><code class="literal">quietErrors</code></span></dt><dd><p>
113 An optional boolean attribute.
114 If true, reports of serious analysis errors and missing classes will
115 be suppressed in the <span class="application">FindBugs</span> output. Default is false.
116 </p></dd><dt><span class="term"><code class="literal">reportLevel</code></span></dt><dd><p>
117 An optional attribute. It specifies
118 the confidence/priority threshold for reporting issues. If set to "low", confidence is not used to filter bugs.
119 If set to "medium" (the default), low confidence issues are supressed.
120 If set to "high", only high confidence bugs are reported.
121 </p></dd><dt><span class="term"><code class="literal">output</code></span></dt><dd><p>
122 Optional attribute.
123 It specifies the output format. If set to "xml" (the default), output
124 is in XML format.
125 If set to "xml:withMessages", output is in XML format augmented with
126 human-readable messages. (You should use this format if you plan
127 to generate a report using an XSL stylesheet.)
128 If set to "html", output is in HTML formatted (default stylesheet is default.xsl).
129 If set to "text", output is in ad-hoc text format.
130 If set to "emacs", output is in <a class="ulink" href="http://www.gnu.org/software/emacs/" target="_top">Emacs</a> error message format.
131 If set to "xdocs", output is xdoc XML for use with Apache Maven.
132 </p></dd><dt><span class="term"><code class="literal">stylesheet</code></span></dt><dd><p>
133 Optional attribute.
134 It specifies the stylesheet to use to generate html output when the output is set to html.
135 Stylesheets included in the FindBugs distribution include default.xsl, fancy.xsl, fancy-hist.xsl, plain.xsl, and summary.xsl.
136 The default value, if no stylesheet attribute is provided, is default.xsl.
137
138 </p></dd><dt><span class="term"><code class="literal">sort</code></span></dt><dd><p>
139 Optional attribute. If the <code class="literal">output</code> attribute
140 is set to "text", then the <code class="literal">sort</code> attribute specifies
141 whether or not reported bugs are sorted by class. Default is true.
142 </p></dd><dt><span class="term"><code class="literal">outputFile</code></span></dt><dd><p>
143 Optional attribute. If specified, names the output file in which the
144 <span class="application">FindBugs</span> output will be saved. By default, the output is displayed
145 directly by <span class="application">Ant</span>.
146 </p></dd><dt><span class="term"><code class="literal">debug</code></span></dt><dd><p>
147 Optional boolean attribute. If set to true, <span class="application">FindBugs</span> prints diagnostic
148 information about which classes are being analyzed, and which bug pattern
149 detectors are being run. Default is false.
150 </p></dd><dt><span class="term"><code class="literal">effort</code></span></dt><dd><p>
151 Set the analysis effort level. The value specified should be
152 one of <code class="literal">min</code>, <code class="literal">default</code>,
153 or <code class="literal">max</code>. See <a class="xref" href="running.html#commandLineOptions" title="3.&nbsp;Command-line Options">Section&nbsp;3, &#8220;Command-line Options&#8221;</a>
154 for more information about setting the analysis level.
155 </p></dd><dt><span class="term"><code class="literal">conserveSpace</code></span></dt><dd><p>Synonym for effort="min".</p></dd><dt><span class="term"><code class="literal">workHard</code></span></dt><dd><p>Synonym for effort="max".</p></dd><dt><span class="term"><code class="literal">visitors</code></span></dt><dd><p>
156 Optional attribute. It specifies a comma-separated list of bug detectors
157 which should be run. The bug detectors are specified by their class names,
158 without any package qualification. By default, all detectors which are
159 not disabled by default are run.
160 </p></dd><dt><span class="term"><code class="literal">omitVisitors</code></span></dt><dd><p>
161 Optional attribute. It is like the <code class="literal">visitors</code> attribute,
162 except it specifies detectors which will <span class="emphasis"><em>not</em></span> be run.
163 </p></dd><dt><span class="term"><code class="literal">excludeFilter</code></span></dt><dd><p>
164 Optional attribute. It specifies the filename of a filter specifying bugs
165 to exclude from being reported. See <a class="xref" href="filter.html" title="Chapter&nbsp;8.&nbsp;Filter Files">Chapter&nbsp;8, <i>Filter Files</i></a>.
166 </p></dd><dt><span class="term"><code class="literal">includeFilter</code></span></dt><dd><p>
167 Optional attribute. It specifies the filename of a filter specifying
168 which bugs are reported. See <a class="xref" href="filter.html" title="Chapter&nbsp;8.&nbsp;Filter Files">Chapter&nbsp;8, <i>Filter Files</i></a>.
169 </p></dd><dt><span class="term"><code class="literal">projectFile</code></span></dt><dd><p>
170 Optional attribute. It specifies the name of a project file.
171 Project files are created by the <span class="application">FindBugs</span> GUI, and specify classes,
172 aux classpath entries, and source directories. By naming a project,
173 you don't need to specify any <code class="literal">class</code> elements,
174 nor do you need to specify <code class="literal">auxClasspath</code> or
175 <code class="literal">sourcePath</code> attributes.
176 See <a class="xref" href="running.html" title="Chapter&nbsp;4.&nbsp;Running FindBugs&#8482;">Chapter&nbsp;4, <i>Running <span class="application">FindBugs</span>&#8482;</i></a> for how to create a project.
177 </p></dd><dt><span class="term"><code class="literal">jvmargs</code></span></dt><dd><p>
178 Optional attribute. It specifies any arguments that should be passed
179 to the Java virtual machine used to run <span class="application">FindBugs</span>. You may need to
180 use this attribute to specify flags to increase the amount of memory
181 the JVM may use if you are analyzing a very large program.
182 </p></dd><dt><span class="term"><code class="literal">systemProperty</code></span></dt><dd><p>
183 Optional nested element. If specified, defines a system property.
184 The <code class="literal">name</code> attribute specifies the name of the
185 system property, and the <code class="literal">value</code> attribute specifies
186 the value of the system property.
187 </p></dd><dt><span class="term"><code class="literal">timeout</code></span></dt><dd><p>
188 Optional attribute. It specifies the amount of time, in milliseconds,
189 that the Java process executing <span class="application">FindBugs</span> may run before it is
190 assumed to be hung and is terminated. The default is 600,000
191 milliseconds, which is ten minutes. Note that for very large
192 programs, <span class="application">FindBugs</span> may require more than ten minutes to complete its
193 analysis.
194 </p></dd><dt><span class="term"><code class="literal">failOnError</code></span></dt><dd><p>
195 Optional boolean attribute. Whether to abort the build process if there is an
196 error running <span class="application">FindBugs</span>. Defaults to "false"
197 </p></dd><dt><span class="term"><code class="literal">errorProperty</code></span></dt><dd><p>
198 Optional attribute which specifies the name of a property that
199 will be set to "true" if an error occurs while running <span class="application">FindBugs</span>.
200 </p></dd><dt><span class="term"><code class="literal">warningsProperty</code></span></dt><dd><p>
201 Optional attribute which specifies the name of a property
202 that will be set to "true" if any warnings are reported by
203 <span class="application">FindBugs</span> on the analyzed program.
204 </p></dd><dt><span class="term"><code class="literal">userPreferencesFile</code></span></dt><dd><p>
205 Optional attribute. Set the path of the user preferences file to use, which might override some of the options abobe.
206 Specifying <code class="literal">userPreferencesFile</code> as first argument would mean some later
207 options will override them, as last argument would mean they will override some previous options).
208 This rationale behind this option is to reuse FindBugs Eclipse project settings for command
209 line execution.
210 </p></dd></dl></div><p>
211
212
213 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gui.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="eclipse.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;5.&nbsp;Using the <span class="application">FindBugs</span> GUI&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;7.&nbsp;Using the <span class="application">FindBugs</span>&#8482; Eclipse plugin</td></tr></table></div></body></html>
+0
-123
doc/manual/building.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;3.&nbsp;Building FindBugs&#8482; from Source</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="installing.html" title="Chapter&nbsp;2.&nbsp;Installing FindBugs&#8482;"><link rel="next" href="running.html" title="Chapter&nbsp;4.&nbsp;Running FindBugs&#8482;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;3.&nbsp;Building <span class="application">FindBugs</span>&#8482; from Source</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="installing.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="running.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;3.&nbsp;Building FindBugs&#8482; from Source"><div class="titlepage"><div><div><h2 class="title"><a name="building"></a>Chapter&nbsp;3.&nbsp;Building <span class="application">FindBugs</span>&#8482; from Source</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="building.html#d0e173">1. Prerequisites</a></span></dt><dt><span class="sect1"><a href="building.html#d0e262">2. Extracting the Source Distribution</a></span></dt><dt><span class="sect1"><a href="building.html#d0e275">3. Modifying <code class="filename">local.properties</code></a></span></dt><dt><span class="sect1"><a href="building.html#d0e333">4. Running <span class="application">Ant</span></a></span></dt><dt><span class="sect1"><a href="building.html#d0e427">5. Running <span class="application">FindBugs</span>&#8482; from a source directory</a></span></dt></dl></div><p>
3 This chapter describes how to build <span class="application">FindBugs</span> from source code. Unless you are
4 interesting in modifying <span class="application">FindBugs</span>, you will probably want to skip to the
5 <a class="link" href="running.html" title="Chapter&nbsp;4.&nbsp;Running FindBugs&#8482;">next chapter</a>.
6 </p><div class="sect1" title="1.&nbsp;Prerequisites"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e173"></a>1.&nbsp;Prerequisites</h2></div></div></div><p>
7 To compile <span class="application">FindBugs</span> from source, you will need the following:
8 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
9 The <a class="ulink" href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3-source.zip?download" target="_top"><span class="application">FindBugs</span> source distribution</a>
10 </p></li><li class="listitem"><p>
11 <a class="ulink" href="http://java.sun.com/j2se/" target="_top">JDK 1.5.0 or later</a>
12 </p></li><li class="listitem"><p>
13 <a class="ulink" href="http://ant.apache.org/" target="_top">Apache <span class="application">Ant</span></a>, version 1.6.3 or later
14 </p></li></ul></div><p>
15 </p><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>
16 The version of <span class="application">Ant</span> included as <code class="filename">/usr/bin/ant</code> on
17 Redhat Linux systems will <span class="emphasis"><em>not</em></span> work for compiling
18 <span class="application">FindBugs</span>. We recommend you install a binary distribution of <span class="application">Ant</span>
19 downloaded from the <a class="ulink" href="http://ant.apache.org/" target="_top"><span class="application">Ant</span> website</a>.
20 Make sure that when you run <span class="application">Ant</span> your <em class="replaceable"><code>JAVA_HOME</code></em>
21 environment variable points to the directory in which you installed
22 JDK 1.5 (or later).
23 </p></td></tr></table></div><p>
24 If you want to be able to generate formatted versions of the <span class="application">FindBugs</span> documentation,
25 you will also need the following software:
26 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
27 The <a class="ulink" href="http://docbook.sourceforge.net/projects/xsl/index.html" target="_top">DocBook XSL Stylesheets</a>.
28 These are required to convert the <span class="application">FindBugs</span> manual into HTML format.
29 </p></li><li class="listitem"><p>
30 The <a class="ulink" href="http://saxon.sourceforge.net/" target="_top"><span class="application">Saxon</span> XSLT Processor</a>.
31 (Also required for converting the <span class="application">FindBugs</span> manual to HTML.)
32 </p></li></ul></div><p>
33 </p></div><div class="sect1" title="2.&nbsp;Extracting the Source Distribution"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e262"></a>2.&nbsp;Extracting the Source Distribution</h2></div></div></div><p>
34 After you download the source distribution, you'll need to extract it into
35 a working directory. A typical command to do this is:
36
37 </p><pre class="screen">
38 <code class="prompt">$ </code><span class="command"><strong>unzip findbugs-2.0.3-source.zip</strong></span>
39 </pre><p>
40
41 </p></div><div class="sect1" title="3.&nbsp;Modifying local.properties"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e275"></a>3.&nbsp;Modifying <code class="filename">local.properties</code></h2></div></div></div><p>
42 If you intend to build the FindBugs documentation,
43 you will need to modify the <code class="filename">local.properties</code> file
44 used by the <a class="ulink" href="http://ant.apache.org/" target="_top"><span class="application">Ant</span></a>
45 <code class="filename">build.xml</code> file to build <span class="application">FindBugs</span>.
46 If you do not want to build the FindBugs documentation, then you
47 can ignore this file.
48 </p><p>
49 The <code class="filename">local.properties</code> overrides definitions
50 in the <code class="filename">build.properties</code> file.
51 The <code class="filename">build.properties</code> file looks something like this:
52 </p><pre class="programlisting">
53
54 # User Configuration:
55 # This section must be modified to reflect your system.
56
57 local.software.home =/export/home/daveho/linux
58
59 # Set this to the directory containing the DocBook Modular XSL Stylesheets
60 # from http://docbook.sourceforge.net/projects/xsl/
61
62 xsl.stylesheet.home =${local.software.home}/docbook/docbook-xsl-1.71.1
63
64 # Set this to the directory where Saxon (http://saxon.sourceforge.net/)
65 # is installed.
66
67 saxon.home =${local.software.home}/java/saxon-6.5.5
68
69 </pre><p>
70 </p><p>
71 The <code class="varname">xsl.stylesheet.home</code> property specifies the full
72 path to the directory where you have installed the
73 <a class="ulink" href="http://docbook.sourceforge.net/projects/xsl/" target="_top">DocBook Modular XSL
74 Stylesheets</a>. You only need to specify this property if you will be
75 generating the <span class="application">FindBugs</span> documentation.
76 </p><p>
77 The <code class="varname">saxon.home</code> property is the full path to the
78 directory where you installed the <a class="ulink" href="http://saxon.sourceforge.net/" target="_top"><span class="application">Saxon</span> XSLT Processor</a>.
79 You only need to specify this property if you will be
80 generating the <span class="application">FindBugs</span> documentation.
81 </p></div><div class="sect1" title="4.&nbsp;Running Ant"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e333"></a>4.&nbsp;Running <span class="application">Ant</span></h2></div></div></div><p>
82 Once you have extracted the source distribution,
83 made sure that <span class="application">Ant</span> is installed,
84 modified <code class="filename">build.properties</code> (optional),
85 and configured the tools (such as <span class="application">Saxon</span>),
86 you are ready to build <span class="application">FindBugs</span>. Invoking <span class="application">Ant</span> is a simple matter
87 of running the command
88 </p><pre class="screen">
89 <code class="prompt">$ </code><span class="command"><strong>ant <em class="replaceable"><code>target</code></em></strong></span>
90 </pre><p>
91 where <em class="replaceable"><code>target</code></em> is one of the following:
92 </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>build</strong></span></span></dt><dd><p>
93 This target compiles the code for <span class="application">FindBugs</span>. It is the default target.
94 </p></dd><dt><span class="term"><span class="command"><strong>docs</strong></span></span></dt><dd><p>
95 This target formats the documentation. (It also compiles some of
96 the source code as a side-effect.)
97 </p></dd><dt><span class="term"><span class="command"><strong>runjunit</strong></span></span></dt><dd><p>
98 This target compiles and runs the internal JUnit tests included
99 in <span class="application">FindBugs</span>. It will print an error message if any unit
100 tests fail.
101 </p></dd><dt><span class="term"><span class="command"><strong>bindist</strong></span></span></dt><dd><p>
102 Builds a binary distribution of <span class="application">FindBugs</span>.
103 The target creates both <code class="filename">.zip</code> and
104 <code class="filename">.tar.gz</code> archives.
105 </p></dd></dl></div><p>
106 </p><p>
107 After running an <span class="application">Ant</span> command, you should see output similar to
108 the following (after some other messages regarding the tasks that
109 <span class="application">Ant</span> is running):
110 </p><pre class="screen">
111 <code class="computeroutput">
112 BUILD SUCCESSFUL
113 Total time: 17 seconds
114 </code>
115 </pre><p>
116 </p></div><div class="sect1" title="5.&nbsp;Running FindBugs&#8482; from a source directory"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e427"></a>5.&nbsp;Running <span class="application">FindBugs</span>&#8482; from a source directory</h2></div></div></div><p>
117 The <span class="application">Ant</span> build script for <span class="application">FindBugs</span> is written such that after
118 building the <span class="command"><strong>build</strong></span> target, the working directory
119 is set up just like a binary distribution. So, the information about
120 running <span class="application">FindBugs</span> in <a class="xref" href="running.html" title="Chapter&nbsp;4.&nbsp;Running FindBugs&#8482;">Chapter&nbsp;4, <i>Running <span class="application">FindBugs</span>&#8482;</i></a>
121 applies to source distributions, too.
122 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="installing.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="running.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;2.&nbsp;Installing <span class="application">FindBugs</span>&#8482;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;4.&nbsp;Running <span class="application">FindBugs</span>&#8482;</td></tr></table></div></body></html>
+0
-421
doc/manual/datamining.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;12.&nbsp;Data mining of bugs with FindBugs&#8482;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="rejarForAnalysis.html" title="Chapter&nbsp;11.&nbsp;Using rejarForAnalysis"><link rel="next" href="license.html" title="Chapter&nbsp;13.&nbsp;License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;12.&nbsp;Data mining of bugs with <span class="application">FindBugs</span>&#8482;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rejarForAnalysis.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="license.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;12.&nbsp;Data mining of bugs with FindBugs&#8482;"><div class="titlepage"><div><div><h2 class="title"><a name="datamining"></a>Chapter&nbsp;12.&nbsp;Data mining of bugs with <span class="application">FindBugs</span>&#8482;</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="datamining.html#commands">1. Commands</a></span></dt><dt><span class="sect1"><a href="datamining.html#examples">2. Examples</a></span></dt><dt><span class="sect1"><a href="datamining.html#antexample">3. Ant example</a></span></dt></dl></div><p>
3 FindBugs incorporates an ability to perform sophisticated queries on bug
4 databases and track warnings across multiple versions of code being
5 studied, allowing you to do things such as seeing when a bug was first introduced, examining
6 just the warnings that have been introduced since the last release, or graphing the number
7 of infinite recursive loops in your code over time.</p><p>
8 These techniques all depend upon the XML format used by FindBugs for storing warnings.
9 These XML files usually contain just the warnings from one particular analysis run, but
10 they can also store the results from analyzing a sequence of software builds or versions.
11 </p><p>
12 Any FindBugs XML bug database contains a version name and timestamp.
13 FindBugs tries to compute a timestamp from the timestamps of the files that
14 are analyzed (e.g., the timestamp is intended to be the time the class files
15 were generated, not analyzed). Each bug database also contains a version name.
16 Both the version name and timestamp can be set manually using the
17 <span class="command"><strong>setBugDatabaseInfo</strong></span> (<a class="xref" href="datamining.html#setBugDatabaseInfo" title="1.7.&nbsp;setBugDatabaseInfo">Section&nbsp;1.7, &#8220;setBugDatabaseInfo&#8221;</a>) command.
18 </p><p>A multiversion bug database assigns a sequence number to each version of
19 the analyzed code. These sequence numbers are simply successive integers,
20 starting at 0 (e.g., a bug database for 4 versions of the code will contain
21 versions 0..3). The bug database will also record the name and timestamp for
22 each version. The <span class="command"><strong>filterBugs</strong></span> command allows you to refer
23 to a version by sequence number, name or timestamp.</p><p>
24 You can take a sequence (or pair) of single version bug databases and create
25 from them a multiversion bug database, or combine a multiversion bug database
26 with a sequence of later single-version bug databases.</p><p>
27 Some of these commands can be invoked as ant tasks. See below for specifics
28 on how to invoke them and what attributes and arguments they take. All of
29 the examples assume that the <code class="literal">findbugs.lib</code>
30 <code class="literal">refid</code> is set correctly. Here is one way to set it:
31 </p><pre class="programlisting">
32
33 &lt;!-- findbugs task definition --&gt;
34 &lt;property name="findbugs.home" value="/your/path/to/findbugs" /&gt;
35 &lt;path id="findbugs.lib"&gt;
36 &lt;fileset dir="${findbugs.home}/lib"&gt;
37 &lt;include name="findbugs-ant.jar"/&gt;
38 &lt;/fileset&gt;
39 &lt;/path&gt;
40
41 </pre><div class="sect1" title="1.&nbsp;Commands"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="commands"></a>1.&nbsp;Commands</h2></div></div></div><p>
42 All tools for FindBugs data mining are can be invoked from the command line,
43 and some of the more useful tools can also be invoked from an
44 ant build file.</p><p>
45 Briefly, the command-line tools are:</p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#unionBugs" title="1.1.&nbsp;unionBugs">unionBugs</a></strong></span></span></dt><dd><p>
46 combine the results from separate analysis of disjoint
47 classes
48 </p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#computeBugHistory" title="1.2.&nbsp;computeBugHistory">computeBugHistory</a></strong></span></span></dt><dd><p>Merge bug warnings from multiple versions of
49 analyzed code into
50 a single multiversion bug database. This can either be used
51 to add more versions to an existing multiversion database,
52 or to create a multiversion database from a sequence of single version
53 bug warning databases.</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#setBugDatabaseInfo" title="1.7.&nbsp;setBugDatabaseInfo">setBugDatabaseInfo</a></strong></span></span></dt><dd><p>Set information such as the revision name or
54 timestamp in an XML bug database</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#listBugDatabaseInfo" title="1.8.&nbsp;listBugDatabaseInfo">listBugDatabaseInfo</a></strong></span></span></dt><dd><p>List information such as the revision name and
55 timestamp for a list of XML bug databases</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#filterBugs" title="1.3.&nbsp;filterBugs">filterBugs</a></strong></span></span></dt><dd><p>Select a subset of a bug database</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#mineBugHistory" title="1.4.&nbsp;mineBugHistory">mineBugHistory</a></strong></span></span></dt><dd><p>Generate a tabular listing of the number of warnings in each
56 version of a multiversion bug database</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#defectDensity" title="1.5.&nbsp;defectDensity">defectDensity</a></strong></span></span></dt><dd><p>List information about defect density
57 (warnings per 1000 NCSS)
58 for the entire project and each class and package</p></dd><dt><span class="term"><span class="command"><strong><a class="link" href="datamining.html#convertXmlToText" title="1.6.&nbsp;convertXmlToText">convertXmlToText</a></strong></span></span></dt><dd><p>Convert bug warnings in XML format to
59 a textual one-line-per-bug format, or to HTML</p></dd></dl></div><div class="sect2" title="1.1.&nbsp;unionBugs"><div class="titlepage"><div><div><h3 class="title"><a name="unionBugs"></a>1.1.&nbsp;unionBugs</h3></div></div></div><p>
60 If you have, for example, separately analyzing each jar file used in an application,
61 you can use this command to combine the separately generated xml bug warning files into
62 a single file containing all of the warnings.</p><p>Do <span class="emphasis"><em>not</em></span> use this command to combine results from analyzing different versions of the same
63 file; use <span class="command"><strong>computeBugHistory</strong></span> instead.</p><p>Specify the xml files on the command line. The result is sent to standard output.</p></div><div class="sect2" title="1.2.&nbsp;computeBugHistory"><div class="titlepage"><div><div><h3 class="title"><a name="computeBugHistory"></a>1.2.&nbsp;computeBugHistory</h3></div></div></div><p>Use this command to generate a bug database containing information from different builds or versions
64 of software you are analyzing.
65 History is taken from the first file provided as input; any following
66 files should be single version bug databases (if they contain history, the history in those
67 files will be ignored).</p><p>By default, output is written to the standard output.
68 </p><p>This functionality may also can be accessed from ant.
69 First create a taskdef for <span class="command"><strong>computeBugHistory</strong></span> in your
70 build file:
71 </p><pre class="programlisting">
72
73 &lt;taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask"&gt;
74 &lt;classpath refid="findbugs.lib" /&gt;
75 &lt;/taskdef&gt;
76
77 </pre><p>Attributes for this ant task are listed in the following table.
78 To specify input files, nest them inside with a
79 <code class="literal">&lt;datafile&gt;</code> element. For example:
80 </p><pre class="programlisting">
81
82 &lt;computeBugHistory home="${findbugs.home}" ...&gt;
83 &lt;datafile name="analyze1.xml"/&gt;
84 &lt;datafile name="analyze2.xml"/&gt;
85 &lt;/computeBugHistory&gt;
86
87 </pre><div class="table"><a name="computeBugHistoryTable"></a><p class="title"><b>Table&nbsp;12.1.&nbsp;Options for computeBugHistory command</b></p><div class="table-contents"><table summary="Options for computeBugHistory command" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">-output &lt;file&gt;</td><td align="left">output="&lt;file&gt;"</td><td align="left">save output in the named file (may also be an input file)</td></tr><tr><td align="left">-overrideRevisionNames[:truth]</td><td align="left">overrideRevisionNames="[true|false]"</td><td align="left">override revision names for each version with names computed from the filenames</td></tr><tr><td align="left">-noPackageMoves[:truth]</td><td align="left">noPackageMoves="[true|false]"</td><td align="left">if a class has moved to another package, treat warnings in that class as seperate</td></tr><tr><td align="left">-preciseMatch[:truth]</td><td align="left">preciseMatch="[true|false]"</td><td align="left">require bug patterns to match precisely</td></tr><tr><td align="left">-precisePriorityMatch[:truth]</td><td align="left">precisePriorityMatch="[true|false]"</td><td align="left">consider two warnings as the same only if priorities match exactly</td></tr><tr><td align="left">-quiet[:truth]</td><td align="left">quiet="[true|false]"</td><td align="left">don't generate any output to standard out unless there is an error</td></tr><tr><td align="left">-withMessages[:truth]</td><td align="left">withMessages="[true|false]"</td><td align="left">include human-readable messages describing the warnings in XML output</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.3.&nbsp;filterBugs"><div class="titlepage"><div><div><h3 class="title"><a name="filterBugs"></a>1.3.&nbsp;filterBugs</h3></div></div></div><p>This command is used to select a subset of warnings from a FindBugs XML warning file
88 and write the selected subset to a new FindBugs warning file.</p><p>
89 This command takes a sequence of options, and either zero, one or two
90 filenames of findbugs xml bug files on the command line.</p><p>If no file names are provided, the command reads from standard input
91 and writes to standard output. If one file name is provided,
92 it reads from the file and writes to standard output.
93 If two file names are provided, it reads from the first and writes the output
94 to the second file name.</p><p>This functionality may also can be accessed from ant.
95 First create a taskdef for <span class="command"><strong>filterBugs</strong></span> in your
96 build file:
97 </p><pre class="programlisting">
98
99 &lt;taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsTask"&gt;
100 &lt;classpath refid="findbugs.lib" /&gt;
101 &lt;/taskdef&gt;
102
103 </pre><p>Attributes for this ant task are listed in the following table.
104 To specify an input file either use the input attribute or nest it inside
105 the ant call with a <code class="literal">&lt;datafile&gt;</code> element. For example:
106 </p><pre class="programlisting">
107
108 &lt;filterBugs home="${findbugs.home}" ...&gt;
109 &lt;datafile name="analyze.xml"/&gt;
110 &lt;/filterBugs&gt;
111
112 </pre><div class="table"><a name="filterOptionsTable"></a><p class="title"><b>Table&nbsp;12.2.&nbsp;Options for filterBugs command</b></p><div class="table-contents"><table summary="Options for filterBugs command" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align="left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;file&gt;"</td><td align="left">output results to file</td></tr><tr><td align="left">-not</td><td align="left">not="[true|false]"</td><td align="left">reverse (all) switches for the filter</td></tr><tr><td align="left">-withSource[:truth]</td><td align="left">withSource="[true|false]"</td><td align="left">only warnings for switch source is available</td></tr><tr><td align="left">-exclude &lt;filter file&gt;</td><td align="left">exclude="&lt;filter file&gt;"</td><td align="left">exclude bugs matching given filter</td></tr><tr><td align="left">-include &lt;filter file&gt;</td><td align="left">include="&lt;filter file&gt;"</td><td align="left">include only bugs matching given filter</td></tr><tr><td align="left">-annotation &lt;text&gt;</td><td align="left">annotation="&lt;text&gt;"</td><td align="left">allow only warnings containing this text in a manual annotation</td></tr><tr><td align="left">-after &lt;when&gt;</td><td align="left">after="&lt;when&gt;"</td><td align="left">allow only warnings that first occurred after this version</td></tr><tr><td align="left">-before &lt;when&gt;</td><td align="left">before="&lt;when&gt;"</td><td align="left">allow only warnings that first occurred before this version</td></tr><tr><td align="left">-first &lt;when&gt;</td><td align="left">first="&lt;when&gt;"</td><td align="left">allow only warnings that first occurred in this version</td></tr><tr><td align="left">-last &lt;when&gt;</td><td align="left">last="&lt;when&gt;"</td><td align="left">allow only warnings that last occurred in this version</td></tr><tr><td align="left">-fixed &lt;when&gt;</td><td align="left">fixed="&lt;when&gt;"</td><td align="left">allow only warnings that last occurred in the previous version (clobbers <code class="option">-last</code>)</td></tr><tr><td align="left">-present &lt;when&gt;</td><td align="left">present="&lt;when&gt;"</td><td align="left">allow only warnings present in this version</td></tr><tr><td align="left">-absent &lt;when&gt;</td><td align="left">absent="&lt;when&gt;"</td><td align="left">allow only warnings absent in this version</td></tr><tr><td align="left">-active[:truth]</td><td align="left">active="[true|false]"</td><td align="left">allow only warnings alive in the last sequence number</td></tr><tr><td align="left">-introducedByChange[:truth]</td><td align="left">introducedByChange="[true|false]"</td><td align="left">allow only warnings introduced by a change of an existing class</td></tr><tr><td align="left">-removedByChange[:truth]</td><td align="left">removedByChange="[true|false]"</td><td align="left">allow only warnings removed by a change of a persisting class</td></tr><tr><td align="left">-newCode[:truth]</td><td align="left">newCode="[true|false]"</td><td align="left">allow only warnings introduced by the addition of a new class</td></tr><tr><td align="left">-removedCode[:truth]</td><td align="left">removedCode="[true|false]"</td><td align="left">allow only warnings removed by removal of a class</td></tr><tr><td align="left">-priority &lt;level&gt;</td><td align="left">priority="&lt;level&gt;"</td><td align="left">allow only warnings with this priority or higher</td></tr><tr><td align="left">-maxRank &lt;rank&gt;</td><td align="left">rank="[1..20]"</td><td align="left">allow only warnings with this rank or lower</td></tr><tr><td align="left">-class &lt;pattern&gt;</td><td align="left">class="&lt;class&gt;"</td><td align="left">allow only bugs whose primary class name matches this pattern</td></tr><tr><td align="left">-bugPattern &lt;pattern&gt;</td><td align="left">bugPattern="&lt;pattern&gt;"</td><td align="left">allow only bugs whose type matches this pattern</td></tr><tr><td align="left">-category &lt;category&gt;</td><td align="left">category="&lt;category&gt;"</td><td align="left">allow only warnings with a category that starts with this string</td></tr><tr><td align="left">-designation &lt;designation&gt;</td><td align="left">designation="&lt;designation&gt;"</td><td align="left">allow only warnings with this designation (e.g., -designation SHOULD_FIX)</td></tr><tr><td align="left">-withMessages[:truth] </td><td align="left">withMessages="[true|false]"</td><td align="left">the generated XML should contain textual messages</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.4.&nbsp;mineBugHistory"><div class="titlepage"><div><div><h3 class="title"><a name="mineBugHistory"></a>1.4.&nbsp;mineBugHistory</h3></div></div></div><p>This command generates a table containing counts of the numbers of warnings
113 in each version of a multiversion bug database.</p><p>This functionality may also can be accessed from ant.
114 First create a taskdef for <span class="command"><strong>mineBugHistory</strong></span> in your
115 build file:
116 </p><pre class="programlisting">
117
118 &lt;taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask"&gt;
119 &lt;classpath refid="findbugs.lib" /&gt;
120 &lt;/taskdef&gt;
121
122 </pre><p>Attributes for this ant task are listed in the following table.
123 To specify an input file either use the <code class="literal">input</code>
124 attribute or nest it inside the ant call with a
125 <code class="literal">&lt;datafile&gt;</code> element. For example:
126 </p><pre class="programlisting">
127
128 &lt;mineBugHistory home="${findbugs.home}" ...&gt;
129 &lt;datafile name="analyze.xml"/&gt;
130 &lt;/mineBugHistory&gt;
131
132 </pre><div class="table"><a name="mineBugHistoryOptionsTable"></a><p class="title"><b>Table&nbsp;12.3.&nbsp;Options for mineBugHistory command</b></p><div class="table-contents"><table summary="Options for mineBugHistory command" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align="left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;file&gt;"</td><td align="left">write output to file</td></tr><tr><td align="left">-formatDates</td><td align="left">formatDates="[true|false]"</td><td align="left">render dates in textual form</td></tr><tr><td align="left">-noTabs</td><td align="left">noTabs="[true|false]"</td><td align="left">delimit columns with groups of spaces instead of tabs (see below)</td></tr><tr><td align="left">-summary</td><td align="left">summary="[true|false]"</td><td align="left">output terse summary of changes over the last ten entries</td></tr></tbody></table></div></div><br class="table-break"><p>
133 The <code class="option">-noTabs</code> output can be easier to read from a shell
134 with a fixed-width font.
135 Because numeric columns are right-justified, spaces may precede the
136 first column value. This option also causes <code class="option">-formatDates</code>
137 to render dates in terser format without embedded whitespace.
138 </p><p>The table is a tab-separated (barring <code class="option">-noTabs</code>)
139 table with the following columns:</p><div class="table"><a name="mineBugHistoryColumns"></a><p class="title"><b>Table&nbsp;12.4.&nbsp;Columns in mineBugHistory output</b></p><div class="table-contents"><table summary="Columns in mineBugHistory output" border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Title</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">seq</td><td align="left">Sequence number (successive integers, starting at 0)</td></tr><tr><td align="left">version</td><td align="left">Version name</td></tr><tr><td align="left">time</td><td align="left">Release timestamp</td></tr><tr><td align="left">classes</td><td align="left">Number of classes analyzed</td></tr><tr><td align="left">NCSS</td><td align="left">Non Commenting Source Statements</td></tr><tr><td align="left">added</td><td align="left">Count of new warnings for a class that existed in the previous version</td></tr><tr><td align="left">newCode</td><td align="left">Count of new warnings for a class that did not exist in the previous version</td></tr><tr><td align="left">fixed</td><td align="left">Count of warnings removed from a class that remains in the current version</td></tr><tr><td align="left">removed</td><td align="left">Count of warnings in the previous version for a class that is not present in the current version</td></tr><tr><td align="left">retained</td><td align="left">Count of warnings that were in both the previous and current version</td></tr><tr><td align="left">dead</td><td align="left">Warnings that were present in earlier versions but in neither the current version or the immediately preceeding version</td></tr><tr><td align="left">active</td><td align="left">Total warnings present in the current version</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.5.&nbsp;defectDensity"><div class="titlepage"><div><div><h3 class="title"><a name="defectDensity"></a>1.5.&nbsp;defectDensity</h3></div></div></div><p>
140 This command lists information about defect density (warnings per 1000 NCSS) for the entire project and each class and package.
141 It can either be invoked with no files specified on the command line (in which case it reads from standard input)
142 or with one file specified on the command line.</p><p>It generates a table with the following columns, and with one
143 row for the entire project, and one row for each package or class that contains at least
144 4 warnings.</p><div class="table"><a name="defectDensityColumns"></a><p class="title"><b>Table&nbsp;12.5.&nbsp;Columns in defectDensity output</b></p><div class="table-contents"><table summary="Columns in defectDensity output" border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Title</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">kind</td><td align="left">project, package or class</td></tr><tr><td align="left">name</td><td align="left">The name of the project, package or class</td></tr><tr><td align="left">density</td><td align="left">Number of warnings generated per 1000 lines of NCSS.</td></tr><tr><td align="left">bugs</td><td align="left">Number of warnings</td></tr><tr><td align="left">NCSS</td><td align="left">Calculated number of NCSS</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.6.&nbsp;convertXmlToText"><div class="titlepage"><div><div><h3 class="title"><a name="convertXmlToText"></a>1.6.&nbsp;convertXmlToText</h3></div></div></div><p>
145 This command converts a warning collection in XML format to a text
146 format with one line per warning, or to HTML.
147 </p><p>This functionality may also can be accessed from ant.
148 First create a taskdef for <span class="command"><strong>convertXmlToText</strong></span> in your
149 build file:
150 </p><pre class="programlisting">
151
152 &lt;taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask"&gt;
153 &lt;classpath refid="findbugs.lib" /&gt;
154 &lt;/taskdef&gt;
155
156 </pre><p>Attributes for this ant task are listed in the following table.</p><div class="table"><a name="convertXmlToTextTable"></a><p class="title"><b>Table&nbsp;12.6.&nbsp;Options for convertXmlToText command</b></p><div class="table-contents"><table summary="Options for convertXmlToText command" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;filename&gt;"</td><td align="left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;filename&gt;"</td><td align="left">output results to file</td></tr><tr><td align="left">-longBugCodes</td><td align="left">longBugCodes="[true|false]"</td><td align="left">use the full bug pattern code instead of two-letter abbreviation</td></tr><tr><td align="left">&nbsp;</td><td align="left">format="text"</td><td align="left">generate plain text output with one bug per line (command-line default)</td></tr><tr><td align="left">-html[:stylesheet]</td><td align="left">format="html:&lt;stylesheet&gt;"</td><td align="left">generate output with specified stylesheet (see below), or default.xsl if unspecified</td></tr></tbody></table></div></div><br class="table-break"><p>
157 You may specify plain.xsl, default.xsl, fancy.xsl, fancy-hist.xsl,
158 or your own XSL stylesheet for the -html/format option.
159 Despite the name of this option, you may specify
160 a stylesheet that emits something other than html.
161 When applying a stylesheet other than those included
162 with FindBugs (listed above), the -html/format option should be used
163 with a path or URL to the stylesheet.
164 </p></div><div class="sect2" title="1.7.&nbsp;setBugDatabaseInfo"><div class="titlepage"><div><div><h3 class="title"><a name="setBugDatabaseInfo"></a>1.7.&nbsp;setBugDatabaseInfo</h3></div></div></div><p>
165 This command sets meta-information in a specified warning collection.
166 It takes the following options:
167 </p><p>This functionality may also can be accessed from ant.
168 First create a taskdef for <span class="command"><strong>setBugDatabaseInfo</strong></span> in your
169 build file:
170 </p><pre class="programlisting">
171
172 &lt;taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask"&gt;
173 &lt;classpath refid="findbugs.lib" /&gt;
174 &lt;/taskdef&gt;
175
176 </pre><p>Attributes for this ant task are listed in the following table.
177 To specify an input file either use the <code class="literal">input</code>
178 attribute or nest it inside the ant call with a
179 <code class="literal">&lt;datafile&gt;</code> element. For example:
180 </p><pre class="programlisting">
181
182 &lt;setBugDatabaseInfo home="${findbugs.home}" ...&gt;
183 &lt;datafile name="analyze.xml"/&gt;
184 &lt;/setBugDatabaseInfo&gt;
185
186 </pre><div class="table"><a name="setBugDatabaseInfoOptions"></a><p class="title"><b>Table&nbsp;12.7.&nbsp;setBugDatabaseInfo Options</b></p><div class="table-contents"><table summary="setBugDatabaseInfo Options" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="left">Command-line option</th><th align="left">Ant attribute</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">&nbsp;</td><td align="left">input="&lt;file&gt;"</td><td align="left">use file as input</td></tr><tr><td align="left">&nbsp;</td><td align="left">output="&lt;file&gt;"</td><td align="left">write output to file</td></tr><tr><td align="left">-name &lt;name&gt;</td><td align="left">name="&lt;name&gt;"</td><td align="left">set name for (last) revision</td></tr><tr><td align="left">-timestamp &lt;when&gt;</td><td align="left">timestamp="&lt;when&gt;"</td><td align="left">set timestamp for (last) revision</td></tr><tr><td align="left">-source &lt;directory&gt;</td><td align="left">source="&lt;directory&gt;"</td><td align="left">add specified directory to the source search path</td></tr><tr><td align="left">-findSource &lt;directory&gt;</td><td align="left">findSource="&lt;directory&gt;"</td><td align="left">find and add all relevant source directions contained within specified directory</td></tr><tr><td align="left">-suppress &lt;filter file&gt;</td><td align="left">suppress="&lt;filter file&gt;"</td><td align="left">suppress warnings matched by this file (replaces previous suppressions)</td></tr><tr><td align="left">-withMessages</td><td align="left">withMessages="[true|false]"</td><td align="left">add textual messages to XML</td></tr><tr><td align="left">-resetSource</td><td align="left">resetSource="[true|false]"</td><td align="left">remove all source search paths</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="1.8.&nbsp;listBugDatabaseInfo"><div class="titlepage"><div><div><h3 class="title"><a name="listBugDatabaseInfo"></a>1.8.&nbsp;listBugDatabaseInfo</h3></div></div></div><p>This command takes a list of zero or more xml bug database filenames on the command line.
187 If zero file names are provided, it reads from standard input and does not generate
188 a table header.</p><p>There is only one option: <code class="option">-formatDates</code> renders dates
189 in textual form.
190 </p><p>The output is a table one row per bug database and the following columns:</p><div class="table"><a name="listBugDatabaseInfoColumns"></a><p class="title"><b>Table&nbsp;12.8.&nbsp;listBugDatabaseInfo Columns</b></p><div class="table-contents"><table summary="listBugDatabaseInfo Columns" border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Column</th><th align="left">Meaning</th></tr></thead><tbody><tr><td align="left">version</td><td align="left">version name</td></tr><tr><td align="left">time</td><td align="left">Release timestamp</td></tr><tr><td align="left">classes</td><td align="left">Number of classes analyzed</td></tr><tr><td align="left">NCSS</td><td align="left">Non Commenting Source Statements analyzed</td></tr><tr><td align="left">total</td><td align="left">Total number of warnings of all kinds</td></tr><tr><td align="left">high</td><td align="left">Total number of high priority warnings of all kinds</td></tr><tr><td align="left">medium</td><td align="left">Total number of medium/normal priority warnings of all kinds</td></tr><tr><td align="left">low</td><td align="left">Total number of low priority warnings of all kinds</td></tr><tr><td align="left">filename</td><td align="left">filename of database</td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="sect1" title="2.&nbsp;Examples"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="examples"></a>2.&nbsp;Examples</h2></div></div></div><div class="sect2" title="2.1.&nbsp;Mining history using proveded shell scrips"><div class="titlepage"><div><div><h3 class="title"><a name="unixscriptsexamples"></a>2.1.&nbsp;Mining history using proveded shell scrips</h3></div></div></div><p>In all of the following, the commands are given in a directory that contains
191 directories jdk1.6.0-b12, jdk1.6.0-b13, ..., jdk1.6.0-b60.</p><p>You can use the command:</p><pre class="screen">
192 computeBugHistory jdk1.6.0-b* | filterBugs -bugPattern IL_ | mineBugHistory -formatDates
193 </pre><p>to generate the following output:</p><pre class="screen">
194 seq version time classes NCSS added newCode fixed removed retained dead active
195 0 jdk1.6.0-b12 "Thu Nov 11 09:07:20 EST 2004" 13128 811569 0 4 0 0 0 0 4
196 1 jdk1.6.0-b13 "Thu Nov 18 06:02:06 EST 2004" 13128 811570 0 0 0 0 4 0 4
197 2 jdk1.6.0-b14 "Thu Dec 02 06:12:26 EST 2004" 13145 811786 0 0 2 0 2 0 2
198 3 jdk1.6.0-b15 "Thu Dec 09 06:07:04 EST 2004" 13174 811693 0 0 1 0 1 2 1
199 4 jdk1.6.0-b16 "Thu Dec 16 06:21:28 EST 2004" 13175 811715 0 0 0 0 1 3 1
200 5 jdk1.6.0-b17 "Thu Dec 23 06:27:22 EST 2004" 13176 811974 0 0 0 0 1 3 1
201 6 jdk1.6.0-b19 "Thu Jan 13 06:41:16 EST 2005" 13176 812011 0 0 0 0 1 3 1
202 7 jdk1.6.0-b21 "Thu Jan 27 05:57:52 EST 2005" 13177 812173 0 0 0 0 1 3 1
203 8 jdk1.6.0-b23 "Thu Feb 10 05:44:36 EST 2005" 13179 812188 0 0 0 0 1 3 1
204 9 jdk1.6.0-b26 "Thu Mar 03 06:04:02 EST 2005" 13199 811770 0 0 0 0 1 3 1
205 10 jdk1.6.0-b27 "Thu Mar 10 04:48:38 EST 2005" 13189 812440 0 0 0 0 1 3 1
206 11 jdk1.6.0-b28 "Thu Mar 17 02:54:22 EST 2005" 13185 812056 0 0 0 0 1 3 1
207 12 jdk1.6.0-b29 "Thu Mar 24 03:09:20 EST 2005" 13117 809468 0 0 0 0 1 3 1
208 13 jdk1.6.0-b30 "Thu Mar 31 02:53:32 EST 2005" 13118 809501 0 0 0 0 1 3 1
209 14 jdk1.6.0-b31 "Thu Apr 07 03:00:14 EDT 2005" 13117 809572 0 0 0 0 1 3 1
210 15 jdk1.6.0-b32 "Thu Apr 14 02:56:56 EDT 2005" 13169 811096 0 0 0 0 1 3 1
211 16 jdk1.6.0-b33 "Thu Apr 21 02:46:22 EDT 2005" 13187 811942 0 0 0 0 1 3 1
212 17 jdk1.6.0-b34 "Thu Apr 28 02:49:00 EDT 2005" 13195 813488 0 1 0 0 1 3 2
213 18 jdk1.6.0-b35 "Thu May 05 02:49:04 EDT 2005" 13457 829837 0 0 0 0 2 3 2
214 19 jdk1.6.0-b36 "Thu May 12 02:59:46 EDT 2005" 13462 831278 0 0 0 0 2 3 2
215 20 jdk1.6.0-b37 "Thu May 19 02:55:08 EDT 2005" 13464 831971 0 0 0 0 2 3 2
216 21 jdk1.6.0-b38 "Thu May 26 03:08:16 EDT 2005" 13564 836565 0 0 0 0 2 3 2
217 22 jdk1.6.0-b39 "Fri Jun 03 03:10:48 EDT 2005" 13856 849992 0 1 0 0 2 3 3
218 23 jdk1.6.0-b40 "Thu Jun 09 03:30:28 EDT 2005" 15972 959619 0 2 0 0 3 3 5
219 24 jdk1.6.0-b41 "Thu Jun 16 03:19:22 EDT 2005" 15972 959619 0 0 0 0 5 3 5
220 25 jdk1.6.0-b42 "Fri Jun 24 03:38:54 EDT 2005" 15966 958581 0 0 0 0 5 3 5
221 26 jdk1.6.0-b43 "Thu Jul 14 03:09:34 EDT 2005" 16041 960544 0 0 0 0 5 3 5
222 27 jdk1.6.0-b44 "Thu Jul 21 03:05:54 EDT 2005" 16041 960547 0 0 0 0 5 3 5
223 28 jdk1.6.0-b45 "Thu Jul 28 03:26:10 EDT 2005" 16037 960606 0 0 1 0 4 3 4
224 29 jdk1.6.0-b46 "Thu Aug 04 03:02:48 EDT 2005" 15936 951355 0 0 0 0 4 4 4
225 30 jdk1.6.0-b47 "Thu Aug 11 03:18:56 EDT 2005" 15964 952387 0 0 1 0 3 4 3
226 31 jdk1.6.0-b48 "Thu Aug 18 08:10:40 EDT 2005" 15970 953421 0 0 0 0 3 5 3
227 32 jdk1.6.0-b49 "Thu Aug 25 03:24:38 EDT 2005" 16048 958940 0 0 0 0 3 5 3
228 33 jdk1.6.0-b50 "Thu Sep 01 01:52:40 EDT 2005" 16287 974937 1 0 0 0 3 5 4
229 34 jdk1.6.0-b51 "Thu Sep 08 01:55:36 EDT 2005" 16362 979377 0 0 0 0 4 5 4
230 35 jdk1.6.0-b52 "Thu Sep 15 02:04:08 EDT 2005" 16477 979399 0 0 0 0 4 5 4
231 36 jdk1.6.0-b53 "Thu Sep 22 02:00:28 EDT 2005" 16019 957900 0 0 1 0 3 5 3
232 37 jdk1.6.0-b54 "Thu Sep 29 01:54:34 EDT 2005" 16019 957900 0 0 0 0 3 6 3
233 38 jdk1.6.0-b55 "Thu Oct 06 01:54:14 EDT 2005" 16051 959014 0 0 0 0 3 6 3
234 39 jdk1.6.0-b56 "Thu Oct 13 01:54:12 EDT 2005" 16211 970835 0 0 0 0 3 6 3
235 40 jdk1.6.0-b57 "Thu Oct 20 01:55:26 EDT 2005" 16279 971627 0 0 0 0 3 6 3
236 41 jdk1.6.0-b58 "Thu Oct 27 01:56:30 EDT 2005" 16283 971945 0 0 0 0 3 6 3
237 42 jdk1.6.0-b59 "Thu Nov 03 01:56:58 EST 2005" 16232 972193 0 0 0 0 3 6 3
238 43 jdk1.6.0-b60 "Thu Nov 10 01:54:18 EST 2005" 16235 972346 0 0 0 0 3 6 3
239 </pre><p>
240 We could also generate that information directly, without creating an intermediate db.xml file, using the command
241 </p><pre class="screen">
242 computeBugHistory jdk1.6.0-b*/jre/lib/rt.xml | filterBugs -bugPattern IL_ db.xml | mineBugHistory -formatDates
243 </pre><p>We can then use that information to display a graph showing the number of infinite recursive loops
244 found by FindBugs in each build of Sun's JDK1.6.0. The blue area indicates the number of infinite
245 recursive loops in that build, the red area above it indicates the number of infinite recursive loops that existed
246 in some previous version but not in the current version (thus, the combined height of the red and blue areas
247 is guaranteed to never decrease, and goes up whenever a new infinite recursive loop bug is introduced). The height
248 of the red area is computed as the sum of the fixed, removed and dead values for each version.
249 The reductions in builds 13 and 14 came after Sun was notified about the bugs found by FindBugs in the JDK.
250 </p><div class="mediaobject"><img src="infiniteRecursiveLoops.png"></div><p>
251 Given the db.xml file that contains the results for all the jdk1.6.0 builds, the following command will show the history of high and medium priority correctness warnings:
252 </p><pre class="screen">
253 filterBugs -priority M -category C db.xml | mineBugHistory -formatDates
254 </pre><p>
255 generating the table:
256 </p><pre class="screen">
257 seq version time classes NCSS added newCode fixed removed retained dead active
258 0 jdk1.6.0-b12 "Thu Nov 11 09:07:20 EST 2004" 13128 811569 0 1075 0 0 0 0 1075
259 1 jdk1.6.0-b13 "Thu Nov 18 06:02:06 EST 2004" 13128 811570 0 0 0 0 1075 0 1075
260 2 jdk1.6.0-b14 "Thu Dec 02 06:12:26 EST 2004" 13145 811786 3 0 6 0 1069 0 1072
261 3 jdk1.6.0-b15 "Thu Dec 09 06:07:04 EST 2004" 13174 811693 2 1 3 0 1069 6 1072
262 4 jdk1.6.0-b16 "Thu Dec 16 06:21:28 EST 2004" 13175 811715 0 0 1 0 1071 9 1071
263 5 jdk1.6.0-b17 "Thu Dec 23 06:27:22 EST 2004" 13176 811974 0 0 1 0 1070 10 1070
264 6 jdk1.6.0-b19 "Thu Jan 13 06:41:16 EST 2005" 13176 812011 0 0 0 0 1070 11 1070
265 7 jdk1.6.0-b21 "Thu Jan 27 05:57:52 EST 2005" 13177 812173 0 0 1 0 1069 11 1069
266 8 jdk1.6.0-b23 "Thu Feb 10 05:44:36 EST 2005" 13179 812188 0 0 0 0 1069 12 1069
267 9 jdk1.6.0-b26 "Thu Mar 03 06:04:02 EST 2005" 13199 811770 0 0 2 1 1066 12 1066
268 10 jdk1.6.0-b27 "Thu Mar 10 04:48:38 EST 2005" 13189 812440 1 0 1 1 1064 15 1065
269 11 jdk1.6.0-b28 "Thu Mar 17 02:54:22 EST 2005" 13185 812056 0 0 0 0 1065 17 1065
270 12 jdk1.6.0-b29 "Thu Mar 24 03:09:20 EST 2005" 13117 809468 3 0 8 26 1031 17 1034
271 13 jdk1.6.0-b30 "Thu Mar 31 02:53:32 EST 2005" 13118 809501 0 0 0 0 1034 51 1034
272 14 jdk1.6.0-b31 "Thu Apr 07 03:00:14 EDT 2005" 13117 809572 0 0 0 0 1034 51 1034
273 15 jdk1.6.0-b32 "Thu Apr 14 02:56:56 EDT 2005" 13169 811096 1 1 0 1 1033 51 1035
274 16 jdk1.6.0-b33 "Thu Apr 21 02:46:22 EDT 2005" 13187 811942 3 0 2 1 1032 52 1035
275 17 jdk1.6.0-b34 "Thu Apr 28 02:49:00 EDT 2005" 13195 813488 0 1 0 0 1035 55 1036
276 18 jdk1.6.0-b35 "Thu May 05 02:49:04 EDT 2005" 13457 829837 0 36 2 0 1034 55 1070
277 19 jdk1.6.0-b36 "Thu May 12 02:59:46 EDT 2005" 13462 831278 0 0 0 0 1070 57 1070
278 20 jdk1.6.0-b37 "Thu May 19 02:55:08 EDT 2005" 13464 831971 0 1 1 0 1069 57 1070
279 21 jdk1.6.0-b38 "Thu May 26 03:08:16 EDT 2005" 13564 836565 1 7 2 6 1062 58 1070
280 22 jdk1.6.0-b39 "Fri Jun 03 03:10:48 EDT 2005" 13856 849992 6 39 5 0 1065 66 1110
281 23 jdk1.6.0-b40 "Thu Jun 09 03:30:28 EDT 2005" 15972 959619 7 147 11 0 1099 71 1253
282 24 jdk1.6.0-b41 "Thu Jun 16 03:19:22 EDT 2005" 15972 959619 0 0 0 0 1253 82 1253
283 25 jdk1.6.0-b42 "Fri Jun 24 03:38:54 EDT 2005" 15966 958581 3 0 1 2 1250 82 1253
284 26 jdk1.6.0-b43 "Thu Jul 14 03:09:34 EDT 2005" 16041 960544 5 11 15 8 1230 85 1246
285 27 jdk1.6.0-b44 "Thu Jul 21 03:05:54 EDT 2005" 16041 960547 0 0 0 0 1246 108 1246
286 28 jdk1.6.0-b45 "Thu Jul 28 03:26:10 EDT 2005" 16037 960606 19 0 2 0 1244 108 1263
287 29 jdk1.6.0-b46 "Thu Aug 04 03:02:48 EDT 2005" 15936 951355 13 1 1 32 1230 110 1244
288 30 jdk1.6.0-b47 "Thu Aug 11 03:18:56 EDT 2005" 15964 952387 163 8 7 20 1217 143 1388
289 31 jdk1.6.0-b48 "Thu Aug 18 08:10:40 EDT 2005" 15970 953421 0 0 0 0 1388 170 1388
290 32 jdk1.6.0-b49 "Thu Aug 25 03:24:38 EDT 2005" 16048 958940 1 11 1 0 1387 170 1399
291 33 jdk1.6.0-b50 "Thu Sep 01 01:52:40 EDT 2005" 16287 974937 19 27 16 7 1376 171 1422
292 34 jdk1.6.0-b51 "Thu Sep 08 01:55:36 EDT 2005" 16362 979377 1 15 3 0 1419 194 1435
293 35 jdk1.6.0-b52 "Thu Sep 15 02:04:08 EDT 2005" 16477 979399 0 0 1 1 1433 197 1433
294 36 jdk1.6.0-b53 "Thu Sep 22 02:00:28 EDT 2005" 16019 957900 13 12 16 20 1397 199 1422
295 37 jdk1.6.0-b54 "Thu Sep 29 01:54:34 EDT 2005" 16019 957900 0 0 0 0 1422 235 1422
296 38 jdk1.6.0-b55 "Thu Oct 06 01:54:14 EDT 2005" 16051 959014 1 4 7 0 1415 235 1420
297 39 jdk1.6.0-b56 "Thu Oct 13 01:54:12 EDT 2005" 16211 970835 6 8 37 0 1383 242 1397
298 40 jdk1.6.0-b57 "Thu Oct 20 01:55:26 EDT 2005" 16279 971627 0 0 0 0 1397 279 1397
299 41 jdk1.6.0-b58 "Thu Oct 27 01:56:30 EDT 2005" 16283 971945 0 1 1 0 1396 279 1397
300 42 jdk1.6.0-b59 "Thu Nov 03 01:56:58 EST 2005" 16232 972193 6 0 5 0 1392 280 1398
301 43 jdk1.6.0-b60 "Thu Nov 10 01:54:18 EST 2005" 16235 972346 0 0 0 0 1398 285 1398
302 44 jdk1.6.0-b61 "Thu Nov 17 01:58:42 EST 2005" 16202 971134 2 0 4 0 1394 285 1396
303 </pre></div><div class="sect2" title="2.2.&nbsp;Incremental history maintenance"><div class="titlepage"><div><div><h3 class="title"><a name="incrementalhistory"></a>2.2.&nbsp;Incremental history maintenance</h3></div></div></div><p>
304 If db.xml contains the results of running findbugs over builds b12 - b60, we can update db.xml to include the results of analyzing b61 with the commands:
305 </p><pre class="screen">
306 computeBugHistory -output db.xml db.xml jdk1.6.0-b61/jre/lib/rt.xml
307 </pre></div></div><div class="sect1" title="3.&nbsp;Ant example"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="antexample"></a>3.&nbsp;Ant example</h2></div></div></div><p>
308 Here is a complete ant script example for both running findbugs and running a chain of data-mining tools afterward:
309 </p><pre class="screen">
310
311 &lt;project name="analyze_asm_util" default="findbugs"&gt;
312 &lt;!-- findbugs task definition --&gt;
313 &lt;property name="findbugs.home" value="/Users/ben/Documents/workspace/findbugs/findbugs" /&gt;
314 &lt;property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en -Duser.region=EN -Dfindbugs.home=${findbugs.home}" /&gt;
315
316 &lt;path id="findbugs.lib"&gt;
317 &lt;fileset dir="${findbugs.home}/lib"&gt;
318 &lt;include name="findbugs-ant.jar"/&gt;
319 &lt;/fileset&gt;
320 &lt;/path&gt;
321
322 &lt;taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"&gt;
323 &lt;classpath refid="findbugs.lib" /&gt;
324 &lt;/taskdef&gt;
325
326 &lt;taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask"&gt;
327 &lt;classpath refid="findbugs.lib" /&gt;
328 &lt;/taskdef&gt;
329
330 &lt;taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask"&gt;
331 &lt;classpath refid="findbugs.lib" /&gt;
332 &lt;/taskdef&gt;
333
334 &lt;taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask"&gt;
335 &lt;classpath refid="findbugs.lib" /&gt;
336 &lt;/taskdef&gt;
337
338 &lt;!-- findbugs task definition --&gt;
339 &lt;target name="findbugs"&gt;
340 &lt;antcall target="analyze" /&gt;
341 &lt;antcall target="mine" /&gt;
342 &lt;/target&gt;
343
344 &lt;!-- analyze task --&gt;
345 &lt;target name="analyze"&gt;
346 &lt;!-- run findbugs against asm-util --&gt;
347 &lt;findbugs home="${findbugs.home}"
348 output="xml:withMessages"
349 timeout="90000000"
350 reportLevel="experimental"
351 workHard="true"
352 effort="max"
353 adjustExperimental="true"
354 jvmargs="${jvmargs}"
355 failOnError="true"
356 outputFile="out.xml"
357 projectName="Findbugs"
358 debug="false"&gt;
359 &lt;class location="asm-util-3.0.jar" /&gt;
360 &lt;/findbugs&gt;
361 &lt;/target&gt;
362
363 &lt;target name="mine"&gt;
364
365 &lt;!-- Set info to the latest analysis --&gt;
366 &lt;setBugDatabaseInfo home="${findbugs.home}"
367 withMessages="true"
368 name="asm-util-3.0.jar"
369 input="out.xml"
370 output="out-rel.xml"/&gt;
371
372 &lt;!-- Checking if history file already exists (out-hist.xml) --&gt;
373 &lt;condition property="mining.historyfile.available"&gt;
374 &lt;available file="out-hist.xml"/&gt;
375 &lt;/condition&gt;
376 &lt;condition property="mining.historyfile.notavailable"&gt;
377 &lt;not&gt;
378 &lt;available file="out-hist.xml"/&gt;
379 &lt;/not&gt;
380 &lt;/condition&gt;
381
382 &lt;!-- this target is executed if the history file do not exist (first run) --&gt;
383 &lt;antcall target="history-init"&gt;
384 &lt;param name="data.file" value="out-rel.xml" /&gt;
385 &lt;param name="hist.file" value="out-hist.xml" /&gt;
386 &lt;/antcall&gt;
387 &lt;!-- else this one is executed --&gt;
388 &lt;antcall target="history"&gt;
389 &lt;param name="data.file" value="out-rel.xml" /&gt;
390 &lt;param name="hist.file" value="out-hist.xml" /&gt;
391 &lt;param name="hist.summary.file" value="out-hist.txt" /&gt;
392 &lt;/antcall&gt;
393 &lt;/target&gt;
394
395 &lt;!-- Initializing history file --&gt;
396 &lt;target name="history-init" if="mining.historyfile.notavailable"&gt;
397 &lt;copy file="${data.file}" tofile="${hist.file}" /&gt;
398 &lt;/target&gt;
399
400 &lt;!-- Computing bug history --&gt;
401 &lt;target name="history" if="mining.historyfile.available"&gt;
402 &lt;!-- Merging ${data.file} into ${hist.file} --&gt;
403 &lt;computeBugHistory home="${findbugs.home}"
404 withMessages="true"
405 output="${hist.file}"&gt;
406 &lt;dataFile name="${hist.file}"/&gt;
407 &lt;dataFile name="${data.file}"/&gt;
408 &lt;/computeBugHistory&gt;
409
410 &lt;!-- Compute history into ${hist.summary.file} --&gt;
411 &lt;mineBugHistory home="${findbugs.home}"
412 formatDates="true"
413 noTabs="true"
414 input="${hist.file}"
415 output="${hist.summary.file}"/&gt;
416 &lt;/target&gt;
417
418 &lt;/project&gt;
419
420 </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="rejarForAnalysis.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="license.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;11.&nbsp;Using rejarForAnalysis&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;13.&nbsp;License</td></tr></table></div></body></html>
+0
-112
doc/manual/eclipse.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;7.&nbsp;Using the FindBugs&#8482; Eclipse plugin</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="anttask.html" title="Chapter&nbsp;6.&nbsp;Using the FindBugs&#8482; Ant task"><link rel="next" href="filter.html" title="Chapter&nbsp;8.&nbsp;Filter Files"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;7.&nbsp;Using the <span class="application">FindBugs</span>&#8482; Eclipse plugin</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="anttask.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="filter.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;7.&nbsp;Using the FindBugs&#8482; Eclipse plugin"><div class="titlepage"><div><div><h2 class="title"><a name="eclipse"></a>Chapter&nbsp;7.&nbsp;Using the <span class="application">FindBugs</span>&#8482; Eclipse plugin</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="eclipse.html#d0e1662">1. Requirements</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1670">2. Installation</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1717">3. Using the Plugin</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1748">4. Extending the Eclipse Plugin (since 2.0.0)</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1802">5. Troubleshooting</a></span></dt></dl></div><p>
3 The FindBugs Eclipse plugin allows <span class="application">FindBugs</span> to be used within
4 the <a class="ulink" href="http://www.eclipse.org/" target="_top">Eclipse</a> IDE.
5 The FindBugs Eclipse plugin was generously contributed by Peter Friese.
6 Phil Crosby and Andrei Loskutov contributed major improvements
7 to the plugin.
8 </p><div class="sect1" title="1.&nbsp;Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1662"></a>1.&nbsp;Requirements</h2></div></div></div><p>
9 To use the <span class="application">FindBugs</span> Plugin for Eclipse, you need Eclipse 3.3 or later,
10 and JRE/JDK 1.5 or later.
11 </p></div><div class="sect1" title="2.&nbsp;Installation"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1670"></a>2.&nbsp;Installation</h2></div></div></div><p>
12 We provide update sites that allow you to automatically install FindBugs into Eclipse and also query and install updates.
13 There are three different update sites</p><div class="variablelist" title="FindBugs Eclipse update sites"><p class="title"><b>FindBugs Eclipse update sites</b></p><dl><dt><span class="term"><a class="ulink" href="http://findbugs.cs.umd.edu/eclipse/" target="_top">http://findbugs.cs.umd.edu/eclipse/</a></span></dt><dd><p>
14 Only provides official releases of FindBugs.
15 </p></dd><dt><span class="term"><a class="ulink" href="http://findbugs.cs.umd.edu/eclipse-candidate/" target="_top">http://findbugs.cs.umd.edu/eclipse-candidate/</a></span></dt><dd><p>
16 Provides official releases and release candidates of FindBugs.
17 </p></dd><dt><span class="term"><a class="ulink" href="http://findbugs.cs.umd.edu/eclipse-daily/" target="_top">http://findbugs.cs.umd.edu/eclipse-daily/</a></span></dt><dd><p>
18 Provides the daily build of FindBugs. No testing other than that it compiles.
19 </p></dd></dl></div><p>You can also manually
20 download the plugin from the following link:
21 <a class="ulink" href="http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122.zip?download" target="_top">http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122.zip?download</a>.
22 Extract it in Eclipse's "plugins" subdirectory.
23 (So &lt;eclipse_install_dir&gt;/plugins/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122/findbugs.png
24 should be the path to the <span class="application">FindBugs</span> logo.)
25
26 </p><p>
27 Once the plugin is extracted, start Eclipse and choose
28 <span class="guimenu">Help</span> &#8594; <span class="guimenuitem">About Eclipse Platform</span> &#8594; <span class="guimenuitem">Plug-in Details</span>.
29 You should find a plugin called "FindBugs Plug-in" provided by "FindBugs Project".
30 </p></div><div class="sect1" title="3.&nbsp;Using the Plugin"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1717"></a>3.&nbsp;Using the Plugin</h2></div></div></div><p>
31 To get started, right click on a Java project in Package Explorer,
32 and select the option labeled "Find Bugs".
33 <span class="application">FindBugs</span> will run, and problem markers (displayed in source
34 windows, and also in the Eclipse Problems view) will point to
35 locations in your code which have been identified as potential instances
36 of bug patterns.
37 </p><p>
38 You can also run <span class="application">FindBugs</span> on existing java archives (jar, ear, zip, war etc). Simply
39 create an empty Java project and attach archives to the project classpath. Having that, you
40 can now right click the archive node in Package Explorer and select the option labeled
41 "Find Bugs". If you additionally configure the source code locations for the binaries,
42 <span class="application">FindBugs</span> will also link the generated warnings to the right source files.
43 </p><p>
44 You may customize how <span class="application">FindBugs</span> runs by opening the Properties
45 dialog for a Java project, and choosing the "Findbugs" property page.
46 Options you may choose include:
47 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
48 Enable or disable the "Run FindBugs Automatically" checkbox.
49 When enabled, FindBugs will run every time you modify a Java class
50 within the project.
51 </p></li><li class="listitem"><p>
52 Choose minimum warning priority and enabled bug categories.
53 These options will choose which warnings are shown.
54 For example, if you select the "Medium" warning priority,
55 only Medium and High priority warnings will be shown.
56 Similarly, if you uncheck the "Style" checkbox, no warnings
57 in the Style category will be displayed.
58 </p></li><li class="listitem"><p>
59 Select detectors. The table allows you to select which detectors
60 you want to enable for your project.
61 </p></li></ul></div></div><div class="sect1" title="4.&nbsp;Extending the Eclipse Plugin (since 2.0.0)"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1748"></a>4.&nbsp;Extending the Eclipse Plugin (since 2.0.0)</h2></div></div></div><p>
62 Eclipse plugin supports contribution of custom <span class="application">FindBugs</span> detectors (see also
63 <a class="ulink" href="http://code.google.com/p/findbugs/source/browse/trunk/findbugs/src/doc/AddingDetectors.txt" target="_top">AddingDetectors.txt</a>
64 for more information). There are two ways to contribute custom plugins to the Eclipse:
65 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
66 Existing standard <span class="application">FindBugs</span> detector packages can be configured via
67 <span class="guimenu">Window</span> &#8594; <span class="guimenuitem">Preferences</span> &#8594; <span class="guimenuitem">Java</span> &#8594; <span class="guimenuitem"><span class="application">FindBugs</span></span> &#8594; <span class="guimenuitem">Misc. Settings</span> &#8594; <span class="guimenuitem">Custom Detectors</span>.
68 Simply specify there locations of any additional plugin libraries.
69 </p><p>
70 The benefit of this solution is that already existing detector packages can be
71 used "as is", and that you can quickly verify the quality of third party detectors.
72 The drawback is that you have to apply this settings in each
73 new Eclipse workspace, and this settings can't be shared between team members.
74 </p></li><li class="listitem"><p>
75 It is possible to contribute custom detectors via standard Eclipse extensions mechanism.
76 </p><p>
77 Please check the documentation of the
78 <a class="ulink" href="http://code.google.com/p/findbugs/source/browse/trunk/eclipsePlugin/schema/detectorPlugins.exsd" target="_top">
79 findBugsEclipsePlugin/schema/detectorPlugins.exsd</a>
80 extension point how to update the plugin.xml. Existing <span class="application">FindBugs</span> detector plugins can
81 be easily "extended" to be full featured <span class="application">FindBugs</span> AND Eclipse detector plugins.
82 Usually you only need to add META-INF/MANIFEST.MF and plugin.xml to the jar and
83 update your build scripts to not to override the MANIFEST.MF during the build.
84 </p><p>
85 The benefit of this solution is that for given (shared) Eclipse installation
86 each team member has exactly same detectors set, and there is no need to configure
87 anything anymore. The (really small) precondition
88 is that you have to convert your existing detectors package to the valid
89 Eclipse plugin. You can do this even for third-party detector packages.
90 Another major differentiator is the ability to extend the default FindBugs
91 classpath at runtime with required third party libraries (see
92 <a class="ulink" href="http://code.google.com/p/findbugs/source/browse/trunk/findbugs/src/doc/AddingDetectors.txt" target="_top">AddingDetectors.txt</a>
93 for more information).
94 </p></li></ul></div></div><div class="sect1" title="5.&nbsp;Troubleshooting"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1802"></a>5.&nbsp;Troubleshooting</h2></div></div></div><p>
95 This section lists common problems with the plugin and (if known) how to resolve them.
96 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
97 If you see OutOfMemory error dialogs after starting <span class="application">FindBugs</span> analysis in Eclipse,
98 please increase JVM available memory: change eclipse.ini and add the lines below
99 to the end of the file:
100 </p><pre class="programlisting">
101 -vmargs
102 -Xmx1000m
103 </pre><p>
104 Important: the configuration arguments starting with the line "-vmargs" must
105 be last lines in the eclipse.ini file, and only one argument per line is allowed!
106 </p></li><li class="listitem"><p>
107 If you do not see any <span class="application">FindBugs</span> problem markers (in your source
108 windows or in the Problems View), you may need to change your
109 Problems View filter settings. See
110 <a class="ulink" href="http://findbugs.sourceforge.net/FAQ.html#q7" target="_top">http://findbugs.sourceforge.net/FAQ.html#q7</a> for more information.
111 </p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="anttask.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="filter.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;6.&nbsp;Using the <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> task&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;8.&nbsp;Filter Files</td></tr></table></div></body></html>
doc/manual/example-code.png less more
Binary diff not shown
doc/manual/example-details.png less more
Binary diff not shown
doc/manual/example.png less more
Binary diff not shown
+0
-363
doc/manual/filter.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;8.&nbsp;Filter Files</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="eclipse.html" title="Chapter&nbsp;7.&nbsp;Using the FindBugs&#8482; Eclipse plugin"><link rel="next" href="analysisprops.html" title="Chapter&nbsp;9.&nbsp;Analysis Properties"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;8.&nbsp;Filter Files</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="eclipse.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="analysisprops.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;8.&nbsp;Filter Files"><div class="titlepage"><div><div><h2 class="title"><a name="filter"></a>Chapter&nbsp;8.&nbsp;Filter Files</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="filter.html#d0e1838">1. Introduction to Filter Files</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e1888">2. Types of Match clauses</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2136">3. Java element name matching</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2161">4. Caveats</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2191">5. Examples</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2249">6. Complete Example</a></span></dt></dl></div><p>
3 Filter files may be used to include or exclude bug reports for particular classes
4 and methods. This chapter explains how to use filter files.
5
6 </p><div class="note" title="Planned Features" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note: Planned Features"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="note.png"></td><th align="left">Planned Features</th></tr><tr><td align="left" valign="top"><p>
7 Filters are currently only supported by the Command Line interface.
8 Eventually, filter support will be added to the GUI.
9 </p></td></tr></table></div><p>
10 </p><div class="sect1" title="1.&nbsp;Introduction to Filter Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1838"></a>1.&nbsp;Introduction to Filter Files</h2></div></div></div><p>
11 Conceptually, a filter matches bug instances against a set of criteria.
12 By defining a filter, you can select bug instances for special treatment;
13 for example, to exclude or include them in a report.
14 </p><p>
15 A filter file is an <a class="ulink" href="http://www.w3.org/XML/" target="_top">XML</a> document with a top-level <code class="literal">FindBugsFilter</code> element
16 which has some number of <code class="literal">Match</code> elements as children. Each <code class="literal">Match</code>
17 element represents a predicate which is applied to generated bug instances.
18 Usually, a filter will be used to exclude bug instances. For example:
19
20 </p><pre class="screen">
21 <code class="prompt">$ </code><span class="command"><strong>findbugs -textui -exclude <em class="replaceable"><code>myExcludeFilter.xml</code></em> <em class="replaceable"><code>myApp.jar</code></em></strong></span>
22 </pre><p>
23
24 However, a filter could also be used to select bug instances to specifically
25 report:
26
27 </p><pre class="screen">
28 <code class="prompt">$ </code><span class="command"><strong>findbugs -textui -include <em class="replaceable"><code>myIncludeFilter.xml</code></em> <em class="replaceable"><code>myApp.jar</code></em></strong></span>
29 </pre><p>
30 </p><p>
31 <code class="literal">Match</code> elements contain children, which are conjuncts of the predicate.
32 In other words, each of the children must be true for the predicate to be true.
33 </p></div><div class="sect1" title="2.&nbsp;Types of Match clauses"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1888"></a>2.&nbsp;Types of Match clauses</h2></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="literal">&lt;Bug&gt;</code></span></dt><dd><p>
34 This element specifies a particular bug pattern or patterns to match.
35 The <code class="literal">pattern</code> attribute is a comma-separated list of
36 bug pattern types. You can find the bug pattern types for particular
37 warnings by looking at the output produced by the <span class="command"><strong>-xml</strong></span>
38 output option (the <code class="literal">type</code> attribute of <code class="literal">BugInstance</code>
39 elements), or from the <a class="ulink" href="../bugDescriptions.html" target="_top">bug
40 descriptions document</a>.
41 </p><p>
42 For more coarse-grained matching, use <code class="literal">code</code> attribute. It takes
43 a comma-separated list of bug abbreviations. For most-coarse grained matching use
44 <code class="literal">category</code> attriute, that takes a comma separated list of bug category names:
45 <code class="literal">CORRECTNESS</code>, <code class="literal">MT_CORRECTNESS</code>,
46 <code class="literal">BAD_PRACTICICE</code>, <code class="literal">PERFORMANCE</code>, <code class="literal">STYLE</code>.
47 </p><p>
48 If more than one of the attributes mentioned above are specified on the same
49 <code class="literal">&lt;Bug&gt;</code> element, all bug patterns that match either one of specified
50 pattern names, or abreviations, or categories will be matched.
51 </p><p>
52 As a backwards compatibility measure, <code class="literal">&lt;BugPattern&gt;</code> and
53 <code class="literal">&lt;BugCode&gt;</code> elements may be used instead of
54 <code class="literal">&lt;Bug&gt;</code> element. Each of these uses a
55 <code class="literal">name</code> attribute for specifying accepted values list. Support for these
56 elements may be removed in a future release.
57 </p></dd><dt><span class="term"><code class="literal">&lt;Confidence&gt;</code></span></dt><dd><p>
58 This element matches warnings with a particular bug confidence.
59 The <code class="literal">value</code> attribute should be an integer value:
60 1 to match high-confidence warnings, 2 to match normal-confidence warnings,
61 or 3 to match low-confidence warnings. &lt;Confidence&gt; replaced
62 &lt;Priority&gt; in 2.0.0 release.
63 </p></dd><dt><span class="term"><code class="literal">&lt;Priority&gt;</code></span></dt><dd><p>
64 Same as <code class="literal">&lt;Confidence&gt;</code>, exists for backward compatibility.
65 </p></dd><dt><span class="term"><code class="literal">&lt;Rank&gt;</code></span></dt><dd><p>
66 This element matches warnings with a particular bug rank.
67 The <code class="literal">value</code> attribute should be an integer value
68 between 1 and 20, where 1 to 4 are scariest, 5 to 9 scary, 10 to 14 troubling,
69 and 15 to 20 of concern bugs.
70 </p></dd><dt><span class="term"><code class="literal">&lt;Package&gt;</code></span></dt><dd><p>
71 This element matches warnings associated with classes within the package specified
72 using <code class="literal">name</code> attribute. Nested packages are not included (along the
73 lines of Java import statement). However matching multiple packages can be achieved
74 easily using regex name match.
75 </p></dd><dt><span class="term"><code class="literal">&lt;Class&gt;</code></span></dt><dd><p>
76 This element matches warnings associated with a particular class. The
77 <code class="literal">name</code> attribute is used to specify the exact or regex match pattern
78 for the class name.
79 </p><p>
80 As a backward compatibility measure, instead of element of this type, you can use
81 <code class="literal">class</code> attribute on a <code class="literal">Match</code> element to specify
82 exact an class name or <code class="literal">classregex</code> attribute to specify a regular
83 expression to match the class name against.
84 </p><p>
85 If the <code class="literal">Match</code> element contains neither a <code class="literal">Class</code> element,
86 nor a <code class="literal">class</code> / <code class="literal">classregex</code> attribute, the predicate will apply
87 to all classes. Such predicate is likely to match more bug instances than you want, unless it is
88 refined further down with apropriate method or field predicates.
89 </p></dd><dt><span class="term"><code class="literal">&lt;Method&gt;</code></span></dt><dd><p>This element specifies a method. The <code class="literal">name</code> is used to specify
90 the exact or regex match pattern for the method name.
91 The <code class="literal">params</code> attribute is a comma-separated list
92 of the types of the method's parameters. The <code class="literal">returns</code> attribute is
93 the method's return type. In <code class="literal">params</code> and <code class="literal">returns</code>, class names
94 must be fully qualified. (E.g., "java.lang.String" instead of just
95 "String".) If one of the latter attributes is specified the other is required for creating a method signature.
96 Note that you can provide either <code class="literal">name</code> attribute or <code class="literal">params</code>
97 and <code class="literal">returns</code> attributes or all three of them. This way you can provide various kinds of
98 name and signature based matches.
99 </p></dd><dt><span class="term"><code class="literal">&lt;Field&gt;</code></span></dt><dd><p>This element specifies a field. The <code class="literal">name</code> attribute is is used to specify
100 the exact or regex match pattern for the field name. You can also filter fields according to their signature -
101 use <code class="literal">type</code> attribute to specify fully qualified type of the field. You can specify eiter or both
102 of these attributes in order to perform name / signature based matches.
103 </p></dd><dt><span class="term"><code class="literal">&lt;Local&gt;</code></span></dt><dd><p>This element specifies a local variable. The <code class="literal">name</code> attribute is is used to specify
104 the exact or regex match pattern for the local variable name. Local variables are variables defined within a method.
105 </p></dd><dt><span class="term"><code class="literal">&lt;Or&gt;</code></span></dt><dd><p>
106 This element combines <code class="literal">Match</code> clauses as disjuncts. I.e., you can put two
107 <code class="literal">Method</code> elements in an <code class="literal">Or</code> clause in order to match either method.
108 </p></dd><dt><span class="term"><code class="literal">&lt;And&gt;</code></span></dt><dd><p>
109 This element combines <code class="literal">Match</code> clauses which both must evaluate to true. I.e., you can put
110 <code class="literal">Bug</code> and <code class="literal">Priority</code> elements in an <code class="literal">And</code> clause in order
111 to match specific bugs with given priority only.
112 </p></dd><dt><span class="term"><code class="literal">&lt;Not&gt;</code></span></dt><dd><p>
113 This element inverts the included child <code class="literal">Match</code>. I.e., you can put a
114 <code class="literal">Bug</code> element in a <code class="literal">Not</code> clause in order to match any bug
115 excluding the given one.
116 </p></dd></dl></div></div><div class="sect1" title="3.&nbsp;Java element name matching"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2136"></a>3.&nbsp;Java element name matching</h2></div></div></div><p>
117 If the <code class="literal">name</code> attribute of <code class="literal">Class</code>, <code class="literal">Method</code> or
118 <code class="literal">Field</code> starts with the ~ character the rest of attribute content is interpreted as
119 a Java regular expression that is matched against the names of the Java element in question.
120 </p><p>
121 Note that the pattern is matched against whole element name and therefore .* clauses need to be used
122 at pattern beginning and/or end to perform substring matching.
123 </p><p>
124 See <a class="ulink" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html" target="_top"><code class="literal">java.util.regex.Pattern</code></a>
125 documentation for pattern syntax.
126 </p></div><div class="sect1" title="4.&nbsp;Caveats"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2161"></a>4.&nbsp;Caveats</h2></div></div></div><p>
127 <code class="literal">Match</code> clauses can only match information that is actually contained in the
128 bug instances. Every bug instance has a class, so in general, excluding
129 bugs by class will work.
130 </p><p>
131 Some bug instances have two (or more) classes. For example, the DE (dropped exception)
132 bugs report both the class containing the method where the dropped exception
133 happens, and the class which represents the type of the dropped exception.
134 Only the <span class="emphasis"><em>first</em></span> (primary) class is matched against <code class="literal">Match</code> clauses.
135 So, for example, if you want to suppress IC (initialization circularity)
136 reports for classes "com.foobar.A" and "com.foobar.B", you would use
137 two <code class="literal">Match</code> clauses:
138
139 </p><pre class="programlisting">
140 &lt;Match&gt;
141 &lt;Class name="com.foobar.A" /&gt;
142 &lt;Bug code="IC" /&gt;
143 &lt;/Match&gt;
144
145 &lt;Match&gt;
146 &lt;Class name="com.foobar.B" /&gt;
147 &lt;Bug code="IC" /&gt;
148 &lt;/Match&gt;
149 </pre><p>
150
151 By explicitly matching both classes, you ensure that the IC bug instance will be
152 matched regardless of which class involved in the circularity happens to be
153 listed first in the bug instance. (Of course, this approach might accidentally
154 supress circularities involving "com.foobar.A" or "com.foobar.B" and a third
155 class.)
156 </p><p>
157 Many kinds of bugs report what method they occur in. For those bug instances,
158 you can put <code class="literal">Method</code> clauses in the <code class="literal">Match</code> element and they should work
159 as expected.
160 </p></div><div class="sect1" title="5.&nbsp;Examples"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2191"></a>5.&nbsp;Examples</h2></div></div></div><p>
161 1. Match all bug reports for a class.
162
163 </p><pre class="programlisting">
164
165 &lt;Match&gt;
166 &lt;Class name="com.foobar.MyClass" /&gt;
167 &lt;/Match&gt;
168
169 </pre><p>
170
171 </p><p>
172 2. Match certain tests from a class by specifying their abbreviations.
173 </p><pre class="programlisting">
174
175 &lt;Match&gt;
176 &lt;Class name="com.foobar.MyClass"/ &gt;
177 &lt;Bug code="DE,UrF,SIC" /&gt;
178 &lt;/Match&gt;
179
180 </pre><p>
181 </p><p>
182 3. Match certain tests from all classes by specifying their abbreviations.
183
184 </p><pre class="programlisting">
185
186 &lt;Match&gt;
187 &lt;Bug code="DE,UrF,SIC" /&gt;
188 &lt;/Match&gt;
189
190 </pre><p>
191 </p><p>
192 4. Match certain tests from all classes by specifying their category.
193
194 </p><pre class="programlisting">
195
196 &lt;Match&gt;
197 &lt;Bug category="PERFORMANCE" /&gt;
198 &lt;/Match&gt;
199
200 </pre><p>
201 </p><p>
202 5. Match bug types from specified methods of a class by their abbreviations.
203
204 </p><pre class="programlisting">
205
206 &lt;Match&gt;
207 &lt;Class name="com.foobar.MyClass" /&gt;
208 &lt;Or&gt;
209 &lt;Method name="frob" params="int,java.lang.String" returns="void" /&gt;
210 &lt;Method name="blat" params="" returns="boolean" /&gt;
211 &lt;/Or&gt;
212 &lt;Bug code="DC" /&gt;
213 &lt;/Match&gt;
214
215 </pre><p>
216 </p><p>
217 6. Match a particular bug pattern in a particular method.
218
219 </p><pre class="programlisting">
220
221 &lt;!-- A method with an open stream false positive. --&gt;
222 &lt;Match&gt;
223 &lt;Class name="com.foobar.MyClass" /&gt;
224 &lt;Method name="writeDataToFile" /&gt;
225 &lt;Bug pattern="OS_OPEN_STREAM" /&gt;
226 &lt;/Match&gt;
227
228 </pre><p>
229 </p><p>
230 7. Match a particular bug pattern with a given priority in a particular method.
231
232 </p><pre class="programlisting">
233
234 &lt;!-- A method with a dead local store false positive (medium priority). --&gt;
235 &lt;Match&gt;
236 &lt;Class name="com.foobar.MyClass" /&gt;
237 &lt;Method name="someMethod" /&gt;
238 &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;
239 &lt;Priority value="2" /&gt;
240 &lt;/Match&gt;
241
242 </pre><p>
243 </p><p>
244 8. Match minor bugs introduced by AspectJ compiler (you are probably not interested in these unless
245 you are an AspectJ developer).
246
247 </p><pre class="programlisting">
248
249 &lt;Match&gt;
250 &lt;Class name="~.*\$AjcClosure\d+" /&gt;
251 &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;
252 &lt;Method name="run" /&gt;
253 &lt;/Match&gt;
254 &lt;Match&gt;
255 &lt;Bug pattern="UUF_UNUSED_FIELD" /&gt;
256 &lt;Field name="~ajc\$.*" /&gt;
257 &lt;/Match&gt;
258
259 </pre><p>
260 </p><p>
261 9. Match bugs in specific parts of the code base
262
263 </p><pre class="programlisting">
264
265 &lt;!-- match unused fields warnings in Messages classes in all packages --&gt;
266 &lt;Match&gt;
267 &lt;Class name="~.*\.Messages" /&gt;
268 &lt;Bug code="UUF" /&gt;
269 &lt;/Match&gt;
270 &lt;!-- match mutable statics warnings in all internal packages --&gt;
271 &lt;Match&gt;
272 &lt;Package name="~.*\.internal" /&gt;
273 &lt;Bug code="MS" /&gt;
274 &lt;/Match&gt;
275 &lt;!-- match anonymoous inner classes warnings in ui package hierarchy --&gt;
276 &lt;Match&gt;
277 &lt;Package name="~com\.foobar\.fooproject\.ui.*" /&gt;
278 &lt;Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" /&gt;
279 &lt;/Match&gt;
280
281 </pre><p>
282 </p><p>
283 10. Match bugs on fields or methods with specific signatures
284 </p><pre class="programlisting">
285
286 &lt;!-- match System.exit(...) usage warnings in void main(String[]) methods in all classes --&gt;
287 &lt;Match&gt;
288 &lt;Method returns="void" name="main" params="java.lang.String[]" /&gt;
289 &lt;Bug pattern="DM_EXIT" /&gt;
290 &lt;/Match&gt;
291 &lt;!-- match UuF warnings on fields of type com.foobar.DebugInfo on all classes --&gt;
292 &lt;Match&gt;
293 &lt;Field type="com.foobar.DebugInfo" /&gt;
294 &lt;Bug code="UuF" /&gt;
295 &lt;/Match&gt;
296
297 </pre><p>
298 </p><p>
299 11. Match bugs using the Not filter operator
300 </p><pre class="programlisting">
301
302 &lt;!-- ignore all bugs in test classes, except for those bugs specifically relating to JUnit tests --&gt;
303 &lt;!-- i.e. filter bug if ( classIsJUnitTest &amp;&amp; ! bugIsRelatedToJUnit ) --&gt;
304 &lt;Match&gt;
305 &lt;!-- the Match filter is equivalent to a logical 'And' --&gt;
306
307 &lt;Class name="~.*\.*Test" /&gt;
308 &lt;!-- test classes are suffixed by 'Test' --&gt;
309
310 &lt;Not&gt;
311 &lt;Bug code="IJU" /&gt; &lt;!-- 'IJU' is the code for bugs related to JUnit test code --&gt;
312 &lt;/Not&gt;
313 &lt;/Match&gt;
314
315 </pre><p>
316 </p></div><div class="sect1" title="6.&nbsp;Complete Example"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2249"></a>6.&nbsp;Complete Example</h2></div></div></div><pre class="programlisting">
317
318 &lt;FindBugsFilter&gt;
319 &lt;Match&gt;
320 &lt;Class name="com.foobar.ClassNotToBeAnalyzed" /&gt;
321 &lt;/Match&gt;
322
323 &lt;Match&gt;
324 &lt;Class name="com.foobar.ClassWithSomeBugsMatched" /&gt;
325 &lt;Bug code="DE,UrF,SIC" /&gt;
326 &lt;/Match&gt;
327
328 &lt;!-- Match all XYZ violations. --&gt;
329 &lt;Match&gt;
330 &lt;Bug code="XYZ" /&gt;
331 &lt;/Match&gt;
332
333 &lt;!-- Match all doublecheck violations in these methods of "AnotherClass". --&gt;
334 &lt;Match&gt;
335 &lt;Class name="com.foobar.AnotherClass" /&gt;
336 &lt;Or&gt;
337 &lt;Method name="nonOverloadedMethod" /&gt;
338 &lt;Method name="frob" params="int,java.lang.String" returns="void" /&gt;
339 &lt;Method name="blat" params="" returns="boolean" /&gt;
340 &lt;/Or&gt;
341 &lt;Bug code="DC" /&gt;
342 &lt;/Match&gt;
343
344 &lt;!-- A method with a dead local store false positive (medium priority). --&gt;
345 &lt;Match&gt;
346 &lt;Class name="com.foobar.MyClass" /&gt;
347 &lt;Method name="someMethod" /&gt;
348 &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;
349 &lt;Priority value="2" /&gt;
350 &lt;/Match&gt;
351
352 &lt;!-- All bugs in test classes, except for JUnit-specific bugs --&gt;
353 &lt;Match&gt;
354 &lt;Class name="~.*\.*Test" /&gt;
355 &lt;Not&gt;
356 &lt;Bug code="IJU" /&gt;
357 &lt;/Not&gt;
358 &lt;/Match&gt;
359
360 &lt;/FindBugsFilter&gt;
361
362 </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="eclipse.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="analysisprops.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;7.&nbsp;Using the <span class="application">FindBugs</span>&#8482; Eclipse plugin&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;9.&nbsp;Analysis Properties</td></tr></table></div></body></html>
+0
-68
doc/manual/gui.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;5.&nbsp;Using the FindBugs GUI</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="running.html" title="Chapter&nbsp;4.&nbsp;Running FindBugs&#8482;"><link rel="next" href="anttask.html" title="Chapter&nbsp;6.&nbsp;Using the FindBugs&#8482; Ant task"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;5.&nbsp;Using the <span class="application">FindBugs</span> GUI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="running.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="anttask.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;5.&nbsp;Using the FindBugs GUI"><div class="titlepage"><div><div><h2 class="title"><a name="gui"></a>Chapter&nbsp;5.&nbsp;Using the <span class="application">FindBugs</span> GUI</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="gui.html#d0e1092">1. Creating a Project</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1134">2. Running the Analysis</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1139">3. Browsing Results</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1154">4. Saving and Opening</a></span></dt></dl></div><p>
3 This chapter describes how to use the <span class="application">FindBugs</span> graphical user interface (GUI).
4 </p><div class="sect1" title="1.&nbsp;Creating a Project"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1092"></a>1.&nbsp;Creating a Project</h2></div></div></div><p>
5 After you have started <span class="application">FindBugs</span> using the <span class="command"><strong>findbugs</strong></span> command,
6 choose the <span class="guimenu">File</span> &#8594; <span class="guimenuitem">New Project</span>
7 menu item. You will see a dialog which looks like this:
8 </p><div class="mediaobject"><img src="project-dialog.png"></div><p>
9 </p><p>
10 Use the "Add" button next to "Classpath to analyze" to select a Java archive
11 file (zip, jar, ear, or war file) or directory containing java classes to analyze for bugs. You may add multiple
12 archives/directories.
13 </p><p>
14 You can also add the source directories which contain
15 the source code for the Java archives you are analyzing. This will enable
16 <span class="application">FindBugs</span> to highlight the source code which contains a possible error.
17 The source directories you add should be the roots of the Java
18 package hierarchy. For example, if your application is contained in the
19 <code class="varname">org.foobar.myapp</code> package, you should add the
20 parent directory of the <code class="filename">org</code> directory
21 to the source directory list for the project.
22 </p><p>
23 Another optional step is to add additional Jar files or directories as
24 "Auxiliary classpath locations" entries. You should do this if the archives and directories you are analyzing
25 have references to other classes which are not included in the analyzed
26 archives/directories and are not in the standard runtime classpath. Some of the bug
27 pattern detectors in <span class="application">FindBugs</span> make use of class hierarchy information,
28 so you will get more accurate results if the entire class hierarchy is
29 available which <span class="application">FindBugs</span> performs its analysis.
30 </p></div><div class="sect1" title="2.&nbsp;Running the Analysis"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1134"></a>2.&nbsp;Running the Analysis</h2></div></div></div><p>
31 Once you have added all of the archives, directories, and source directories,
32 click the "Analyze" button to analyze the classes contained in the
33 Jar files. Note that for a very large program on an older computer,
34 this may take quite a while (tens of minutes). A recent computer with
35 ample memory will typically be able to analyze a large program in only a
36 few minutes.
37 </p></div><div class="sect1" title="3.&nbsp;Browsing Results"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1139"></a>3.&nbsp;Browsing Results</h2></div></div></div><p>
38 When the analysis completes, you will see a screen like the following:
39 </p><div class="mediaobject"><img src="example-details.png"></div><p>
40 </p><p>
41 The upper left-hand pane of the window shows the bug tree; this is a hierarchical
42 representation of all of the potential bugs detected in the analyzed
43 Jar files.
44 </p><p>
45 When you select a particular bug instance in the top pane, you will
46 see a description of the bug in the "Details" tab of the bottom pane.
47 In addition, the source code pane on the upper-right will show the
48 program source code where the potential bug occurs, if source is available.
49 In the above example, the bug is a stream object that is not closed. The
50 source code window highlights the line where the stream object is created.
51 </p><p>
52 You may add a textual annotations to bug instances. To do so, type them
53 into the text box just below the hierarchical view. You can type any
54 information which you would like to record. When you load and save bug
55 results files, the annotations are preserved.
56 </p></div><div class="sect1" title="4.&nbsp;Saving and Opening"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1154"></a>4.&nbsp;Saving and Opening</h2></div></div></div><p>
57 You may use the <span class="guimenu">File</span> &#8594; <span class="guimenuitem">Save as...</span>
58 menu option to save your work. To save your work, including the jar
59 file lists you specified and all bug results, choose
60 "FindBugs analysis results (.xml)" from the drop-down list in the
61 "Save as..." dialog. There are also options for saving just the jar
62 file lists ("FindBugs project file (.fbp)") or just the results
63 ("FindBugs analysis file (.fba)").
64 A saved file may be loaded with the
65 <span class="guimenu">File</span> &#8594; <span class="guimenuitem">Open...</span>
66 menu option.
67 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="running.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="anttask.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;4.&nbsp;Running <span class="application">FindBugs</span>&#8482;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;6.&nbsp;Using the <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> task</td></tr></table></div></body></html>
doc/manual/important.png less more
Binary diff not shown
+0
-10
doc/manual/index.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>FindBugs&#8482; Manual</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="next" href="introduction.html" title="Chapter&nbsp;1.&nbsp;Introduction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="application">FindBugs</span>&#8482; Manual</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="introduction.html">Next</a></td></tr></table><hr></div><div lang="en" class="book" title="FindBugs&#8482; Manual"><div class="titlepage"><div><div><h1 class="title"><a name="findbugs-manual"></a><span class="application">FindBugs</span>&#8482; Manual</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="othername">H.</span> <span class="surname">Hovemeyer</span></h3></div><div class="author"><h3 class="author"><span class="firstname">William</span> <span class="othername">W.</span> <span class="surname">Pugh</span></h3></div></div></div><div><p class="copyright">Copyright &copy; 2003 - 2012 University of Maryland</p></div><div><div class="legalnotice" title="Legal Notice"><a name="d0e27"></a><p>
3 This manual is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License.
4 To view a copy of this license, visit
5 <a class="ulink" href="http://creativecommons.org/licenses/by-nc-sa/1.0/" target="_top">http://creativecommons.org/licenses/by-nc-sa/1.0/</a>
6 or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
7 </p><p>
8 The name FindBugs and the FindBugs logo are trademarked by the University of Maryland.
9 </p></div></div><div><p class="pubdate">17:16:15 EST, 22 November, 2013</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="introduction.html">1. Introduction</a></span></dt><dd><dl><dt><span class="sect1"><a href="introduction.html#d0e67">1. Requirements</a></span></dt></dl></dd><dt><span class="chapter"><a href="installing.html">2. Installing <span class="application">FindBugs</span>&#8482;</a></span></dt><dd><dl><dt><span class="sect1"><a href="installing.html#d0e98">1. Extracting the Distribution</a></span></dt></dl></dd><dt><span class="chapter"><a href="building.html">3. Building <span class="application">FindBugs</span>&#8482; from Source</a></span></dt><dd><dl><dt><span class="sect1"><a href="building.html#d0e173">1. Prerequisites</a></span></dt><dt><span class="sect1"><a href="building.html#d0e262">2. Extracting the Source Distribution</a></span></dt><dt><span class="sect1"><a href="building.html#d0e275">3. Modifying <code class="filename">local.properties</code></a></span></dt><dt><span class="sect1"><a href="building.html#d0e333">4. Running <span class="application">Ant</span></a></span></dt><dt><span class="sect1"><a href="building.html#d0e427">5. Running <span class="application">FindBugs</span>&#8482; from a source directory</a></span></dt></dl></dd><dt><span class="chapter"><a href="running.html">4. Running <span class="application">FindBugs</span>&#8482;</a></span></dt><dd><dl><dt><span class="sect1"><a href="running.html#d0e465">1. Quick Start</a></span></dt><dt><span class="sect1"><a href="running.html#d0e503">2. Executing <span class="application">FindBugs</span></a></span></dt><dt><span class="sect1"><a href="running.html#commandLineOptions">3. Command-line Options</a></span></dt></dl></dd><dt><span class="chapter"><a href="gui.html">5. Using the <span class="application">FindBugs</span> GUI</a></span></dt><dd><dl><dt><span class="sect1"><a href="gui.html#d0e1092">1. Creating a Project</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1134">2. Running the Analysis</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1139">3. Browsing Results</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1154">4. Saving and Opening</a></span></dt></dl></dd><dt><span class="chapter"><a href="anttask.html">6. Using the <span class="application">FindBugs</span>&#8482; <span class="application">Ant</span> task</a></span></dt><dd><dl><dt><span class="sect1"><a href="anttask.html#d0e1205">1. Installing the <span class="application">Ant</span> task</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1243">2. Modifying build.xml</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1314">3. Executing the task</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1339">4. Parameters</a></span></dt></dl></dd><dt><span class="chapter"><a href="eclipse.html">7. Using the <span class="application">FindBugs</span>&#8482; Eclipse plugin</a></span></dt><dd><dl><dt><span class="sect1"><a href="eclipse.html#d0e1662">1. Requirements</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1670">2. Installation</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1717">3. Using the Plugin</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1748">4. Extending the Eclipse Plugin (since 2.0.0)</a></span></dt><dt><span class="sect1"><a href="eclipse.html#d0e1802">5. Troubleshooting</a></span></dt></dl></dd><dt><span class="chapter"><a href="filter.html">8. Filter Files</a></span></dt><dd><dl><dt><span class="sect1"><a href="filter.html#d0e1838">1. Introduction to Filter Files</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e1888">2. Types of Match clauses</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2136">3. Java element name matching</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2161">4. Caveats</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2191">5. Examples</a></span></dt><dt><span class="sect1"><a href="filter.html#d0e2249">6. Complete Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="analysisprops.html">9. Analysis Properties</a></span></dt><dt><span class="chapter"><a href="annotations.html">10. Annotations</a></span></dt><dt><span class="chapter"><a href="rejarForAnalysis.html">11. Using rejarForAnalysis</a></span></dt><dt><span class="chapter"><a href="datamining.html">12. Data mining of bugs with <span class="application">FindBugs</span>&#8482;</a></span></dt><dd><dl><dt><span class="sect1"><a href="datamining.html#commands">1. Commands</a></span></dt><dt><span class="sect1"><a href="datamining.html#examples">2. Examples</a></span></dt><dt><span class="sect1"><a href="datamining.html#antexample">3. Ant example</a></span></dt></dl></dd><dt><span class="chapter"><a href="license.html">13. License</a></span></dt><dt><span class="chapter"><a href="acknowledgments.html">14. Acknowledgments</a></span></dt><dd><dl><dt><span class="sect1"><a href="acknowledgments.html#d0e3629">1. Contributors</a></span></dt><dt><span class="sect1"><a href="acknowledgments.html#d0e3752">2. Software Used</a></span></dt></dl></dd></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>9.1. <a href="analysisprops.html#analysisproptable">Configurable Analysis Properties</a></dt><dt>12.1. <a href="datamining.html#computeBugHistoryTable">Options for computeBugHistory command</a></dt><dt>12.2. <a href="datamining.html#filterOptionsTable">Options for filterBugs command</a></dt><dt>12.3. <a href="datamining.html#mineBugHistoryOptionsTable">Options for mineBugHistory command</a></dt><dt>12.4. <a href="datamining.html#mineBugHistoryColumns">Columns in mineBugHistory output</a></dt><dt>12.5. <a href="datamining.html#defectDensityColumns">Columns in defectDensity output</a></dt><dt>12.6. <a href="datamining.html#convertXmlToTextTable">Options for convertXmlToText command</a></dt><dt>12.7. <a href="datamining.html#setBugDatabaseInfoOptions">setBugDatabaseInfo Options</a></dt><dt>12.8. <a href="datamining.html#listBugDatabaseInfoColumns">listBugDatabaseInfo Columns</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="introduction.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;1.&nbsp;Introduction</td></tr></table></div></body></html>
doc/manual/infiniteRecursiveLoops.png less more
Binary diff not shown
+0
-29
doc/manual/installing.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;2.&nbsp;Installing FindBugs&#8482;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="introduction.html" title="Chapter&nbsp;1.&nbsp;Introduction"><link rel="next" href="building.html" title="Chapter&nbsp;3.&nbsp;Building FindBugs&#8482; from Source"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;2.&nbsp;Installing <span class="application">FindBugs</span>&#8482;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="introduction.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="building.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;2.&nbsp;Installing FindBugs&#8482;"><div class="titlepage"><div><div><h2 class="title"><a name="installing"></a>Chapter&nbsp;2.&nbsp;Installing <span class="application">FindBugs</span>&#8482;</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="installing.html#d0e98">1. Extracting the Distribution</a></span></dt></dl></div><p>
3 This chapter explains how to install <span class="application">FindBugs</span>.
4 </p><div class="sect1" title="1.&nbsp;Extracting the Distribution"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e98"></a>1.&nbsp;Extracting the Distribution</h2></div></div></div><p>
5 The easiest way to install <span class="application">FindBugs</span> is to download a binary distribution.
6 Binary distributions are available in
7 <a class="ulink" href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.tar.gz?download" target="_top">gzipped tar format</a> and
8 <a class="ulink" href="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.zip?download" target="_top">zip format</a>.
9 Once you have downloaded a binary distribution, extract it into a directory of your choice.
10 </p><p>
11 Extracting a gzipped tar format distribution:
12 </p><pre class="screen">
13 <code class="prompt">$ </code><span class="command"><strong>gunzip -c findbugs-2.0.3.tar.gz | tar xvf -</strong></span>
14 </pre><p>
15 </p><p>
16 Extracting a zip format distribution:
17 </p><pre class="screen">
18 <code class="prompt">C:\Software&gt;</code><span class="command"><strong>unzip findbugs-2.0.3.zip</strong></span>
19 </pre><p>
20 </p><p>
21 Usually, extracting a binary distribution will create a directory ending in
22 <code class="filename">findbugs-2.0.3</code>. For example, if you extracted
23 the binary distribution from the <code class="filename">C:\Software</code>
24 directory, then the <span class="application">FindBugs</span> software will be extracted into the directory
25 <code class="filename">C:\Software\findbugs-2.0.3</code>.
26 This directory is the <span class="application">FindBugs</span> home directory. We'll refer to it as
27 <em class="replaceable"><code>$FINDBUGS_HOME</code></em> (or <em class="replaceable"><code>%FINDBUGS_HOME%</code></em> for Windows) throughout this manual.
28 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="introduction.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="building.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;1.&nbsp;Introduction&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;3.&nbsp;Building <span class="application">FindBugs</span>&#8482; from Source</td></tr></table></div></body></html>
+0
-12
doc/manual/introduction.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;1.&nbsp;Introduction</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="index.html" title="FindBugs&#8482; Manual"><link rel="next" href="installing.html" title="Chapter&nbsp;2.&nbsp;Installing FindBugs&#8482;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;1.&nbsp;Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="installing.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;1.&nbsp;Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="introduction"></a>Chapter&nbsp;1.&nbsp;Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="introduction.html#d0e67">1. Requirements</a></span></dt></dl></div><p> <span class="application">FindBugs</span>&#8482; is a program to find bugs in Java programs. It looks for instances
3 of "bug patterns" --- code instances that are likely to be errors.</p><p> This document describes version 2.0.3 of <span class="application">FindBugs</span>.We
4 are very interested in getting your feedback on <span class="application">FindBugs</span>. Please visit
5 the <a class="ulink" href="http://findbugs.sourceforge.net" target="_top"><span class="application">FindBugs</span> web page</a> for
6 the latest information on <span class="application">FindBugs</span>, contact information, and support resources such
7 as information about the <span class="application">FindBugs</span> mailing lists.</p><div class="sect1" title="1.&nbsp;Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e67"></a>1.&nbsp;Requirements</h2></div></div></div><p> To use <span class="application">FindBugs</span>, you need a runtime environment compatible with
8 <a class="ulink" href="http://java.sun.com/j2se" target="_top">Java 2 Standard Edition</a>, version 1.5 or later.
9 <span class="application">FindBugs</span> is platform independent, and is known to run on GNU/Linux, Windows, and
10 MacOS X platforms.</p><p>You should have at least 512 MB of memory to use <span class="application">FindBugs</span>.
11 To analyze very large projects, more memory may be needed.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="installing.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">FindBugs</span>&#8482; Manual&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;2.&nbsp;Installing <span class="application">FindBugs</span>&#8482;</td></tr></table></div></body></html>
+0
-13
doc/manual/license.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;13.&nbsp;License</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="datamining.html" title="Chapter&nbsp;12.&nbsp;Data mining of bugs with FindBugs&#8482;"><link rel="next" href="acknowledgments.html" title="Chapter&nbsp;14.&nbsp;Acknowledgments"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;13.&nbsp;License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="datamining.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="acknowledgments.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;13.&nbsp;License"><div class="titlepage"><div><div><h2 class="title"><a name="license"></a>Chapter&nbsp;13.&nbsp;License</h2></div></div></div><p>
3 The name FindBugs and the FindBugs logo is trademarked by the University
4 of Maryland.
5 FindBugs is free software distributed under the terms of the
6 <a class="ulink" href="http://www.gnu.org/licenses/lgpl.html" target="_top">Lesser GNU Public License</a>.
7 You should have received a copy of the license in the file <code class="filename">LICENSE.txt</code>
8 in the <span class="application">FindBugs</span> distribution.
9 </p><p>
10 You can find the latest version of FindBugs, along with its source code, from the
11 <a class="ulink" href="http://findbugs.sourceforge.net" target="_top">FindBugs web page</a>.
12 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="datamining.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="acknowledgments.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;12.&nbsp;Data mining of bugs with <span class="application">FindBugs</span>&#8482;&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;14.&nbsp;Acknowledgments</td></tr></table></div></body></html>
doc/manual/note.png less more
Binary diff not shown
doc/manual/project-dialog.png less more
Binary diff not shown
+0
-33
doc/manual/rejarForAnalysis.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;11.&nbsp;Using rejarForAnalysis</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="annotations.html" title="Chapter&nbsp;10.&nbsp;Annotations"><link rel="next" href="datamining.html" title="Chapter&nbsp;12.&nbsp;Data mining of bugs with FindBugs&#8482;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;11.&nbsp;Using rejarForAnalysis</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="annotations.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="datamining.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;11.&nbsp;Using rejarForAnalysis"><div class="titlepage"><div><div><h2 class="title"><a name="rejarForAnalysis"></a>Chapter&nbsp;11.&nbsp;Using rejarForAnalysis</h2></div></div></div><p>
3 If your project consists of many jarfiles or the jarfiles are scattered
4 over many directories, you may wish to use the <span class="command"><strong>rejarForAnalysis
5 </strong></span> script to make
6 FindBugs invocation easier. The script collects many jarfiles and combines them
7 into a single, large jarfile that can then be easily passed to FindBugs for
8 analysis. This can be particularly useful in combination with the 'find' command
9 on unix systems; e.g. <span class="command"><strong>find . -name '*.jar' | xargs rejarForAnalysis
10 </strong></span>.
11 </p><p>
12 The <span class="command"><strong>rejarForAnalysis</strong></span> script
13 can also be used to split a very large project up into a set of jarfiles with
14 the project classfiles evenly divided between them. This is useful when running
15 FindBugs on the entire project is not practical due to time or memory consumption.
16 Instead of running FindBugs on the entire project, you may use <span class="command"><strong>
17 rejarForAnalysis</strong></span> build one large, all-inclusive jarfile
18 containing all classes, invoke <span class="command"><strong>rejarForAnalysis</strong></span>
19 again to split the project into multiple jarfiles, then run FindBugs
20 on each divided jarfiles in turn, specifying the the all-inclusive jarfile in
21 the <span class="command"><strong>-auxclasspath</strong></span>.
22 </p><p>
23 These are the options accepted by the <span class="command"><strong>rejarForAnalysis</strong></span> script:
24 </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-maxAge</strong></span> <em class="replaceable"><code>days</code></em></span></dt><dd><p>
25 Maximum age in days (ignore jar files older than this).
26 </p></dd><dt><span class="term"><span class="command"><strong>-inputFileList</strong></span> <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
27 Text file containing names of jar files.
28 </p></dd><dt><span class="term"><span class="command"><strong>-maxClasses</strong></span> <em class="replaceable"><code>num</code></em></span></dt><dd><p>
29 Maximum number of classes per analysis*.jar file.
30 </p></dd><dt><span class="term"><span class="command"><strong>-prefix</strong></span> <em class="replaceable"><code>class name prefix</code></em></span></dt><dd><p>
31 Prefix of class names that should be analyzed (e.g., edu.umd.cs.).
32 </p></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="annotations.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="datamining.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;10.&nbsp;Annotations&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;12.&nbsp;Data mining of bugs with <span class="application">FindBugs</span>&#8482;</td></tr></table></div></body></html>
+0
-209
doc/manual/running.html less more
0 <html><head>
1 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
2 <title>Chapter&nbsp;4.&nbsp;Running FindBugs&#8482;</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" title="FindBugs&#8482; Manual"><link rel="prev" href="building.html" title="Chapter&nbsp;3.&nbsp;Building FindBugs&#8482; from Source"><link rel="next" href="gui.html" title="Chapter&nbsp;5.&nbsp;Using the FindBugs GUI"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;4.&nbsp;Running <span class="application">FindBugs</span>&#8482;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="building.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="gui.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;4.&nbsp;Running FindBugs&#8482;"><div class="titlepage"><div><div><h2 class="title"><a name="running"></a>Chapter&nbsp;4.&nbsp;Running <span class="application">FindBugs</span>&#8482;</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="running.html#d0e465">1. Quick Start</a></span></dt><dt><span class="sect1"><a href="running.html#d0e503">2. Executing <span class="application">FindBugs</span></a></span></dt><dt><span class="sect1"><a href="running.html#commandLineOptions">3. Command-line Options</a></span></dt></dl></div><p>
3 <span class="application">FindBugs</span> has two user interfaces: a graphical user interface (GUI) and a
4 command line user interface. This chapter describes
5 how to run each of these user interfaces.
6 </p><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>
7 This chapter is in the process of being re-written.
8 The rewrite is not complete yet.
9 </p></td></tr></table></div><div class="sect1" title="1.&nbsp;Quick Start"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e465"></a>1.&nbsp;Quick Start</h2></div></div></div><p>
10 If you are running <span class="application">FindBugs</span> on a Windows system,
11 double-click on the file <code class="filename"><em class="replaceable"><code>%FINDBUGS_HOME%</code></em>\lib\findbugs.jar</code> to start the <span class="application">FindBugs</span> GUI.
12 </p><p>
13 On a Unix, Linux, or Mac OS X system, run the <code class="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/bin/findbugs</code>
14 script, or run the command </p><pre class="screen">
15 <span class="command"><strong>java -jar <em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbugs.jar</strong></span></pre><p>
16 to run the <span class="application">FindBugs</span> GUI.
17 </p><p>
18 Refer to <a class="xref" href="gui.html" title="Chapter&nbsp;5.&nbsp;Using the FindBugs GUI">Chapter&nbsp;5, <i>Using the <span class="application">FindBugs</span> GUI</i></a> for information on how to use the GUI.
19 </p></div><div class="sect1" title="2.&nbsp;Executing FindBugs"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e503"></a>2.&nbsp;Executing <span class="application">FindBugs</span></h2></div></div></div><p>
20 This section describes how to invoke the <span class="application">FindBugs</span> program.
21 There are two ways to invoke <span class="application">FindBugs</span>: directly, or using a
22 wrapper script.
23 </p><div class="sect2" title="2.1.&nbsp;Direct invocation of FindBugs"><div class="titlepage"><div><div><h3 class="title"><a name="directInvocation"></a>2.1.&nbsp;Direct invocation of <span class="application">FindBugs</span></h3></div></div></div><p>
24 The preferred method of running <span class="application">FindBugs</span> is to directly execute
25 <code class="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbugs.jar</code> using the <span class="command"><strong>-jar</strong></span>
26 command line switch of the JVM (<span class="command"><strong>java</strong></span>) executable.
27 (Versions of <span class="application">FindBugs</span> prior to 1.3.5 required a wrapper script
28 to invoke <span class="application">FindBugs</span>.)
29 </p><p>
30 The general syntax of invoking <span class="application">FindBugs</span> directly is the following:
31 </p><pre class="screen">
32 <span class="command"><strong>java <em class="replaceable"><code>[JVM arguments]</code></em> -jar <em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbugs.jar <em class="replaceable"><code>options...</code></em></strong></span>
33 </pre><p>
34 </p><div class="sect3" title="2.1.1.&nbsp;Choosing the User Interface"><div class="titlepage"><div><div><h4 class="title"><a name="chooseUI"></a>2.1.1.&nbsp;Choosing the User Interface</h4></div></div></div><p>
35 The first command line option chooses the <span class="application">FindBugs</span> user interface to execute.
36 Possible values are:
37 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
38 <span class="command"><strong>-gui</strong></span>: runs the graphical user interface (GUI)
39 </p></li><li class="listitem"><p>
40 <span class="command"><strong>-textui</strong></span>: runs the command line user interface
41 </p></li><li class="listitem"><p>
42 <span class="command"><strong>-version</strong></span>: displays the <span class="application">FindBugs</span> version number
43 </p></li><li class="listitem"><p>
44 <span class="command"><strong>-help</strong></span>: displays help information for the
45 <span class="application">FindBugs</span> command line user interface
46 </p></li><li class="listitem"><p>
47 <span class="command"><strong>-gui1</strong></span>: executes the original (obsolete)
48 <span class="application">FindBugs</span> graphical user interface
49 </p></li></ul></div></div><div class="sect3" title="2.1.2.&nbsp;Java Virtual Machine (JVM) arguments"><div class="titlepage"><div><div><h4 class="title"><a name="jvmArgs"></a>2.1.2.&nbsp;Java Virtual Machine (JVM) arguments</h4></div></div></div><p>
50 Several Java Virtual Machine arguments are useful when invoking
51 <span class="application">FindBugs</span>.
52 </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-Xmx<em class="replaceable"><code>NN</code></em>m</strong></span></span></dt><dd><p>
53 Set the maximum Java heap size to <em class="replaceable"><code>NN</code></em>
54 megabytes. <span class="application">FindBugs</span> generally requires a large amount of
55 memory. For a very large project, using 1500 megabytes
56 is not unusual.
57 </p></dd><dt><span class="term"><span class="command"><strong>-D<em class="replaceable"><code>name</code></em>=<em class="replaceable"><code>value</code></em></strong></span></span></dt><dd><p>
58 Set a Java system property. For example, you might use the
59 argument <span class="command"><strong>-Duser.language=ja</strong></span> to display
60 GUI messages in Japanese.
61 </p></dd></dl></div></div></div><div class="sect2" title="2.2.&nbsp;Invocation of FindBugs using a wrapper script"><div class="titlepage"><div><div><h3 class="title"><a name="wrapperScript"></a>2.2.&nbsp;Invocation of <span class="application">FindBugs</span> using a wrapper script</h3></div></div></div><p>
62 Another way to run <span class="application">FindBugs</span> is to use a wrapper script.
63 </p><p>
64 On Unix-like systems, use the following command to invoke the wrapper script:
65 </p><pre class="screen">
66 <code class="prompt">$ </code><span class="command"><strong><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/bin/findbugs <em class="replaceable"><code>options...</code></em></strong></span>
67 </pre><p>
68 </p><p>
69 On Windows systems, the command to invoke the wrapper script is
70 </p><pre class="screen">
71 <code class="prompt">C:\My Directory&gt;</code><span class="command"><strong><em class="replaceable"><code>%FINDBUGS_HOME%</code></em>\bin\findbugs.bat <em class="replaceable"><code>options...</code></em></strong></span>
72 </pre><p>
73 </p><p>
74 On both Unix-like and Windows systems, you can simply add the <code class="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/bin</code>
75 directory to your <code class="filename">PATH</code> environment variable and then invoke
76 FindBugs using the <span class="command"><strong>findbugs</strong></span> command.
77 </p><div class="sect3" title="2.2.1.&nbsp;Wrapper script command line options"><div class="titlepage"><div><div><h4 class="title"><a name="wrapperOptions"></a>2.2.1.&nbsp;Wrapper script command line options</h4></div></div></div><p>The <span class="application">FindBugs</span> wrapper scripts support the following command-line options.
78 Note that these command line options are <span class="emphasis"><em>not</em></span> handled by
79 the <span class="application">FindBugs</span> program per se; rather, they are handled by the wrapper
80 script.
81 </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-jvmArgs <em class="replaceable"><code>args</code></em></strong></span></span></dt><dd><p>
82 Specifies arguments to pass to the JVM. For example, you might want
83 to set a JVM property:
84 </p><pre class="screen">
85 <code class="prompt">$ </code><span class="command"><strong>findbugs -textui -jvmArgs "-Duser.language=ja" <em class="replaceable"><code>myApp.jar</code></em></strong></span>
86 </pre><p>
87 </p></dd><dt><span class="term"><span class="command"><strong>-javahome <em class="replaceable"><code>directory</code></em></strong></span></span></dt><dd><p>
88 Specifies the directory containing the JRE (Java Runtime Environment) to
89 use to execute <span class="application">FindBugs</span>.
90 </p></dd><dt><span class="term"><span class="command"><strong>-maxHeap <em class="replaceable"><code>size</code></em></strong></span></span></dt><dd><p>
91 Specifies the maximum Java heap size in megabytes. The default is 256.
92 More memory may be required to analyze very large programs or libraries.
93 </p></dd><dt><span class="term"><span class="command"><strong>-debug</strong></span></span></dt><dd><p>
94 Prints a trace of detectors run and classes analyzed to standard output.
95 Useful for troubleshooting unexpected analysis failures.
96 </p></dd><dt><span class="term"><span class="command"><strong>-property</strong></span> <em class="replaceable"><code>name=value</code></em></span></dt><dd><p>
97 This option sets a system property.&nbsp; <span class="application">FindBugs</span> uses system properties
98 to configure analysis options. See <a class="xref" href="analysisprops.html" title="Chapter&nbsp;9.&nbsp;Analysis Properties">Chapter&nbsp;9, <i>Analysis Properties</i></a>.
99 You can use this option multiple times in order to set multiple properties.
100 Note: In most versions of Windows, the <em class="replaceable"><code>name=value</code></em>
101 string must be in quotes.
102 </p></dd></dl></div></div></div></div><div class="sect1" title="3.&nbsp;Command-line Options"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="commandLineOptions"></a>3.&nbsp;Command-line Options</h2></div></div></div><p>
103 This section describes the command line options supported by <span class="application">FindBugs</span>.
104 These command line options may be used when invoking <span class="application">FindBugs</span> directly,
105 or when using a wrapper script.
106 </p><div class="sect2" title="3.1.&nbsp;Common command-line options"><div class="titlepage"><div><div><h3 class="title"><a name="d0e796"></a>3.1.&nbsp;Common command-line options</h3></div></div></div><p>
107 These options may be used with both the GUI and command-line interfaces.
108 </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-effort:min</strong></span></span></dt><dd><p>
109 This option disables analyses that increase precision but also
110 increase memory consumption. You may want to try this option if
111 you find that <span class="application">FindBugs</span> runs out of memory, or takes an unusually
112 long time to complete its analysis.
113 </p></dd><dt><span class="term"><span class="command"><strong>-effort:max</strong></span></span></dt><dd><p>
114 Enable analyses which increase precision and find more bugs, but which
115 may require more memory and take more time to complete.
116 </p></dd><dt><span class="term"><span class="command"><strong>-project</strong></span> <em class="replaceable"><code>project</code></em></span></dt><dd><p>
117 Specify a project to be analyzed. The project file you specify should
118 be one that was created using the GUI interface. It will typically end
119 in the extension <code class="filename">.fb</code> or <code class="filename">.fbp</code>.
120 </p></dd></dl></div></div><div class="sect2" title="3.2.&nbsp;GUI Options"><div class="titlepage"><div><div><h3 class="title"><a name="d0e836"></a>3.2.&nbsp;GUI Options</h3></div></div></div><p>
121 These options are only accepted by the Graphical User Interface.
122
123 </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-look:</strong></span><em class="replaceable"><code>plastic|gtk|native</code></em></span></dt><dd><p>
124 Set Swing look and feel.
125 </p></dd></dl></div><p>
126 </p></div><div class="sect2" title="3.3.&nbsp;Text UI Options"><div class="titlepage"><div><div><h3 class="title"><a name="d0e852"></a>3.3.&nbsp;Text UI Options</h3></div></div></div><p>
127 These options are only accepted by the Text User Interface.
128 </p><div class="variablelist"><dl><dt><span class="term"><span class="command"><strong>-sortByClass</strong></span></span></dt><dd><p>
129 Sort reported bug instances by class name.
130 </p></dd><dt><span class="term"><span class="command"><strong>-include</strong></span> <em class="replaceable"><code>filterFile.xml</code></em></span></dt><dd><p>
131 Only report bug instances that match the filter specified by <em class="replaceable"><code>filterFile.xml</code></em>.
132 See <a class="xref" href="filter.html" title="Chapter&nbsp;8.&nbsp;Filter Files">Chapter&nbsp;8, <i>Filter Files</i></a>.
133 </p></dd><dt><span class="term"><span class="command"><strong>-exclude</strong></span> <em class="replaceable"><code>filterFile.xml</code></em></span></dt><dd><p>
134 Report all bug instances except those matching the filter specified by <em class="replaceable"><code>filterFile.xml</code></em>.
135 See <a class="xref" href="filter.html" title="Chapter&nbsp;8.&nbsp;Filter Files">Chapter&nbsp;8, <i>Filter Files</i></a>.
136 </p></dd><dt><span class="term"><span class="command"><strong>-onlyAnalyze</strong></span> <em class="replaceable"><code>com.foobar.MyClass,com.foobar.mypkg.*</code></em></span></dt><dd><p>
137 Restrict analysis to find bugs to given comma-separated list of
138 classes and packages.
139 Unlike filtering, this option avoids running analysis on
140 classes and packages that are not explicitly matched:
141 for large projects, this may greatly reduce the amount of time
142 needed to run the analysis. (However, some detectors may produce
143 inaccurate results if they aren't run on the entire application.)
144 Classes should be specified using their full classnames (including
145 package), and packages should be specified in the same way
146 they would in a Java <code class="literal">import</code> statement to
147 import all classes in the package (i.e., add <code class="literal">.*</code>
148 to the full name of the package).
149 Replace <code class="literal">.*</code> with <code class="literal">.-</code> to also
150 analyze all subpackages.
151 </p></dd><dt><span class="term"><span class="command"><strong>-low</strong></span></span></dt><dd><p>
152 Report all bugs.
153 </p></dd><dt><span class="term"><span class="command"><strong>-medium</strong></span></span></dt><dd><p>
154 Report medium and high priority bugs. This is the default setting.
155 </p></dd><dt><span class="term"><span class="command"><strong>-high</strong></span></span></dt><dd><p>
156 Report only high priority bugs.
157 </p></dd><dt><span class="term"><span class="command"><strong>-relaxed</strong></span></span></dt><dd><p>
158 Relaxed reporting mode. For many detectors, this option
159 suppresses the heuristics used to avoid reporting false positives.
160 </p></dd><dt><span class="term"><span class="command"><strong>-xml</strong></span></span></dt><dd><p>
161 Produce the bug reports as XML. The XML data produced may be
162 viewed in the GUI at a later time. You may also specify this
163 option as <span class="command"><strong>-xml:withMessages</strong></span>; when this variant
164 of the option is used, the XML output will contain human-readable
165 messages describing the warnings contained in the file.
166 XML files generated this way are easy to transform into reports.
167 </p></dd><dt><span class="term"><span class="command"><strong>-html</strong></span></span></dt><dd><p>
168 Generate HTML output. By default, <span class="application">FindBugs</span> will use the <code class="filename">default.xsl</code>
169 <a class="ulink" href="http://www.w3.org/TR/xslt" target="_top">XSLT</a>
170 stylesheet to generate the HTML: you can find this file in <code class="filename">findbugs.jar</code>,
171 or in the <span class="application">FindBugs</span> source or binary distributions. Variants of this option include
172 <span class="command"><strong>-html:plain.xsl</strong></span>, <span class="command"><strong>-html:fancy.xsl</strong></span> and <span class="command"><strong>-html:fancy-hist.xsl</strong></span>.
173 The <code class="filename">plain.xsl</code> stylesheet does not use Javascript or DOM,
174 and may work better with older web browsers, or for printing. The <code class="filename">fancy.xsl</code>
175 stylesheet uses DOM and Javascript for navigation and CSS for
176 visual presentation. The <span class="command"><strong>fancy-hist.xsl</strong></span> an evolution of <span class="command"><strong>fancy.xsl</strong></span> stylesheet.
177 It makes an extensive use of DOM and Javascript for dynamically filtering the lists of bugs.
178 </p><p>
179 If you want to specify your own
180 XSLT stylesheet to perform the transformation to HTML, specify the option as
181 <span class="command"><strong>-html:<em class="replaceable"><code>myStylesheet.xsl</code></em></strong></span>,
182 where <em class="replaceable"><code>myStylesheet.xsl</code></em> is the filename of the
183 stylesheet you want to use.
184 </p></dd><dt><span class="term"><span class="command"><strong>-emacs</strong></span></span></dt><dd><p>
185 Produce the bug reports in Emacs format.
186 </p></dd><dt><span class="term"><span class="command"><strong>-xdocs</strong></span></span></dt><dd><p>
187 Produce the bug reports in xdoc XML format for use with Apache Maven.
188 </p></dd><dt><span class="term"><span class="command"><strong>-output</strong></span> <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
189 Produce the output in the specified file.
190 </p></dd><dt><span class="term"><span class="command"><strong>-outputFile</strong></span> <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
191 This argument is deprecated. Use <span class="command"><strong>-output</strong></span> instead.
192 </p></dd><dt><span class="term"><span class="command"><strong>-nested</strong></span><em class="replaceable"><code>[:true|false]</code></em></span></dt><dd><p>
193 This option enables or disables scanning of nested jar and zip files found in
194 the list of files and directories to be analyzed.
195 By default, scanning of nested jar/zip files is enabled.
196 To disable it, add <span class="command"><strong>-nested:false</strong></span> to the command line
197 arguments.
198 </p></dd><dt><span class="term"><span class="command"><strong>-auxclasspath</strong></span> <em class="replaceable"><code>classpath</code></em></span></dt><dd><p>
199 Set the auxiliary classpath for analysis. This classpath should include all
200 jar files and directories containing classes that are part of the program
201 being analyzed but you do not want to have analyzed for bugs.
202 </p></dd><dt><span class="term"><span class="command"><strong>-userPrefs</strong></span> <em class="replaceable"><code>edu.umd.cs.findbugs.core.prefs</code></em></span></dt><dd><p>
203 Set the path of the user preferences file to use, which might override some of the options abobe.
204 Specifying <code class="literal">userPrefs</code> as first argument would mean some later
205 options will override them, as last argument would mean they will override some previous options).
206 This rationale behind this option is to reuse FindBugs Eclipse project settings for command
207 line execution.
208 </p></dd></dl></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="building.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="gui.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;3.&nbsp;Building <span class="application">FindBugs</span>&#8482; from Source&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;5.&nbsp;Using the <span class="application">FindBugs</span> GUI</td></tr></table></div></body></html>
doc/manual/warning.png less more
Binary diff not shown
+0
-30
doc/manual-fo.xsl less more
0 <?xml version='1.0'?>
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 version='1.0'
3 xmlns="http://www.w3.org/TR/xhtml1/transitional"
4 exclude-result-prefixes="#default">
5
6 <!-- build.xml will substitute the real path to fo/docbook.xsl here. -->
7 <xsl:import href="/Users/pugh/tools/docbook-xsl-1.76.1/fo/docbook.xsl"/>
8
9 <!-- Enumerate sections. -->
10 <xsl:variable name="section.autolabel">1</xsl:variable>
11
12 <!-- Use graphics in admonitions -->
13 <xsl:variable name="admon.graphics">1</xsl:variable>
14
15 <!-- Admonition graphics are in the "manual" subdirectory. -->
16 <xsl:variable name="admon.graphics.path">manual/</xsl:variable>
17
18 <!-- Included graphics are also in the "manual" subdirectory. -->
19 <xsl:variable name="img.src.path">manual/</xsl:variable>
20
21 <!-- Default image width is 5 inches - otherwise, they become much too large.
22 FIXME: for some reason, this isn't honored. Blech.
23 -->
24 <xsl:variable name="default.image.width">5in</xsl:variable>
25
26 <!-- Just put chapters and sect1s in the TOC. -->
27 <xsl:variable name="toc.section.depth">1</xsl:variable>
28
29 </xsl:stylesheet>
+0
-3990
doc/manual.xml less more
0 <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2 "file:../etc/docbook/docbookx.dtd" [
3 <!ENTITY FindBugs "<application>FindBugs</application>">
4 <!ENTITY Ant "<application>Ant</application>">
5 <!ENTITY Saxon "<application>Saxon</application>">
6 <!ENTITY FBHome "<replaceable>$FINDBUGS_HOME</replaceable>">
7 <!ENTITY FBHomeWin "<replaceable>&#x25;FINDBUGS_HOME&#x25;</replaceable>">
8 <!ENTITY nbsp "&#160;">
9 ]>
10
11 <book lang="en" id="findbugs-manual">
12
13 <bookinfo>
14 <title>&FindBugs;&trade; Manual</title>
15
16 <authorgroup>
17 <author>
18 <firstname>David</firstname>
19 <othername>H.</othername>
20 <surname>Hovemeyer</surname>
21 </author>
22 <author>
23 <firstname>William</firstname>
24 <othername>W.</othername>
25 <surname>Pugh</surname>
26 </author>
27 </authorgroup>
28
29 <copyright>
30 <year>2003 - 2012</year>
31 <holder>University of Maryland</holder>
32 </copyright>
33
34 <legalnotice>
35 <para>
36 This manual is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License.
37 To view a copy of this license, visit
38 <ulink url="http://creativecommons.org/licenses/by-nc-sa/1.0/">http://creativecommons.org/licenses/by-nc-sa/1.0/</ulink>
39 or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
40 </para>
41 <para>
42 The name FindBugs and the FindBugs logo are trademarked by the University of Maryland.
43 </para>
44 </legalnotice>
45
46 <edition>2.0.3</edition>
47
48 <pubdate>17:16:15 EST, 22 November, 2013</pubdate>
49
50 </bookinfo>
51
52 <!--
53 **************************************************************************
54 Introduction
55 **************************************************************************
56 -->
57
58 <chapter id="introduction">
59 <title>Introduction</title>
60
61 <para> &FindBugs;&trade; is a program to find bugs in Java programs. It looks for instances
62 of "bug patterns" --- code instances that are likely to be errors.</para>
63
64 <para> This document describes version 2.0.3 of &FindBugs;.We
65 are very interested in getting your feedback on &FindBugs;. Please visit
66 the <ulink url="http://findbugs.sourceforge.net">&FindBugs; web page</ulink> for
67 the latest information on &FindBugs;, contact information, and support resources such
68 as information about the &FindBugs; mailing lists.</para>
69
70 <sect1>
71 <title>Requirements</title>
72 <para> To use &FindBugs;, you need a runtime environment compatible with
73 <ulink url="http://java.sun.com/j2se">Java 2 Standard Edition</ulink>, version 1.5 or later.
74 &FindBugs; is platform independent, and is known to run on GNU/Linux, Windows, and
75 MacOS X platforms.</para>
76
77 <para>You should have at least 512 MB of memory to use &FindBugs;.
78 To analyze very large projects, more memory may be needed.</para>
79 </sect1>
80
81 </chapter>
82
83 <!--
84 **************************************************************************
85 Installing FindBugs
86 **************************************************************************
87 -->
88
89 <chapter id="installing">
90 <title>Installing &FindBugs;&trade;</title>
91
92 <para>
93 This chapter explains how to install &FindBugs;.
94 </para>
95
96 <sect1>
97 <title>Extracting the Distribution</title>
98
99 <para>
100 The easiest way to install &FindBugs; is to download a binary distribution.
101 Binary distributions are available in
102 <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.tar.gz?download">gzipped tar format</ulink> and
103 <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.zip?download">zip format</ulink>.
104 Once you have downloaded a binary distribution, extract it into a directory of your choice.
105 </para>
106
107 <para>
108 Extracting a gzipped tar format distribution:
109 <screen>
110 <prompt>$ </prompt><command>gunzip -c findbugs-2.0.3.tar.gz | tar xvf -</command>
111 </screen>
112 </para>
113
114 <para>
115 Extracting a zip format distribution:
116 <screen>
117 <prompt>C:\Software></prompt><command>unzip findbugs-2.0.3.zip</command>
118 </screen>
119 </para>
120
121 <para>
122 Usually, extracting a binary distribution will create a directory ending in
123 <filename class="directory">findbugs-2.0.3</filename>. For example, if you extracted
124 the binary distribution from the <filename class="directory">C:\Software</filename>
125 directory, then the &FindBugs; software will be extracted into the directory
126 <filename class="directory">C:\Software\findbugs-2.0.3</filename>.
127 This directory is the &FindBugs; home directory. We'll refer to it as
128 &FBHome; (or &FBHomeWin; for Windows) throughout this manual.
129 </para>
130 </sect1>
131
132 </chapter>
133
134 <!--
135 **************************************************************************
136 Compiling FindBugs from Source
137 **************************************************************************
138 -->
139
140 <chapter id="building">
141 <title>Building &FindBugs;&trade; from Source</title>
142
143 <para>
144 This chapter describes how to build &FindBugs; from source code. Unless you are
145 interesting in modifying &FindBugs;, you will probably want to skip to the
146 <link linkend="running">next chapter</link>.
147 </para>
148
149 <sect1>
150 <title>Prerequisites</title>
151
152 <para>
153 To compile &FindBugs; from source, you will need the following:
154 <itemizedlist>
155 <listitem>
156 <para>
157 The <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3-source.zip?download"
158 >&FindBugs; source distribution</ulink>
159 </para>
160 </listitem>
161 <listitem>
162 <para>
163 <ulink url="http://java.sun.com/j2se/">JDK 1.5.0 or later</ulink>
164 </para>
165 </listitem>
166 <listitem>
167 <para>
168 <ulink url="http://ant.apache.org/">Apache &Ant;</ulink>, version 1.6.3 or later
169 </para>
170 </listitem>
171 </itemizedlist>
172 </para>
173
174 <warning>
175 <para>
176 The version of &Ant; included as <filename>/usr/bin/ant</filename> on
177 Redhat Linux systems will <emphasis>not</emphasis> work for compiling
178 &FindBugs;. We recommend you install a binary distribution of &Ant;
179 downloaded from the <ulink url="http://ant.apache.org/">&Ant; website</ulink>.
180 Make sure that when you run &Ant; your <replaceable>JAVA_HOME</replaceable>
181 environment variable points to the directory in which you installed
182 JDK 1.5 (or later).
183 </para>
184 </warning>
185
186 <para>
187 If you want to be able to generate formatted versions of the &FindBugs; documentation,
188 you will also need the following software:
189 <itemizedlist>
190 <listitem>
191 <para>
192 The <ulink url="http://docbook.sourceforge.net/projects/xsl/index.html">DocBook XSL Stylesheets</ulink>.
193 These are required to convert the &FindBugs; manual into HTML format.
194 </para>
195 </listitem>
196 <listitem>
197 <para>
198 The <ulink url="http://saxon.sourceforge.net/">&Saxon; XSLT Processor</ulink>.
199 (Also required for converting the &FindBugs; manual to HTML.)
200 </para>
201 </listitem>
202 <!--
203 <listitem>
204 <para>
205 </para>
206 </listitem>
207 -->
208 </itemizedlist>
209 </para>
210
211 </sect1>
212
213 <sect1>
214 <title>Extracting the Source Distribution</title>
215 <para>
216 After you download the source distribution, you'll need to extract it into
217 a working directory. A typical command to do this is:
218
219 <screen>
220 <prompt>$ </prompt><command>unzip findbugs-2.0.3-source.zip</command>
221 </screen>
222
223 </para>
224 </sect1>
225
226 <sect1>
227 <title>Modifying <filename>local.properties</filename></title>
228 <para>
229 If you intend to build the FindBugs documentation,
230 you will need to modify the <filename>local.properties</filename> file
231 used by the <ulink url="http://ant.apache.org/">&Ant;</ulink>
232 <filename>build.xml</filename> file to build &FindBugs;.
233 If you do not want to build the FindBugs documentation, then you
234 can ignore this file.
235 </para>
236
237 <para>
238 The <filename>local.properties</filename> overrides definitions
239 in the <filename>build.properties</filename> file.
240 The <filename>build.properties</filename> file looks something like this:
241 <programlisting>
242 <![CDATA[
243 # User Configuration:
244 # This section must be modified to reflect your system.
245
246 local.software.home =/export/home/daveho/linux
247
248 # Set this to the directory containing the DocBook Modular XSL Stylesheets
249 # from http://docbook.sourceforge.net/projects/xsl/
250
251 xsl.stylesheet.home =${local.software.home}/docbook/docbook-xsl-1.71.1
252
253 # Set this to the directory where Saxon (http://saxon.sourceforge.net/)
254 # is installed.
255
256 saxon.home =${local.software.home}/java/saxon-6.5.5
257 ]]>
258 </programlisting>
259 </para>
260
261 <para>
262 The <varname>xsl.stylesheet.home</varname> property specifies the full
263 path to the directory where you have installed the
264 <ulink url="http://docbook.sourceforge.net/projects/xsl/">DocBook Modular XSL
265 Stylesheets</ulink>. You only need to specify this property if you will be
266 generating the &FindBugs; documentation.
267 </para>
268
269 <para>
270 The <varname>saxon.home</varname> property is the full path to the
271 directory where you installed the <ulink url="http://saxon.sourceforge.net/">&Saxon; XSLT Processor</ulink>.
272 You only need to specify this property if you will be
273 generating the &FindBugs; documentation.
274 </para>
275
276 </sect1>
277
278 <sect1>
279 <title>Running &Ant;</title>
280
281 <para>
282 Once you have extracted the source distribution,
283 made sure that &Ant; is installed,
284 modified <filename>build.properties</filename> (optional),
285 and configured the tools (such as &Saxon;),
286 you are ready to build &FindBugs;. Invoking &Ant; is a simple matter
287 of running the command
288 <screen>
289 <prompt>$ </prompt><command>ant <replaceable>target</replaceable></command>
290 </screen>
291 where <replaceable>target</replaceable> is one of the following:
292 <variablelist>
293 <varlistentry>
294 <term><command>build</command></term>
295 <listitem>
296 <para>
297 This target compiles the code for &FindBugs;. It is the default target.
298 </para>
299 </listitem>
300 </varlistentry>
301
302 <varlistentry>
303 <term><command>docs</command></term>
304 <listitem>
305 <para>
306 This target formats the documentation. (It also compiles some of
307 the source code as a side-effect.)
308 </para>
309 </listitem>
310 </varlistentry>
311
312 <varlistentry>
313 <term><command>runjunit</command></term>
314 <listitem>
315 <para>
316 This target compiles and runs the internal JUnit tests included
317 in &FindBugs;. It will print an error message if any unit
318 tests fail.
319 </para>
320 </listitem>
321 </varlistentry>
322
323 <varlistentry>
324 <term><command>bindist</command></term>
325 <listitem>
326 <para>
327 Builds a binary distribution of &FindBugs;.
328 The target creates both <filename>.zip</filename> and
329 <filename>.tar.gz</filename> archives.
330 </para>
331 </listitem>
332 </varlistentry>
333 </variablelist>
334 </para>
335
336 <para>
337 After running an &Ant; command, you should see output similar to
338 the following (after some other messages regarding the tasks that
339 &Ant; is running):
340 <screen>
341 <computeroutput>
342 BUILD SUCCESSFUL
343 Total time: 17 seconds
344 </computeroutput>
345 </screen>
346 </para>
347
348 </sect1>
349
350 <sect1>
351 <title>Running &FindBugs;&trade; from a source directory</title>
352 <para>
353 The &Ant; build script for &FindBugs; is written such that after
354 building the <command>build</command> target, the working directory
355 is set up just like a binary distribution. So, the information about
356 running &FindBugs; in <xref linkend="running" />
357 applies to source distributions, too.
358 </para>
359 </sect1>
360
361 </chapter>
362
363
364 <!--
365 **************************************************************************
366 Running FindBugs
367 **************************************************************************
368 -->
369
370 <chapter id="running">
371 <title>Running &FindBugs;&trade;</title>
372
373 <para>
374 &FindBugs; has two user interfaces: a graphical user interface (GUI) and a
375 command line user interface. This chapter describes
376 how to run each of these user interfaces.
377 </para>
378
379 <warning>
380 <para>
381 This chapter is in the process of being re-written.
382 The rewrite is not complete yet.
383 </para>
384 </warning>
385
386 <!--
387 <sect1>
388 <title>Executing the &FindBugs;&trade; GUI</title>
389 </sect1>
390 -->
391
392 <sect1>
393 <title>Quick Start</title>
394 <para>
395 If you are running &FindBugs; on a Windows system,
396 double-click on the file <filename>&FBHomeWin;\lib\findbugs.jar</filename> to start the &FindBugs; GUI.
397 </para>
398
399 <para>
400 On a Unix, Linux, or Mac OS X system, run the <filename>&FBHome;/bin/findbugs</filename>
401 script, or run the command <screen>
402 <command>java -jar &FBHome;/lib/findbugs.jar</command></screen>
403 to run the &FindBugs; GUI.
404 </para>
405
406 <para>
407 Refer to <xref linkend="gui"/> for information on how to use the GUI.
408 </para>
409 </sect1>
410
411 <sect1>
412
413 <title>Executing &FindBugs;</title>
414
415 <para>
416 This section describes how to invoke the &FindBugs; program.
417 There are two ways to invoke &FindBugs;: directly, or using a
418 wrapper script.
419 </para>
420
421
422 <sect2 id="directInvocation">
423 <title>Direct invocation of &FindBugs;</title>
424
425 <para>
426 The preferred method of running &FindBugs; is to directly execute
427 <filename>&FBHome;/lib/findbugs.jar</filename> using the <command>-jar</command>
428 command line switch of the JVM (<command>java</command>) executable.
429 (Versions of &FindBugs; prior to 1.3.5 required a wrapper script
430 to invoke &FindBugs;.)
431 </para>
432
433 <para>
434 The general syntax of invoking &FindBugs; directly is the following:
435 <screen>
436 <command>java <replaceable>[JVM arguments]</replaceable> -jar &FBHome;/lib/findbugs.jar <replaceable>options...</replaceable></command>
437 </screen>
438 </para>
439
440 <!--
441 <para>
442 By default, executing <filename>findbugs.jar</filename> runs the
443 &FindBugs; graphical user interface (GUI). On windows systems,
444 you can double-click on <filename>findbugs.jar</filename> to launch
445 the GUI. From a command line, the command
446 <screen>
447 java -jar <replaceable>&FBHome;</replaceable>/lib/findbugs.jar</screen>
448 will launch the GUI.
449 </para>
450 -->
451
452 <sect3 id="chooseUI">
453 <title>Choosing the User Interface</title>
454
455 <para>
456 The first command line option chooses the &FindBugs; user interface to execute.
457 Possible values are:
458 </para>
459 <itemizedlist>
460 <listitem>
461 <para>
462 <command>-gui</command>: runs the graphical user interface (GUI)
463 </para>
464 </listitem>
465
466 <listitem>
467 <para>
468 <command>-textui</command>: runs the command line user interface
469 </para>
470 </listitem>
471
472 <listitem>
473 <para>
474 <command>-version</command>: displays the &FindBugs; version number
475 </para>
476 </listitem>
477
478 <listitem>
479 <para>
480 <command>-help</command>: displays help information for the
481 &FindBugs; command line user interface
482 </para>
483 </listitem>
484
485 <listitem>
486 <para>
487 <command>-gui1</command>: executes the original (obsolete)
488 &FindBugs; graphical user interface
489 </para>
490 </listitem>
491 </itemizedlist>
492
493 </sect3>
494
495 <sect3 id="jvmArgs">
496 <title>Java Virtual Machine (JVM) arguments</title>
497
498 <para>
499 Several Java Virtual Machine arguments are useful when invoking
500 &FindBugs;.
501 </para>
502
503 <variablelist>
504 <varlistentry>
505 <term><command>-Xmx<replaceable>NN</replaceable>m</command></term>
506 <listitem>
507 <para>
508 Set the maximum Java heap size to <replaceable>NN</replaceable>
509 megabytes. &FindBugs; generally requires a large amount of
510 memory. For a very large project, using 1500 megabytes
511 is not unusual.
512 </para>
513 </listitem>
514 </varlistentry>
515
516 <varlistentry>
517 <term><command>-D<replaceable>name</replaceable>=<replaceable>value</replaceable></command></term>
518 <listitem>
519 <para>
520 Set a Java system property. For example, you might use the
521 argument <command>-Duser.language=ja</command> to display
522 GUI messages in Japanese.
523 </para>
524 </listitem>
525 </varlistentry>
526
527 <!--
528 <varlistentry>
529 <term></term>
530 <listitem>
531 <para>
532 </para>
533 </listitem>
534 </varlistentry>
535 -->
536 </variablelist>
537 </sect3>
538
539 </sect2>
540
541 <sect2 id="wrapperScript">
542 <title>Invocation of &FindBugs; using a wrapper script</title>
543
544 <para>
545 Another way to run &FindBugs; is to use a wrapper script.
546 </para>
547
548 <para>
549 On Unix-like systems, use the following command to invoke the wrapper script:
550 <screen>
551 <prompt>$ </prompt><command>&FBHome;/bin/findbugs <replaceable>options...</replaceable></command>
552 </screen>
553 </para>
554
555 <para>
556 On Windows systems, the command to invoke the wrapper script is
557 <screen>
558 <prompt>C:\My Directory></prompt><command>&FBHomeWin;\bin\findbugs.bat <replaceable>options...</replaceable></command>
559 </screen>
560 </para>
561
562 <para>
563 On both Unix-like and Windows systems, you can simply add the <filename><replaceable>$FINDBUGS_HOME</replaceable>/bin</filename>
564 directory to your <filename>PATH</filename> environment variable and then invoke
565 FindBugs using the <command>findbugs</command> command.
566 </para>
567
568 <sect3 id="wrapperOptions">
569 <title>Wrapper script command line options</title>
570 <para>The &FindBugs; wrapper scripts support the following command-line options.
571 Note that these command line options are <emphasis>not</emphasis> handled by
572 the &FindBugs; program per se; rather, they are handled by the wrapper
573 script.
574 </para>
575 <variablelist>
576 <varlistentry>
577 <term><command>-jvmArgs <replaceable>args</replaceable></command></term>
578 <listitem>
579 <para>
580 Specifies arguments to pass to the JVM. For example, you might want
581 to set a JVM property:
582 <screen>
583 <prompt>$ </prompt><command>findbugs -textui -jvmArgs "-Duser.language=ja" <replaceable>myApp.jar</replaceable></command>
584 </screen>
585 </para>
586 </listitem>
587 </varlistentry>
588
589 <varlistentry>
590 <term><command>-javahome <replaceable>directory</replaceable></command></term>
591 <listitem>
592 <para>
593 Specifies the directory containing the JRE (Java Runtime Environment) to
594 use to execute &FindBugs;.
595 </para>
596 </listitem>
597 </varlistentry>
598
599 <varlistentry>
600 <term><command>-maxHeap <replaceable>size</replaceable></command></term>
601 <listitem>
602 <para>
603 Specifies the maximum Java heap size in megabytes. The default is 256.
604 More memory may be required to analyze very large programs or libraries.
605 </para>
606 </listitem>
607 </varlistentry>
608
609 <varlistentry>
610 <term><command>-debug</command></term>
611 <listitem>
612 <para>
613 Prints a trace of detectors run and classes analyzed to standard output.
614 Useful for troubleshooting unexpected analysis failures.
615 </para>
616 </listitem>
617 </varlistentry>
618
619 <varlistentry>
620 <term><command>-property</command> <replaceable>name=value</replaceable></term>
621 <listitem>
622 <para>
623 This option sets a system property.&nbsp; &FindBugs; uses system properties
624 to configure analysis options. See <xref linkend="analysisprops"/>.
625 You can use this option multiple times in order to set multiple properties.
626 Note: In most versions of Windows, the <replaceable>name=value</replaceable>
627 string must be in quotes.
628 </para>
629 </listitem>
630 </varlistentry>
631
632 </variablelist>
633
634 </sect3>
635
636 </sect2>
637
638 </sect1>
639
640 <sect1 id="commandLineOptions">
641 <title>Command-line Options</title>
642
643 <!--
644 <para>
645
646 There are two ways to invoke &FindBugs;. The first invokes the the Graphical User Interface (GUI):
647
648 <screen>
649 <prompt>$ </prompt><command>findbugs <replaceable>[standard options]</replaceable> <replaceable>[GUI options]</replaceable></command>
650 </screen>
651
652 The second invokes the Command Line Interface (Text UI):
653
654 <screen>
655 <prompt>$ </prompt><command>findbugs -textui <replaceable>[standard options]</replaceable> <replaceable>[Text UI options]</replaceable></command>
656 </screen>
657 </para>
658 -->
659
660 <para>
661 This section describes the command line options supported by &FindBugs;.
662 These command line options may be used when invoking &FindBugs; directly,
663 or when using a wrapper script.
664 </para>
665
666 <sect2>
667 <title>Common command-line options</title>
668
669 <para>
670 These options may be used with both the GUI and command-line interfaces.
671 </para>
672
673 <variablelist>
674
675 <varlistentry>
676 <term><command>-effort:min</command></term>
677 <listitem>
678 <para>
679 This option disables analyses that increase precision but also
680 increase memory consumption. You may want to try this option if
681 you find that &FindBugs; runs out of memory, or takes an unusually
682 long time to complete its analysis.
683 </para>
684 </listitem>
685 </varlistentry>
686
687
688 <varlistentry>
689 <term><command>-effort:max</command></term>
690 <listitem>
691 <para>
692 Enable analyses which increase precision and find more bugs, but which
693 may require more memory and take more time to complete.
694 </para>
695 </listitem>
696 </varlistentry>
697
698 <varlistentry>
699 <term><command>-project</command> <replaceable>project</replaceable></term>
700 <listitem>
701 <para>
702 Specify a project to be analyzed. The project file you specify should
703 be one that was created using the GUI interface. It will typically end
704 in the extension <filename>.fb</filename> or <filename>.fbp</filename>.
705 </para>
706 </listitem>
707 </varlistentry>
708
709 <!--
710 <varlistentry>
711 <term><command></command></term>
712 <listitem>
713 <para>
714
715 </para>
716 </listitem>
717 </varlistentry>
718 -->
719
720 </variablelist>
721
722 </sect2>
723
724 <sect2>
725 <title>GUI Options</title>
726
727 <para>
728 These options are only accepted by the Graphical User Interface.
729
730 <variablelist>
731 <varlistentry>
732 <term><command>-look:</command><replaceable>plastic|gtk|native</replaceable></term>
733 <listitem>
734 <para>
735 Set Swing look and feel.
736 </para>
737 </listitem>
738 </varlistentry>
739
740 </variablelist>
741 </para>
742 </sect2>
743
744 <sect2>
745 <title>Text UI Options</title>
746
747 <para>
748 These options are only accepted by the Text User Interface.
749 </para>
750
751 <variablelist>
752 <varlistentry>
753 <term><command>-sortByClass</command></term>
754 <listitem>
755 <para>
756 Sort reported bug instances by class name.
757 </para>
758 </listitem>
759 </varlistentry>
760
761 <varlistentry>
762 <term><command >-include</command> <replaceable>filterFile.xml</replaceable></term>
763 <listitem>
764 <para>
765 Only report bug instances that match the filter specified by <replaceable>filterFile.xml</replaceable>.
766 See <xref linkend="filter" />.
767 </para>
768 </listitem>
769 </varlistentry>
770
771 <varlistentry>
772 <term><command >-exclude</command> <replaceable>filterFile.xml</replaceable></term>
773 <listitem>
774 <para>
775 Report all bug instances except those matching the filter specified by <replaceable>filterFile.xml</replaceable>.
776 See <xref linkend="filter" />.
777 </para>
778 </listitem>
779 </varlistentry>
780
781 <varlistentry>
782 <term><command>-onlyAnalyze</command> <replaceable>com.foobar.MyClass,com.foobar.mypkg.*</replaceable></term>
783 <listitem>
784 <para>
785 Restrict analysis to find bugs to given comma-separated list of
786 classes and packages.
787 Unlike filtering, this option avoids running analysis on
788 classes and packages that are not explicitly matched:
789 for large projects, this may greatly reduce the amount of time
790 needed to run the analysis. (However, some detectors may produce
791 inaccurate results if they aren't run on the entire application.)
792 Classes should be specified using their full classnames (including
793 package), and packages should be specified in the same way
794 they would in a Java <literal>import</literal> statement to
795 import all classes in the package (i.e., add <literal>.*</literal>
796 to the full name of the package).
797 Replace <literal>.*</literal> with <literal>.-</literal> to also
798 analyze all subpackages.
799 </para>
800 </listitem>
801 </varlistentry>
802
803 <varlistentry>
804 <term><command>-low</command></term>
805 <listitem>
806 <para>
807 Report all bugs.
808 </para>
809 </listitem>
810 </varlistentry>
811
812 <varlistentry>
813 <term><command>-medium</command></term>
814 <listitem>
815 <para>
816 Report medium and high priority bugs. This is the default setting.
817 </para>
818 </listitem>
819 </varlistentry>
820
821 <varlistentry>
822 <term><command>-high</command></term>
823 <listitem>
824 <para>
825 Report only high priority bugs.
826 </para>
827 </listitem>
828 </varlistentry>
829
830 <varlistentry>
831 <term><command>-relaxed</command></term>
832 <listitem>
833 <para>
834 Relaxed reporting mode. For many detectors, this option
835 suppresses the heuristics used to avoid reporting false positives.
836 </para>
837 </listitem>
838 </varlistentry>
839
840 <varlistentry>
841 <term><command>-xml</command></term>
842 <listitem>
843 <para>
844 Produce the bug reports as XML. The XML data produced may be
845 viewed in the GUI at a later time. You may also specify this
846 option as <command>-xml:withMessages</command>; when this variant
847 of the option is used, the XML output will contain human-readable
848 messages describing the warnings contained in the file.
849 XML files generated this way are easy to transform into reports.
850 </para>
851 </listitem>
852 </varlistentry>
853
854 <varlistentry>
855 <term><command>-html</command></term>
856 <listitem>
857 <para>
858 Generate HTML output. By default, &FindBugs; will use the <filename>default.xsl</filename>
859 <ulink url="http://www.w3.org/TR/xslt">XSLT</ulink>
860 stylesheet to generate the HTML: you can find this file in <filename>findbugs.jar</filename>,
861 or in the &FindBugs; source or binary distributions. Variants of this option include
862 <command>-html:plain.xsl</command>, <command>-html:fancy.xsl</command> and <command>-html:fancy-hist.xsl</command>.
863 The <filename>plain.xsl</filename> stylesheet does not use Javascript or DOM,
864 and may work better with older web browsers, or for printing. The <filename>fancy.xsl</filename>
865 stylesheet uses DOM and Javascript for navigation and CSS for
866 visual presentation. The <command>fancy-hist.xsl</command> an evolution of <command>fancy.xsl</command> stylesheet.
867 It makes an extensive use of DOM and Javascript for dynamically filtering the lists of bugs.
868 </para>
869
870 <para>
871 If you want to specify your own
872 XSLT stylesheet to perform the transformation to HTML, specify the option as
873 <command>-html:<replaceable>myStylesheet.xsl</replaceable></command>,
874 where <replaceable>myStylesheet.xsl</replaceable> is the filename of the
875 stylesheet you want to use.
876 </para>
877 </listitem>
878 </varlistentry>
879
880 <varlistentry>
881 <term><command>-emacs</command></term>
882 <listitem>
883 <para>
884 Produce the bug reports in Emacs format.
885 </para>
886 </listitem>
887 </varlistentry>
888
889 <varlistentry>
890 <term><command>-xdocs</command></term>
891 <listitem>
892 <para>
893 Produce the bug reports in xdoc XML format for use with Apache Maven.
894 </para>
895 </listitem>
896 </varlistentry>
897
898 <varlistentry>
899 <term><command>-output</command> <replaceable>filename</replaceable></term>
900 <listitem>
901 <para>
902 Produce the output in the specified file.
903 </para>
904 </listitem>
905 </varlistentry>
906
907 <varlistentry>
908 <term><command>-outputFile</command> <replaceable>filename</replaceable></term>
909 <listitem>
910 <para>
911 This argument is deprecated. Use <command>-output</command> instead.
912 </para>
913 </listitem>
914 </varlistentry>
915
916 <varlistentry>
917 <term><command>-nested</command><replaceable>[:true|false]</replaceable></term>
918 <listitem>
919 <para>
920 This option enables or disables scanning of nested jar and zip files found in
921 the list of files and directories to be analyzed.
922 By default, scanning of nested jar/zip files is enabled.
923 To disable it, add <command>-nested:false</command> to the command line
924 arguments.
925 </para>
926 </listitem>
927 </varlistentry>
928
929 <varlistentry>
930 <term><command>-auxclasspath</command> <replaceable>classpath</replaceable></term>
931 <listitem>
932 <para>
933 Set the auxiliary classpath for analysis. This classpath should include all
934 jar files and directories containing classes that are part of the program
935 being analyzed but you do not want to have analyzed for bugs.
936 </para>
937 </listitem>
938 </varlistentry>
939
940 <varlistentry>
941 <term><command>-userPrefs</command> <replaceable>edu.umd.cs.findbugs.core.prefs</replaceable></term>
942 <listitem>
943 <para>
944 Set the path of the user preferences file to use, which might override some of the options abobe.
945 Specifying <literal>userPrefs</literal> as first argument would mean some later
946 options will override them, as last argument would mean they will override some previous options).
947 This rationale behind this option is to reuse FindBugs Eclipse project settings for command
948 line execution.
949 </para>
950 </listitem>
951 </varlistentry>
952
953 <!--
954 <varlistentry>
955 <term><command></command> <replaceable></replaceable></term>
956 <listitem>
957 <para>
958 </para>
959 </listitem>
960 </varlistentry>
961 -->
962
963 </variablelist>
964
965 </sect2>
966 </sect1>
967
968
969 </chapter>
970
971 <chapter id="gui">
972 <title>Using the &FindBugs; GUI</title>
973
974 <para>
975 This chapter describes how to use the &FindBugs; graphical user interface (GUI).
976 </para>
977
978 <sect1>
979 <title>Creating a Project</title>
980 <para>
981 After you have started &FindBugs; using the <command>findbugs</command> command,
982 choose the <menuchoice><guimenu>File</guimenu><guimenuitem>New Project</guimenuitem></menuchoice>
983 menu item. You will see a dialog which looks like this:
984 <mediaobject>
985 <imageobject>
986 <imagedata fileref="project-dialog.png" />
987 </imageobject>
988 </mediaobject>
989 </para>
990
991 <para>
992 Use the "Add" button next to "Classpath to analyze" to select a Java archive
993 file (zip, jar, ear, or war file) or directory containing java classes to analyze for bugs. You may add multiple
994 archives/directories.
995 </para>
996
997 <para>
998 You can also add the source directories which contain
999 the source code for the Java archives you are analyzing. This will enable
1000 &FindBugs; to highlight the source code which contains a possible error.
1001 The source directories you add should be the roots of the Java
1002 package hierarchy. For example, if your application is contained in the
1003 <varname>org.foobar.myapp</varname> package, you should add the
1004 parent directory of the <filename class="directory">org</filename> directory
1005 to the source directory list for the project.
1006 </para>
1007
1008 <para>
1009 Another optional step is to add additional Jar files or directories as
1010 "Auxiliary classpath locations" entries. You should do this if the archives and directories you are analyzing
1011 have references to other classes which are not included in the analyzed
1012 archives/directories and are not in the standard runtime classpath. Some of the bug
1013 pattern detectors in &FindBugs; make use of class hierarchy information,
1014 so you will get more accurate results if the entire class hierarchy is
1015 available which &FindBugs; performs its analysis.
1016 </para>
1017
1018 </sect1>
1019
1020 <sect1>
1021 <title>Running the Analysis</title>
1022 <para>
1023 Once you have added all of the archives, directories, and source directories,
1024 click the "Analyze" button to analyze the classes contained in the
1025 Jar files. Note that for a very large program on an older computer,
1026 this may take quite a while (tens of minutes). A recent computer with
1027 ample memory will typically be able to analyze a large program in only a
1028 few minutes.
1029 </para>
1030 </sect1>
1031
1032 <sect1>
1033 <title>Browsing Results</title>
1034
1035 <para>
1036 When the analysis completes, you will see a screen like the following:
1037 <mediaobject>
1038 <imageobject>
1039 <imagedata fileref="example-details.png" />
1040 </imageobject>
1041 </mediaobject>
1042 </para>
1043
1044 <para>
1045 The upper left-hand pane of the window shows the bug tree; this is a hierarchical
1046 representation of all of the potential bugs detected in the analyzed
1047 Jar files.
1048 </para>
1049
1050 <para>
1051 When you select a particular bug instance in the top pane, you will
1052 see a description of the bug in the "Details" tab of the bottom pane.
1053 In addition, the source code pane on the upper-right will show the
1054 program source code where the potential bug occurs, if source is available.
1055 In the above example, the bug is a stream object that is not closed. The
1056 source code window highlights the line where the stream object is created.
1057 </para>
1058
1059 <para>
1060 You may add a textual annotations to bug instances. To do so, type them
1061 into the text box just below the hierarchical view. You can type any
1062 information which you would like to record. When you load and save bug
1063 results files, the annotations are preserved.
1064 </para>
1065
1066 </sect1>
1067
1068 <sect1>
1069 <title>Saving and Opening</title>
1070
1071 <para>
1072 You may use the <menuchoice><guimenu>File</guimenu><guimenuitem>Save as...</guimenuitem></menuchoice>
1073 menu option to save your work. To save your work, including the jar
1074 file lists you specified and all bug results, choose
1075 "FindBugs analysis results (.xml)" from the drop-down list in the
1076 "Save as..." dialog. There are also options for saving just the jar
1077 file lists ("FindBugs project file (.fbp)") or just the results
1078 ("FindBugs analysis file (.fba)").
1079 A saved file may be loaded with the
1080 <menuchoice><guimenu>File</guimenu><guimenuitem>Open...</guimenuitem></menuchoice>
1081 menu option.
1082 </para>
1083
1084 </sect1>
1085
1086 <!--
1087 <sect1 id="textui">
1088 <title>Using the &FindBugs;&trade; Command Line Interface</title>
1089
1090 <para>
1091 The &FindBugs; Command Line Interface (or Text UI) can be used to
1092 analyze an application for bugs non-interactively. Each bug instance will be
1093 reported on a single line. All output is written to the standard output file descriptor.
1094 <xref linkend="filter" /> explains how bug reports may be filtered in order
1095 to get only the output you're interested in.
1096 </para>
1097
1098 <para>
1099 See <xref linkend="commandLineOptions" /> for a description of how to invoke the
1100 Command Line Interface.
1101 </para>
1102 </sect1>
1103 -->
1104
1105 </chapter>
1106
1107 <!--
1108 **************************************************************************
1109 Using the FindBugs Ant task
1110 **************************************************************************
1111 -->
1112
1113 <chapter id="anttask">
1114 <title>Using the &FindBugs;&trade; &Ant; task</title>
1115
1116 <para>
1117 This chapter describes how to integrate &FindBugs; into a build script
1118 for <ulink url="http://ant.apache.org/">&Ant;</ulink>, which is a popular Java build
1119 and deployment tool. Using the &FindBugs; &Ant; task, your build script can
1120 automatically run &FindBugs; on your Java code.
1121 </para>
1122
1123 <para>
1124 The &Ant; task was generously contributed by Mike Fagan.
1125 </para>
1126
1127 <sect1>
1128 <title>Installing the &Ant; task</title>
1129
1130 <para>
1131 To install the &Ant; task, simply copy <filename>&FBHome;/lib/findbugs-ant.jar</filename>
1132 into the <filename>lib</filename> subdirectory of your &Ant; installation.
1133
1134 <note>
1135 <para>It is strongly recommended that you use the &Ant; task with the version
1136 of &FindBugs; it was included with. We do not guarantee that the &Ant; task Jar file
1137 will work with any version of &FindBugs; other than the one it was included with.</para>
1138 </note>
1139 </para>
1140
1141 </sect1>
1142
1143 <sect1>
1144 <title>Modifying build.xml</title>
1145
1146 <para>
1147 To incorporate &FindBugs; into <filename>build.xml</filename> (the build script
1148 for &Ant;), you first need to add a task definition. This should appear as follows:
1149
1150 <screen>
1151 &lt;taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/&gt;
1152 </screen>
1153
1154 The task definition specifies that when a <literal>findbugs</literal> element is
1155 seen in <filename>build.xml</filename>, it should use the indicated class to execute the task.
1156 </para>
1157
1158 <para>
1159 After you have added the task definition, you can define a target
1160 which uses the <literal>findbugs</literal> task. Here is an example
1161 which could be added to the <filename>build.xml</filename> for the
1162 Apache <ulink url="http://jakarta.apache.org/bcel/">BCEL</ulink> library.
1163
1164 <screen>
1165 &lt;property name="findbugs.home" value="/export/home/daveho/work/findbugs" /&gt;
1166
1167 &lt;target name="findbugs" depends="jar"&gt;
1168 &lt;findbugs home="${findbugs.home}"
1169 output="xml"
1170 outputFile="bcel-fb.xml" &gt;
1171 &lt;auxClasspath path="${basedir}/lib/Regex.jar" /&gt;
1172 &lt;sourcePath path="${basedir}/src/java" /&gt;
1173 &lt;class location="${basedir}/bin/bcel.jar" /&gt;
1174 &lt;/findbugs&gt;
1175 &lt;/target&gt;
1176 </screen>
1177
1178 The <literal>findbugs</literal> element must have the <literal>home</literal>
1179 attribute set to the directory in which &FindBugs; is installed; in other words,
1180 &FBHome;. See <xref linkend="installing" />.
1181 </para>
1182
1183 <para>
1184 This target will execute &FindBugs; on <filename>bcel.jar</filename>, which is the
1185 Jar file produced by BCEL's build script. (By making it depend on the "jar"
1186 target, we ensure that the library is fully compiled before running &FindBugs; on it.)
1187 The output of &FindBugs; will be saved in XML format to a file called
1188 <filename>bcel-fb.xml</filename>.
1189 An auxiliary Jar file, <filename>Regex.jar</filename>, is added to the aux classpath,
1190 because it is referenced by the main BCEL library. A source path is specified
1191 so that the saved bug data will have accurate references to the BCEL source code.
1192 </para>
1193 </sect1>
1194
1195 <sect1>
1196 <title>Executing the task</title>
1197
1198 <para>
1199 Here is an example of invoking &Ant; from the command line, using the <literal>findbugs</literal>
1200 target defined above.
1201
1202 <screen>
1203 <prompt>[daveho@noir]$</prompt> <command>ant findbugs</command>
1204 Buildfile: build.xml
1205
1206 init:
1207
1208 compile:
1209
1210 examples:
1211
1212 jar:
1213
1214 findbugs:
1215 [findbugs] Running FindBugs...
1216 [findbugs] Bugs were found
1217 [findbugs] Output saved to bcel-fb.xml
1218
1219 BUILD SUCCESSFUL
1220 Total time: 35 seconds
1221 </screen>
1222
1223 In this case, because we saved the bug results in an XML file, we can
1224 use the &FindBugs; GUI to view the results; see <xref linkend="running"/>.
1225 </para>
1226
1227 </sect1>
1228
1229 <sect1>
1230 <title>Parameters</title>
1231
1232 <para>This section describes the parameters that may be specified when
1233 using the &FindBugs; task.
1234
1235 <variablelist>
1236
1237 <varlistentry>
1238 <term><literal>class</literal></term>
1239 <listitem>
1240 <para>
1241 A optional nested element specifying which classes to analyze. The <literal>class</literal>
1242 element must specify a <literal>location</literal> attribute which names the
1243 archive file (jar, zip, etc.), directory, or class file to be analyzed. Multiple <literal>class</literal>
1244 elements may be specified as children of a single <literal>findbugs</literal> element.
1245 </para>
1246 <para>In addition to or instead of specifying a <literal>class</literal> element,
1247 the &FindBugs; task can contain one or more <literal>fileset</literal> element(s) that
1248 specify files to be analyzed.
1249 For example, you might use a fileset to specify that all of the jar files in a directory
1250 should be analyzed.
1251 </para>
1252 </listitem>
1253 </varlistentry>
1254
1255 <varlistentry>
1256 <term><literal>auxClasspath</literal></term>
1257 <listitem>
1258 <para>
1259 An optional nested element which specifies a classpath (Jar files or directories)
1260 containing classes used by the analyzed library or application, but which
1261 you don't want to analyze. It is specified the same way as
1262 &Ant;'s <literal>classpath</literal> element for the Java task.
1263 </para>
1264 </listitem>
1265 </varlistentry>
1266
1267 <varlistentry>
1268 <term><literal>sourcePath</literal></term>
1269 <listitem>
1270 <para>
1271 An optional nested element which specifies a source directory path
1272 containing source files used to compile the Java code being analyzed.
1273 By specifying a source path, any generated XML bug output will have
1274 complete source information, which allows later viewing in the
1275 GUI.
1276 </para>
1277 </listitem>
1278 </varlistentry>
1279
1280 <varlistentry>
1281 <term><literal>home</literal></term>
1282 <listitem>
1283 <para>
1284 A required attribute.
1285 It must be set to the name of the directory where &FindBugs; is installed.
1286 </para>
1287 </listitem>
1288 </varlistentry>
1289
1290 <varlistentry>
1291 <term><literal>quietErrors</literal></term>
1292 <listitem>
1293 <para>
1294 An optional boolean attribute.
1295 If true, reports of serious analysis errors and missing classes will
1296 be suppressed in the &FindBugs; output. Default is false.
1297 </para>
1298 </listitem>
1299 </varlistentry>
1300
1301 <varlistentry>
1302 <term><literal>reportLevel</literal></term>
1303 <listitem>
1304 <para>
1305 An optional attribute. It specifies
1306 the confidence/priority threshold for reporting issues. If set to "low", confidence is not used to filter bugs.
1307 If set to "medium" (the default), low confidence issues are supressed.
1308 If set to "high", only high confidence bugs are reported.
1309 </para>
1310 </listitem>
1311 </varlistentry>
1312
1313 <varlistentry>
1314 <term><literal>output</literal></term>
1315 <listitem>
1316 <para>
1317 Optional attribute.
1318 It specifies the output format. If set to "xml" (the default), output
1319 is in XML format.
1320 If set to "xml:withMessages", output is in XML format augmented with
1321 human-readable messages. (You should use this format if you plan
1322 to generate a report using an XSL stylesheet.)
1323 If set to "html", output is in HTML formatted (default stylesheet is default.xsl).
1324 If set to "text", output is in ad-hoc text format.
1325 If set to "emacs", output is in <ulink url="http://www.gnu.org/software/emacs/">Emacs</ulink> error message format.
1326 If set to "xdocs", output is xdoc XML for use with Apache Maven.
1327 </para>
1328 </listitem>
1329 </varlistentry>
1330 <varlistentry>
1331 <term><literal>stylesheet</literal></term>
1332 <listitem>
1333 <para>
1334 Optional attribute.
1335 It specifies the stylesheet to use to generate html output when the output is set to html.
1336 Stylesheets included in the FindBugs distribution include default.xsl, fancy.xsl, fancy-hist.xsl, plain.xsl, and summary.xsl.
1337 The default value, if no stylesheet attribute is provided, is default.xsl.
1338
1339 </para>
1340 </listitem>
1341 </varlistentry>
1342
1343 <varlistentry>
1344 <term><literal>sort</literal></term>
1345 <listitem>
1346 <para>
1347 Optional attribute. If the <literal>output</literal> attribute
1348 is set to "text", then the <literal>sort</literal> attribute specifies
1349 whether or not reported bugs are sorted by class. Default is true.
1350 </para>
1351 </listitem>
1352 </varlistentry>
1353
1354 <varlistentry>
1355 <term><literal>outputFile</literal></term>
1356 <listitem>
1357 <para>
1358 Optional attribute. If specified, names the output file in which the
1359 &FindBugs; output will be saved. By default, the output is displayed
1360 directly by &Ant;.
1361 </para>
1362 </listitem>
1363 </varlistentry>
1364
1365 <varlistentry>
1366 <term><literal>debug</literal></term>
1367 <listitem>
1368 <para>
1369 Optional boolean attribute. If set to true, &FindBugs; prints diagnostic
1370 information about which classes are being analyzed, and which bug pattern
1371 detectors are being run. Default is false.
1372 </para>
1373 </listitem>
1374 </varlistentry>
1375
1376 <varlistentry>
1377 <term><literal>effort</literal></term>
1378 <listitem>
1379 <para>
1380 Set the analysis effort level. The value specified should be
1381 one of <literal>min</literal>, <literal>default</literal>,
1382 or <literal>max</literal>. See <xref linkend="commandLineOptions"/>
1383 for more information about setting the analysis level.
1384 </para>
1385 </listitem>
1386 </varlistentry>
1387
1388 <varlistentry>
1389 <term><literal>conserveSpace</literal></term>
1390 <listitem>
1391 <para>Synonym for effort="min".</para>
1392 </listitem>
1393 </varlistentry>
1394
1395 <varlistentry>
1396 <term><literal>workHard</literal></term>
1397 <listitem>
1398 <para>Synonym for effort="max".</para>
1399 </listitem>
1400 </varlistentry>
1401
1402 <varlistentry>
1403 <term><literal>visitors</literal></term>
1404 <listitem>
1405 <para>
1406 Optional attribute. It specifies a comma-separated list of bug detectors
1407 which should be run. The bug detectors are specified by their class names,
1408 without any package qualification. By default, all detectors which are
1409 not disabled by default are run.
1410 </para>
1411 </listitem>
1412 </varlistentry>
1413
1414 <varlistentry>
1415 <term><literal>omitVisitors</literal></term>
1416 <listitem>
1417 <para>
1418 Optional attribute. It is like the <literal>visitors</literal> attribute,
1419 except it specifies detectors which will <emphasis>not</emphasis> be run.
1420 </para>
1421 </listitem>
1422 </varlistentry>
1423
1424 <varlistentry>
1425 <term><literal>excludeFilter</literal></term>
1426 <listitem>
1427 <para>
1428 Optional attribute. It specifies the filename of a filter specifying bugs
1429 to exclude from being reported. See <xref linkend="filter" />.
1430 </para>
1431 </listitem>
1432 </varlistentry>
1433
1434 <varlistentry>
1435 <term><literal>includeFilter</literal></term>
1436 <listitem>
1437 <para>
1438 Optional attribute. It specifies the filename of a filter specifying
1439 which bugs are reported. See <xref linkend="filter" />.
1440 </para>
1441 </listitem>
1442 </varlistentry>
1443
1444 <varlistentry>
1445 <term><literal>projectFile</literal></term>
1446 <listitem>
1447 <para>
1448 Optional attribute. It specifies the name of a project file.
1449 Project files are created by the &FindBugs; GUI, and specify classes,
1450 aux classpath entries, and source directories. By naming a project,
1451 you don't need to specify any <literal>class</literal> elements,
1452 nor do you need to specify <literal>auxClasspath</literal> or
1453 <literal>sourcePath</literal> attributes.
1454 See <xref linkend="running"/> for how to create a project.
1455 </para>
1456 </listitem>
1457 </varlistentry>
1458
1459 <varlistentry>
1460 <term><literal>jvmargs</literal></term>
1461 <listitem>
1462 <para>
1463 Optional attribute. It specifies any arguments that should be passed
1464 to the Java virtual machine used to run &FindBugs;. You may need to
1465 use this attribute to specify flags to increase the amount of memory
1466 the JVM may use if you are analyzing a very large program.
1467 </para>
1468 </listitem>
1469 </varlistentry>
1470
1471 <varlistentry>
1472 <term><literal>systemProperty</literal></term>
1473 <listitem>
1474 <para>
1475 Optional nested element. If specified, defines a system property.
1476 The <literal>name</literal> attribute specifies the name of the
1477 system property, and the <literal>value</literal> attribute specifies
1478 the value of the system property.
1479 </para>
1480 </listitem>
1481 </varlistentry>
1482
1483 <varlistentry>
1484 <term><literal>timeout</literal></term>
1485 <listitem>
1486 <para>
1487 Optional attribute. It specifies the amount of time, in milliseconds,
1488 that the Java process executing &FindBugs; may run before it is
1489 assumed to be hung and is terminated. The default is 600,000
1490 milliseconds, which is ten minutes. Note that for very large
1491 programs, &FindBugs; may require more than ten minutes to complete its
1492 analysis.
1493 </para>
1494 </listitem>
1495 </varlistentry>
1496
1497 <varlistentry>
1498 <term><literal>failOnError</literal></term>
1499 <listitem>
1500 <para>
1501 Optional boolean attribute. Whether to abort the build process if there is an
1502 error running &FindBugs;. Defaults to "false"
1503 </para>
1504 </listitem>
1505 </varlistentry>
1506
1507 <varlistentry>
1508 <term><literal>errorProperty</literal></term>
1509 <listitem>
1510 <para>
1511 Optional attribute which specifies the name of a property that
1512 will be set to "true" if an error occurs while running &FindBugs;.
1513 </para>
1514 </listitem>
1515 </varlistentry>
1516
1517 <varlistentry>
1518 <term><literal>warningsProperty</literal></term>
1519 <listitem>
1520 <para>
1521 Optional attribute which specifies the name of a property
1522 that will be set to "true" if any warnings are reported by
1523 &FindBugs; on the analyzed program.
1524 </para>
1525 </listitem>
1526 </varlistentry>
1527
1528 <varlistentry>
1529 <term><literal>userPreferencesFile</literal></term>
1530 <listitem>
1531 <para>
1532 Optional attribute. Set the path of the user preferences file to use, which might override some of the options abobe.
1533 Specifying <literal>userPreferencesFile</literal> as first argument would mean some later
1534 options will override them, as last argument would mean they will override some previous options).
1535 This rationale behind this option is to reuse FindBugs Eclipse project settings for command
1536 line execution.
1537 </para>
1538 </listitem>
1539 </varlistentry>
1540
1541 </variablelist>
1542
1543
1544 </para>
1545
1546 <!--
1547
1548 -->
1549
1550 </sect1>
1551
1552 </chapter>
1553
1554 <!--
1555 **************************************************************************
1556 Using the FindBugs Eclipse plugin
1557 **************************************************************************
1558 -->
1559
1560 <chapter id="eclipse">
1561 <title>Using the &FindBugs;&trade; Eclipse plugin</title>
1562
1563 <para>
1564 The FindBugs Eclipse plugin allows &FindBugs; to be used within
1565 the <ulink url="http://www.eclipse.org/">Eclipse</ulink> IDE.
1566 The FindBugs Eclipse plugin was generously contributed by Peter Friese.
1567 Phil Crosby and Andrei Loskutov contributed major improvements
1568 to the plugin.
1569 </para>
1570
1571 <sect1>
1572 <title>Requirements</title>
1573
1574 <para>
1575 To use the &FindBugs; Plugin for Eclipse, you need Eclipse 3.3 or later,
1576 and JRE/JDK 1.5 or later.
1577 </para>
1578
1579 </sect1>
1580
1581 <sect1>
1582 <title>Installation</title>
1583
1584 <para>
1585 We provide update sites that allow you to automatically install FindBugs into Eclipse and also query and install updates.
1586 There are three different update sites</para>
1587
1588 <variablelist><title>FindBugs Eclipse update sites</title>
1589 <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse/">http://findbugs.cs.umd.edu/eclipse/</ulink></term>
1590
1591 <listitem>
1592 <para>
1593 Only provides official releases of FindBugs.
1594 </para>
1595 </listitem>
1596 </varlistentry>
1597
1598 <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse-candidate/">http://findbugs.cs.umd.edu/eclipse-candidate/</ulink></term>
1599
1600 <listitem>
1601 <para>
1602 Provides official releases and release candidates of FindBugs.
1603 </para>
1604 </listitem>
1605 </varlistentry>
1606
1607 <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse-daily/">http://findbugs.cs.umd.edu/eclipse-daily/</ulink></term>
1608
1609 <listitem>
1610 <para>
1611 Provides the daily build of FindBugs. No testing other than that it compiles.
1612 </para>
1613 </listitem>
1614 </varlistentry>
1615 </variablelist>
1616
1617 <para>You can also manually
1618 download the plugin from the following link:
1619 <ulink url="http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122.zip?download"
1620 >http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122.zip?download</ulink>.
1621 Extract it in Eclipse's "plugins" subdirectory.
1622 (So &lt;eclipse_install_dir&gt;/plugins/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122/findbugs.png
1623 should be the path to the &FindBugs; logo.)
1624
1625 </para>
1626
1627 <para>
1628 Once the plugin is extracted, start Eclipse and choose
1629 <menuchoice>
1630 <guimenu>Help</guimenu>
1631 <guimenuitem>About Eclipse Platform</guimenuitem>
1632 <guimenuitem>Plug-in Details</guimenuitem>
1633 </menuchoice>.
1634 You should find a plugin called "FindBugs Plug-in" provided by "FindBugs Project".
1635 </para>
1636 </sect1>
1637
1638 <sect1>
1639 <title>Using the Plugin</title>
1640
1641 <para>
1642 To get started, right click on a Java project in Package Explorer,
1643 and select the option labeled "Find Bugs".
1644 &FindBugs; will run, and problem markers (displayed in source
1645 windows, and also in the Eclipse Problems view) will point to
1646 locations in your code which have been identified as potential instances
1647 of bug patterns.
1648 </para>
1649 <para>
1650 You can also run &FindBugs; on existing java archives (jar, ear, zip, war etc). Simply
1651 create an empty Java project and attach archives to the project classpath. Having that, you
1652 can now right click the archive node in Package Explorer and select the option labeled
1653 "Find Bugs". If you additionally configure the source code locations for the binaries,
1654 &FindBugs; will also link the generated warnings to the right source files.
1655 </para>
1656 <para>
1657 You may customize how &FindBugs; runs by opening the Properties
1658 dialog for a Java project, and choosing the "Findbugs" property page.
1659 Options you may choose include:
1660 </para>
1661
1662 <itemizedlist>
1663 <listitem>
1664 <para>
1665 Enable or disable the "Run FindBugs Automatically" checkbox.
1666 When enabled, FindBugs will run every time you modify a Java class
1667 within the project.
1668 </para>
1669 </listitem>
1670
1671 <listitem>
1672 <para>
1673 Choose minimum warning priority and enabled bug categories.
1674 These options will choose which warnings are shown.
1675 For example, if you select the "Medium" warning priority,
1676 only Medium and High priority warnings will be shown.
1677 Similarly, if you uncheck the "Style" checkbox, no warnings
1678 in the Style category will be displayed.
1679 </para>
1680 </listitem>
1681
1682 <listitem>
1683 <para>
1684 Select detectors. The table allows you to select which detectors
1685 you want to enable for your project.
1686 </para>
1687 </listitem>
1688 </itemizedlist>
1689
1690 </sect1>
1691
1692 <sect1>
1693 <title>Extending the Eclipse Plugin (since 2.0.0)</title>
1694 <para>
1695 Eclipse plugin supports contribution of custom &FindBugs; detectors (see also
1696 <ulink url="http://code.google.com/p/findbugs/source/browse/trunk/findbugs/src/doc/AddingDetectors.txt">AddingDetectors.txt</ulink>
1697 for more information). There are two ways to contribute custom plugins to the Eclipse:
1698 </para>
1699 <itemizedlist>
1700 <listitem>
1701 <para>
1702 Existing standard &FindBugs; detector packages can be configured via
1703 <menuchoice>
1704 <guimenu>Window</guimenu>
1705 <guimenuitem>Preferences</guimenuitem>
1706 <guimenuitem>Java</guimenuitem>
1707 <guimenuitem>&FindBugs;</guimenuitem>
1708 <guimenuitem>Misc. Settings</guimenuitem>
1709 <guimenuitem>Custom Detectors</guimenuitem>
1710 </menuchoice>.
1711 Simply specify there locations of any additional plugin libraries.
1712 </para>
1713
1714 <para>
1715 The benefit of this solution is that already existing detector packages can be
1716 used "as is", and that you can quickly verify the quality of third party detectors.
1717 The drawback is that you have to apply this settings in each
1718 new Eclipse workspace, and this settings can't be shared between team members.
1719 </para>
1720 </listitem>
1721
1722 <listitem>
1723 <para>
1724 It is possible to contribute custom detectors via standard Eclipse extensions mechanism.
1725 </para>
1726
1727 <para>
1728 Please check the documentation of the
1729 <ulink url="http://code.google.com/p/findbugs/source/browse/trunk/eclipsePlugin/schema/detectorPlugins.exsd">
1730 findBugsEclipsePlugin/schema/detectorPlugins.exsd</ulink>
1731 extension point how to update the plugin.xml. Existing &FindBugs; detector plugins can
1732 be easily "extended" to be full featured &FindBugs; AND Eclipse detector plugins.
1733 Usually you only need to add META-INF/MANIFEST.MF and plugin.xml to the jar and
1734 update your build scripts to not to override the MANIFEST.MF during the build.
1735 </para>
1736
1737 <para>
1738 The benefit of this solution is that for given (shared) Eclipse installation
1739 each team member has exactly same detectors set, and there is no need to configure
1740 anything anymore. The (really small) precondition
1741 is that you have to convert your existing detectors package to the valid
1742 Eclipse plugin. You can do this even for third-party detector packages.
1743 Another major differentiator is the ability to extend the default FindBugs
1744 classpath at runtime with required third party libraries (see
1745 <ulink url="http://code.google.com/p/findbugs/source/browse/trunk/findbugs/src/doc/AddingDetectors.txt">AddingDetectors.txt</ulink>
1746 for more information).
1747 </para>
1748 </listitem>
1749
1750 </itemizedlist>
1751
1752 </sect1>
1753
1754 <sect1>
1755 <title>Troubleshooting</title>
1756
1757 <para>
1758 This section lists common problems with the plugin and (if known) how to resolve them.
1759 </para>
1760
1761 <itemizedlist>
1762 <listitem>
1763 <para>
1764 If you see OutOfMemory error dialogs after starting &FindBugs; analysis in Eclipse,
1765 please increase JVM available memory: change eclipse.ini and add the lines below
1766 to the end of the file:
1767 <programlisting>
1768 -vmargs
1769 -Xmx1000m
1770 </programlisting>
1771 Important: the configuration arguments starting with the line "-vmargs" must
1772 be last lines in the eclipse.ini file, and only one argument per line is allowed!
1773 </para>
1774 </listitem>
1775 <listitem>
1776 <para>
1777 If you do not see any &FindBugs; problem markers (in your source
1778 windows or in the Problems View), you may need to change your
1779 Problems View filter settings. See
1780 <ulink url="http://findbugs.sourceforge.net/FAQ.html#q7">http://findbugs.sourceforge.net/FAQ.html#q7</ulink> for more information.
1781 </para>
1782 </listitem>
1783
1784 </itemizedlist>
1785
1786 </sect1>
1787
1788
1789 </chapter>
1790
1791
1792 <!--
1793 **************************************************************************
1794 Filter files
1795 **************************************************************************
1796 -->
1797
1798 <chapter id="filter">
1799 <title>Filter Files</title>
1800
1801 <para>
1802 Filter files may be used to include or exclude bug reports for particular classes
1803 and methods. This chapter explains how to use filter files.
1804
1805 <note>
1806 <title>Planned Features</title>
1807 <para>
1808 Filters are currently only supported by the Command Line interface.
1809 Eventually, filter support will be added to the GUI.
1810 </para>
1811 </note>
1812 </para>
1813
1814
1815 <sect1>
1816 <title>Introduction to Filter Files</title>
1817
1818 <para>
1819 Conceptually, a filter matches bug instances against a set of criteria.
1820 By defining a filter, you can select bug instances for special treatment;
1821 for example, to exclude or include them in a report.
1822 </para>
1823
1824 <para>
1825 A filter file is an <ulink url="http://www.w3.org/XML/">XML</ulink> document with a top-level <literal>FindBugsFilter</literal> element
1826 which has some number of <literal>Match</literal> elements as children. Each <literal>Match</literal>
1827 element represents a predicate which is applied to generated bug instances.
1828 Usually, a filter will be used to exclude bug instances. For example:
1829
1830 <screen>
1831 <prompt>$ </prompt><command>findbugs -textui -exclude <replaceable>myExcludeFilter.xml</replaceable> <replaceable>myApp.jar</replaceable></command>
1832 </screen>
1833
1834 However, a filter could also be used to select bug instances to specifically
1835 report:
1836
1837 <screen>
1838 <prompt>$ </prompt><command>findbugs -textui -include <replaceable>myIncludeFilter.xml</replaceable> <replaceable>myApp.jar</replaceable></command>
1839 </screen>
1840 </para>
1841
1842 <para>
1843 <literal>Match</literal> elements contain children, which are conjuncts of the predicate.
1844 In other words, each of the children must be true for the predicate to be true.
1845 </para>
1846
1847 </sect1>
1848
1849 <sect1>
1850 <title>Types of Match clauses</title>
1851
1852 <variablelist>
1853 <varlistentry>
1854 <term><literal>&lt;Bug&gt;</literal></term>
1855 <listitem><para>
1856 This element specifies a particular bug pattern or patterns to match.
1857 The <literal>pattern</literal> attribute is a comma-separated list of
1858 bug pattern types. You can find the bug pattern types for particular
1859 warnings by looking at the output produced by the <command>-xml</command>
1860 output option (the <literal>type</literal> attribute of <literal>BugInstance</literal>
1861 elements), or from the <ulink url="../bugDescriptions.html">bug
1862 descriptions document</ulink>.
1863 </para><para>
1864 For more coarse-grained matching, use <literal>code</literal> attribute. It takes
1865 a comma-separated list of bug abbreviations. For most-coarse grained matching use
1866 <literal>category</literal> attriute, that takes a comma separated list of bug category names:
1867 <literal>CORRECTNESS</literal>, <literal>MT_CORRECTNESS</literal>,
1868 <literal>BAD_PRACTICICE</literal>, <literal>PERFORMANCE</literal>, <literal>STYLE</literal>.
1869 </para><para>
1870 If more than one of the attributes mentioned above are specified on the same
1871 <literal>&lt;Bug&gt;</literal> element, all bug patterns that match either one of specified
1872 pattern names, or abreviations, or categories will be matched.
1873 </para><para>
1874 As a backwards compatibility measure, <literal>&lt;BugPattern&gt;</literal> and
1875 <literal>&lt;BugCode&gt;</literal> elements may be used instead of
1876 <literal>&lt;Bug&gt;</literal> element. Each of these uses a
1877 <literal>name</literal> attribute for specifying accepted values list. Support for these
1878 elements may be removed in a future release.
1879 </para></listitem>
1880 </varlistentry>
1881
1882 <varlistentry>
1883 <term><literal>&lt;Confidence&gt;</literal></term>
1884 <listitem>
1885 <para>
1886 This element matches warnings with a particular bug confidence.
1887 The <literal>value</literal> attribute should be an integer value:
1888 1 to match high-confidence warnings, 2 to match normal-confidence warnings,
1889 or 3 to match low-confidence warnings. &lt;Confidence&gt; replaced
1890 &lt;Priority&gt; in 2.0.0 release.
1891 </para>
1892 </listitem>
1893 </varlistentry>
1894
1895 <varlistentry>
1896 <term><literal>&lt;Priority&gt;</literal></term>
1897 <listitem>
1898 <para>
1899 Same as <literal>&lt;Confidence&gt;</literal>, exists for backward compatibility.
1900 </para>
1901 </listitem>
1902 </varlistentry>
1903
1904 <varlistentry>
1905 <term><literal>&lt;Rank&gt;</literal></term>
1906 <listitem>
1907 <para>
1908 This element matches warnings with a particular bug rank.
1909 The <literal>value</literal> attribute should be an integer value
1910 between 1 and 20, where 1 to 4 are scariest, 5 to 9 scary, 10 to 14 troubling,
1911 and 15 to 20 of concern bugs.
1912 </para>
1913 </listitem>
1914 </varlistentry>
1915
1916 <varlistentry>
1917 <term><literal>&lt;Package&gt;</literal></term>
1918 <listitem>
1919 <para>
1920 This element matches warnings associated with classes within the package specified
1921 using <literal>name</literal> attribute. Nested packages are not included (along the
1922 lines of Java import statement). However matching multiple packages can be achieved
1923 easily using regex name match.
1924 </para>
1925 </listitem>
1926 </varlistentry>
1927
1928 <varlistentry>
1929 <term><literal>&lt;Class&gt;</literal></term>
1930 <listitem>
1931 <para>
1932 This element matches warnings associated with a particular class. The
1933 <literal>name</literal> attribute is used to specify the exact or regex match pattern
1934 for the class name.
1935 </para>
1936
1937 <para>
1938 As a backward compatibility measure, instead of element of this type, you can use
1939 <literal>class</literal> attribute on a <literal>Match</literal> element to specify
1940 exact an class name or <literal>classregex</literal> attribute to specify a regular
1941 expression to match the class name against.
1942 </para>
1943
1944 <para>
1945 If the <literal>Match</literal> element contains neither a <literal>Class</literal> element,
1946 nor a <literal>class</literal> / <literal>classregex</literal> attribute, the predicate will apply
1947 to all classes. Such predicate is likely to match more bug instances than you want, unless it is
1948 refined further down with apropriate method or field predicates.
1949 </para>
1950 </listitem>
1951 </varlistentry>
1952
1953 <varlistentry>
1954 <term><literal>&lt;Method&gt;</literal></term>
1955
1956 <listitem><para>This element specifies a method. The <literal>name</literal> is used to specify
1957 the exact or regex match pattern for the method name.
1958 The <literal>params</literal> attribute is a comma-separated list
1959 of the types of the method's parameters. The <literal>returns</literal> attribute is
1960 the method's return type. In <literal>params</literal> and <literal>returns</literal>, class names
1961 must be fully qualified. (E.g., "java.lang.String" instead of just
1962 "String".) If one of the latter attributes is specified the other is required for creating a method signature.
1963 Note that you can provide either <literal>name</literal> attribute or <literal>params</literal>
1964 and <literal>returns</literal> attributes or all three of them. This way you can provide various kinds of
1965 name and signature based matches.
1966 </para></listitem>
1967 </varlistentry>
1968
1969 <varlistentry>
1970 <term><literal>&lt;Field&gt;</literal></term>
1971
1972 <listitem><para>This element specifies a field. The <literal>name</literal> attribute is is used to specify
1973 the exact or regex match pattern for the field name. You can also filter fields according to their signature -
1974 use <literal>type</literal> attribute to specify fully qualified type of the field. You can specify eiter or both
1975 of these attributes in order to perform name / signature based matches.
1976 </para></listitem>
1977 </varlistentry>
1978
1979 <varlistentry>
1980 <term><literal>&lt;Local&gt;</literal></term>
1981
1982 <listitem><para>This element specifies a local variable. The <literal>name</literal> attribute is is used to specify
1983 the exact or regex match pattern for the local variable name. Local variables are variables defined within a method.
1984 </para></listitem>
1985 </varlistentry>
1986
1987 <varlistentry>
1988 <term><literal>&lt;Or&gt;</literal></term>
1989 <listitem><para>
1990 This element combines <literal>Match</literal> clauses as disjuncts. I.e., you can put two
1991 <literal>Method</literal> elements in an <literal>Or</literal> clause in order to match either method.
1992 </para></listitem>
1993 </varlistentry>
1994 <varlistentry>
1995 <term><literal>&lt;And&gt;</literal></term>
1996 <listitem><para>
1997 This element combines <literal>Match</literal> clauses which both must evaluate to true. I.e., you can put
1998 <literal>Bug</literal> and <literal>Priority</literal> elements in an <literal>And</literal> clause in order
1999 to match specific bugs with given priority only.
2000 </para></listitem>
2001 </varlistentry>
2002 <varlistentry>
2003 <term><literal>&lt;Not&gt;</literal></term>
2004 <listitem><para>
2005 This element inverts the included child <literal>Match</literal>. I.e., you can put a
2006 <literal>Bug</literal> element in a <literal>Not</literal> clause in order to match any bug
2007 excluding the given one.
2008 </para></listitem>
2009 </varlistentry>
2010 </variablelist>
2011
2012 </sect1>
2013
2014 <sect1>
2015 <title>Java element name matching</title>
2016
2017 <para>
2018 If the <literal>name</literal> attribute of <literal>Class</literal>, <literal>Method</literal> or
2019 <literal>Field</literal> starts with the ~ character the rest of attribute content is interpreted as
2020 a Java regular expression that is matched against the names of the Java element in question.
2021 </para>
2022
2023 <para>
2024 Note that the pattern is matched against whole element name and therefore .* clauses need to be used
2025 at pattern beginning and/or end to perform substring matching.
2026 </para>
2027
2028 <para>
2029 See <ulink url="http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html"><literal>java.util.regex.Pattern</literal></ulink>
2030 documentation for pattern syntax.
2031 </para>
2032 </sect1>
2033
2034 <sect1>
2035 <title>Caveats</title>
2036
2037 <para>
2038 <literal>Match</literal> clauses can only match information that is actually contained in the
2039 bug instances. Every bug instance has a class, so in general, excluding
2040 bugs by class will work.
2041 </para>
2042
2043 <para>
2044 Some bug instances have two (or more) classes. For example, the DE (dropped exception)
2045 bugs report both the class containing the method where the dropped exception
2046 happens, and the class which represents the type of the dropped exception.
2047 Only the <emphasis>first</emphasis> (primary) class is matched against <literal>Match</literal> clauses.
2048 So, for example, if you want to suppress IC (initialization circularity)
2049 reports for classes "com.foobar.A" and "com.foobar.B", you would use
2050 two <literal>Match</literal> clauses:
2051
2052 <programlisting>
2053 &lt;Match&gt;
2054 &lt;Class name="com.foobar.A" /&gt;
2055 &lt;Bug code="IC" /&gt;
2056 &lt;/Match&gt;
2057
2058 &lt;Match&gt;
2059 &lt;Class name="com.foobar.B" /&gt;
2060 &lt;Bug code="IC" /&gt;
2061 &lt;/Match&gt;
2062 </programlisting>
2063
2064 By explicitly matching both classes, you ensure that the IC bug instance will be
2065 matched regardless of which class involved in the circularity happens to be
2066 listed first in the bug instance. (Of course, this approach might accidentally
2067 supress circularities involving "com.foobar.A" or "com.foobar.B" and a third
2068 class.)
2069 </para>
2070
2071 <para>
2072 Many kinds of bugs report what method they occur in. For those bug instances,
2073 you can put <literal>Method</literal> clauses in the <literal>Match</literal> element and they should work
2074 as expected.
2075 </para>
2076
2077 </sect1>
2078
2079 <sect1>
2080 <title>Examples</title>
2081
2082 <para>
2083 1. Match all bug reports for a class.
2084
2085 <programlisting>
2086 <![CDATA[
2087 <Match>
2088 <Class name="com.foobar.MyClass" />
2089 </Match>
2090 ]]>
2091 </programlisting>
2092
2093 </para>
2094
2095 <para>
2096 2. Match certain tests from a class by specifying their abbreviations.
2097 <programlisting>
2098 <![CDATA[
2099 <Match>
2100 <Class name="com.foobar.MyClass"/ >
2101 <Bug code="DE,UrF,SIC" />
2102 </Match>
2103 ]]>
2104 </programlisting>
2105 </para>
2106
2107 <para>
2108 3. Match certain tests from all classes by specifying their abbreviations.
2109
2110 <programlisting>
2111 <![CDATA[
2112 <Match>
2113 <Bug code="DE,UrF,SIC" />
2114 </Match>
2115 ]]>
2116 </programlisting>
2117 </para>
2118
2119 <para>
2120 4. Match certain tests from all classes by specifying their category.
2121
2122 <programlisting>
2123 <![CDATA[
2124 <Match>
2125 <Bug category="PERFORMANCE" />
2126 </Match>
2127 ]]>
2128 </programlisting>
2129 </para>
2130
2131 <para>
2132 5. Match bug types from specified methods of a class by their abbreviations.
2133
2134 <programlisting>
2135 <![CDATA[
2136 <Match>
2137 <Class name="com.foobar.MyClass" />
2138 <Or>
2139 <Method name="frob" params="int,java.lang.String" returns="void" />
2140 <Method name="blat" params="" returns="boolean" />
2141 </Or>
2142 <Bug code="DC" />
2143 </Match>
2144 ]]>
2145 </programlisting>
2146 </para>
2147
2148 <para>
2149 6. Match a particular bug pattern in a particular method.
2150
2151 <programlisting>
2152 <![CDATA[
2153 <!-- A method with an open stream false positive. -->
2154 <Match>
2155 <Class name="com.foobar.MyClass" />
2156 <Method name="writeDataToFile" />
2157 <Bug pattern="OS_OPEN_STREAM" />
2158 </Match>
2159 ]]>
2160 </programlisting>
2161 </para>
2162
2163 <para>
2164 7. Match a particular bug pattern with a given priority in a particular method.
2165
2166 <programlisting>
2167 <![CDATA[
2168 <!-- A method with a dead local store false positive (medium priority). -->
2169 <Match>
2170 <Class name="com.foobar.MyClass" />
2171 <Method name="someMethod" />
2172 <Bug pattern="DLS_DEAD_LOCAL_STORE" />
2173 <Priority value="2" />
2174 </Match>
2175 ]]>
2176 </programlisting>
2177 </para>
2178
2179 <para>
2180 8. Match minor bugs introduced by AspectJ compiler (you are probably not interested in these unless
2181 you are an AspectJ developer).
2182
2183 <programlisting>
2184 <![CDATA[
2185 <Match>
2186 <Class name="~.*\$AjcClosure\d+" />
2187 <Bug pattern="DLS_DEAD_LOCAL_STORE" />
2188 <Method name="run" />
2189 </Match>
2190 <Match>
2191 <Bug pattern="UUF_UNUSED_FIELD" />
2192 <Field name="~ajc\$.*" />
2193 </Match>
2194 ]]>
2195 </programlisting>
2196 </para>
2197
2198 <para>
2199 9. Match bugs in specific parts of the code base
2200
2201 <programlisting>
2202 <![CDATA[
2203 <!-- match unused fields warnings in Messages classes in all packages -->
2204 <Match>
2205 <Class name="~.*\.Messages" />
2206 <Bug code="UUF" />
2207 </Match>
2208 <!-- match mutable statics warnings in all internal packages -->
2209 <Match>
2210 <Package name="~.*\.internal" />
2211 <Bug code="MS" />
2212 </Match>
2213 <!-- match anonymoous inner classes warnings in ui package hierarchy -->
2214 <Match>
2215 <Package name="~com\.foobar\.fooproject\.ui.*" />
2216 <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" />
2217 </Match>
2218 ]]>
2219 </programlisting>
2220 </para>
2221
2222 <para>
2223 10. Match bugs on fields or methods with specific signatures
2224 <programlisting>
2225 <![CDATA[
2226 <!-- match System.exit(...) usage warnings in void main(String[]) methods in all classes -->
2227 <Match>
2228 <Method returns="void" name="main" params="java.lang.String[]" />
2229 <Bug pattern="DM_EXIT" />
2230 </Match>
2231 <!-- match UuF warnings on fields of type com.foobar.DebugInfo on all classes -->
2232 <Match>
2233 <Field type="com.foobar.DebugInfo" />
2234 <Bug code="UuF" />
2235 </Match>
2236 ]]>
2237 </programlisting>
2238 </para>
2239
2240
2241 <para>
2242 11. Match bugs using the Not filter operator
2243 <programlisting>
2244 <![CDATA[
2245 <!-- ignore all bugs in test classes, except for those bugs specifically relating to JUnit tests -->
2246 <!-- i.e. filter bug if ( classIsJUnitTest && ! bugIsRelatedToJUnit ) -->
2247 <Match>
2248 <!-- the Match filter is equivalent to a logical 'And' -->
2249
2250 <Class name="~.*\.*Test" />
2251 <!-- test classes are suffixed by 'Test' -->
2252
2253 <Not>
2254 <Bug code="IJU" /> <!-- 'IJU' is the code for bugs related to JUnit test code -->
2255 </Not>
2256 </Match>
2257 ]]>
2258 </programlisting>
2259 </para>
2260
2261 </sect1>
2262
2263 <sect1>
2264 <title>Complete Example</title>
2265
2266 <programlisting>
2267 <![CDATA[
2268 <FindBugsFilter>
2269 <Match>
2270 <Class name="com.foobar.ClassNotToBeAnalyzed" />
2271 </Match>
2272
2273 <Match>
2274 <Class name="com.foobar.ClassWithSomeBugsMatched" />
2275 <Bug code="DE,UrF,SIC" />
2276 </Match>
2277
2278 <!-- Match all XYZ violations. -->
2279 <Match>
2280 <Bug code="XYZ" />
2281 </Match>
2282
2283 <!-- Match all doublecheck violations in these methods of "AnotherClass". -->
2284 <Match>
2285 <Class name="com.foobar.AnotherClass" />
2286 <Or>
2287 <Method name="nonOverloadedMethod" />
2288 <Method name="frob" params="int,java.lang.String" returns="void" />
2289 <Method name="blat" params="" returns="boolean" />
2290 </Or>
2291 <Bug code="DC" />
2292 </Match>
2293
2294 <!-- A method with a dead local store false positive (medium priority). -->
2295 <Match>
2296 <Class name="com.foobar.MyClass" />
2297 <Method name="someMethod" />
2298 <Bug pattern="DLS_DEAD_LOCAL_STORE" />
2299 <Priority value="2" />
2300 </Match>
2301
2302 <!-- All bugs in test classes, except for JUnit-specific bugs -->
2303 <Match>
2304 <Class name="~.*\.*Test" />
2305 <Not>
2306 <Bug code="IJU" />
2307 </Not>
2308 </Match>
2309
2310 </FindBugsFilter>
2311 ]]>
2312 </programlisting>
2313
2314 </sect1>
2315
2316
2317 </chapter>
2318
2319
2320 <!--
2321 **************************************************************************
2322 Analysis properties
2323 **************************************************************************
2324 -->
2325
2326 <chapter id="analysisprops">
2327 <title>Analysis Properties</title>
2328
2329 <para>
2330 &FindBugs; allows several aspects of the analyses it performs to be
2331 customized. System properties are used to configure these options.
2332 This chapter describes the configurable analysis options.
2333 </para>
2334
2335 <para>
2336 The analysis options have two main purposes. First, they allow you
2337 to inform &FindBugs; about the meaning of methods in your application,
2338 so that it can produce more accurate results, or produce fewer
2339 false warnings. Second, they allow you to configure the precision
2340 of the analysis performed. Reducing analysis precision can save
2341 memory and analysis time, at the expense of missing some real bugs,
2342 or producing more false warnings.
2343 </para>
2344
2345 <para>
2346 The analysis options are set using the <command>-property</command>
2347 command line option. For example:
2348 <screen>
2349 <prompt>$ </prompt><command>findbugs -textui -property "cfg.noprune=true" <replaceable>myApp.jar</replaceable></command>
2350 </screen>
2351 </para>
2352
2353 <para>
2354 The list of configurable analysis properties is shown in
2355 <xref linkend="analysisproptable"/>.
2356 </para>
2357
2358 <table id="analysisproptable">
2359 <title>Configurable Analysis Properties</title>
2360 <tgroup cols="3" align="left">
2361 <thead>
2362 <row>
2363 <entry>Property Name</entry>
2364 <entry>Value</entry>
2365 <entry>Meaning</entry>
2366 </row>
2367 </thead>
2368 <tbody>
2369 <!--
2370 <row>
2371 <entry>cfg.noprune</entry>
2372 <entry>true or false</entry>
2373 <entry>If true, infeasible exception edges are not pruned from
2374 the control flow graphs of analyzed methods. This option
2375 increases the speed of the analysis (by about 20%-30%),
2376 but causes some detectors to produce more false warnings.</entry>
2377 </row>
2378 -->
2379 <row>
2380 <entry>findbugs.assertionmethods</entry>
2381 <entry>Comma-separated list of fully qualified method names:
2382 e.g., "com.foo.MyClass.checkAssertion"</entry>
2383 <entry>This property specifies the names of methods that are used
2384 to check program assertions. Specifying these methods allows
2385 the null pointer dereference bug detector to avoid reporting
2386 false warnings for values which are checked by assertion
2387 methods.</entry>
2388 </row>
2389 <row>
2390 <entry>findbugs.de.comment</entry>
2391 <entry>true or false</entry>
2392 <entry>If true, the DroppedException detector scans source code
2393 for empty catch blocks for a comment, and if one is found, does
2394 not report a warning.</entry>
2395 </row>
2396 <row>
2397 <entry>findbugs.maskedfields.locals</entry>
2398 <entry>true or false</entry>
2399 <entry>If true, emit low priority warnings for local variables
2400 which obscure fields. Default is false.</entry>
2401 </row>
2402 <row>
2403 <entry>findbugs.nullderef.assumensp</entry>
2404 <entry>true or false</entry>
2405 <entry>not used
2406 (intention: If true, the null dereference detector assumes that any
2407 reference value returned from a method or passed to a method
2408 in a parameter might be null. Default is false. Note that
2409 enabling this property will very likely cause a large number
2410 of false warnings to be produced.)</entry>
2411 </row>
2412 <row>
2413 <entry>findbugs.refcomp.reportAll</entry>
2414 <entry>true or false</entry>
2415 <entry>If true, all suspicious reference comparisons
2416 using the == and != operators are reported.&nbsp; If false,
2417 only one such warning is issued per method.&nbsp; Default
2418 is false.</entry>
2419 </row>
2420 <row>
2421 <entry>findbugs.sf.comment</entry>
2422 <entry>true or false</entry>
2423 <entry>If true, the SwitchFallthrough detector will only report
2424 warnings for cases where the source code does not have a comment
2425 containing the words "fall" or "nobreak". (An accurate source
2426 path must be used for this feature to work correctly.)
2427 This helps find cases where the switch fallthrough is likely
2428 to be unintentional.</entry>
2429 </row>
2430 <!-- see others at src/doc/manual/sysprops.html
2431 <row>
2432 <entry></entry>
2433 <entry></entry>
2434 <entry></entry>
2435 </row>
2436 -->
2437 </tbody>
2438 </tgroup>
2439 </table>
2440
2441 </chapter>
2442
2443 <!--
2444 **************************************************************************
2445 Annotations
2446 ***************************************************************************
2447 -->
2448
2449 <chapter id="annotations">
2450 <title>Annotations</title>
2451
2452 <para>
2453 &FindBugs; supports several annotations to express the developer's intent
2454 so that FindBugs can issue warnings more appropriately. You need to use
2455 Java 5 to use annotations, and must place the annotations.jar and jsr305.jar
2456 files in the classpath while compiling your program.
2457 </para>
2458
2459 <variablelist>
2460 <varlistentry>
2461 <term><command>edu.umd.cs.findbugs.annotations.CheckForNull</command></term>
2462 <listitem>
2463 <command>[Target]</command> Field, Method, Parameter
2464 </listitem>
2465 <listitem>
2466 <para>
2467 The annotated element might be null, and uses of the element should check for null.
2468 When this annotation is applied to a method it applies to the method return value.
2469 </para>
2470 </listitem>
2471 </varlistentry>
2472
2473 <varlistentry>
2474 <term><command>edu.umd.cs.findbugs.annotations.CheckReturnValue</command></term>
2475 <listitem>
2476 <command>[Target]</command> Method, Constructor
2477 </listitem>
2478 <listitem>
2479 <variablelist>
2480 <varlistentry>
2481 <term><command>[Parameter]</command></term>
2482 <listitem>
2483 <para>
2484 <command>priority:</command>The priority of the warning (HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
2485 </para>
2486 </listitem>
2487 <listitem>
2488 <para>
2489 <command>explanation:</command>A textual explaination of why the return value should be checked. Default value:"".
2490 </para>
2491 </listitem>
2492 </varlistentry>
2493 </variablelist>
2494 </listitem>
2495 <listitem>
2496 <para>
2497 This annotation is used to denote a method whose return value should always be checked after invoking the method.
2498 </para>
2499 </listitem>
2500 </varlistentry>
2501
2502 <varlistentry>
2503 <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotation</command></term>
2504 <listitem>
2505 <command>[Target]</command> Type, Package
2506 </listitem>
2507 <listitem>
2508 <variablelist>
2509 <varlistentry>
2510 <term><command>[Parameter]</command></term>
2511 <listitem>
2512 <para>
2513 <command>value:</command>Annotation class objects. More than one class can be specified.
2514 </para>
2515 </listitem>
2516 <listitem>
2517 <para>
2518 <command>priority:</command>Default priority(HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
2519 </para>
2520 </listitem>
2521 </varlistentry>
2522 </variablelist>
2523 </listitem>
2524 <listitem>
2525 <para>
2526 Indicates that all members of the class or package should be annotated with the default
2527 value of the supplied annotation classes. This would be used for behavior annotations
2528 such as @NonNull, @CheckForNull, or @CheckReturnValue. In particular, you can use
2529 @DefaultAnnotation(NonNull.class) on a class or package, and then use @Nullable only
2530 on those parameters, methods or fields that you want to allow to be null.
2531 </para>
2532 </listitem>
2533 </varlistentry>
2534
2535 <varlistentry>
2536 <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForFields</command></term>
2537 <listitem>
2538 <command>[Target]</command> Type, Package
2539 </listitem>
2540 <listitem>
2541 <variablelist>
2542 <varlistentry>
2543 <term><command>[Parameter]</command></term>
2544 <listitem>
2545 <para>
2546 <command>value:</command>Annotation class objects. More than one class can be specified.
2547 </para>
2548 </listitem>
2549 <listitem>
2550 <para>
2551 <command>priority:</command>Default priority(HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
2552 </para>
2553 </listitem>
2554 </varlistentry>
2555 </variablelist>
2556 </listitem>
2557 <listitem>
2558 <para>
2559 This is same as the DefaultAnnotation except it only applys to fields.
2560 </para>
2561 </listitem>
2562 </varlistentry>
2563
2564 <varlistentry>
2565 <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForMethods</command></term>
2566 <listitem>
2567 <command>[Target]</command> Type, Package
2568 </listitem>
2569 <listitem>
2570 <variablelist>
2571 <varlistentry>
2572 <term><command>[Parameter]</command></term>
2573 <listitem>
2574 <para>
2575 <command>value:</command>Annotation class objects. More than one class can be specified.
2576 </para>
2577 </listitem>
2578 <listitem>
2579 <para>
2580 <command>priority:</command>Default priority(HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
2581 </para>
2582 </listitem>
2583 </varlistentry>
2584 </variablelist>
2585 </listitem>
2586 <listitem>
2587 <para>
2588 This is same as the DefaultAnnotation except it only applys to methods.
2589 </para>
2590 </listitem>
2591 </varlistentry>
2592
2593 <varlistentry>
2594 <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForParameters</command></term>
2595 <listitem>
2596 <command>[Target]</command> Type, Package
2597 </listitem>
2598 <listitem>
2599 <variablelist>
2600 <varlistentry>
2601 <term><command>[Parameter]</command></term>
2602 <listitem>
2603 <para>
2604 <command>value:</command>Annotation class objects. More than one class can be specified.
2605 </para>
2606 </listitem>
2607 <listitem>
2608 <para>
2609 <command>priority:</command>Default priority(HIGH, MEDIUM, LOW, IGNORE). Default value:MEDIUM.
2610 </para>
2611 </listitem>
2612 </varlistentry>
2613 </variablelist>
2614 </listitem>
2615 <listitem>
2616 <para>
2617 This is same as the DefaultAnnotation except it only applys to method parameters.
2618 </para>
2619 </listitem>
2620 </varlistentry>
2621
2622 <varlistentry>
2623 <term><command>edu.umd.cs.findbugs.annotations.NonNull</command></term>
2624 <listitem>
2625 <command>[Target]</command> Field, Method, Parameter
2626 </listitem>
2627 <listitem>
2628 <para>
2629 The annotated element must not be null.
2630 Annotated fields must not be null after construction has completed. Annotated methods must have non-null return values.
2631 </para>
2632 </listitem>
2633 </varlistentry>
2634
2635 <varlistentry>
2636 <term><command>edu.umd.cs.findbugs.annotations.Nullable</command></term>
2637 <listitem>
2638 <command>[Target]</command> Field, Method, Parameter
2639 </listitem>
2640 <listitem>
2641 <para>
2642 The annotated element could be null under some circumstances. In general, this means
2643 developers will have to read the documentation to determine when a null value is
2644 acceptable and whether it is neccessary to check for a null value. FindBugs will
2645 treat the annotated items as though they had no annotation.
2646 </para>
2647 <para>
2648 In pratice this annotation is useful only for overriding an overarching NonNull
2649 annotation.
2650 </para>
2651 </listitem>
2652 </varlistentry>
2653
2654 <varlistentry>
2655 <term><command>edu.umd.cs.findbugs.annotations.OverrideMustInvoke</command></term>
2656 <listitem>
2657 <command>[Target]</command> Method
2658 </listitem>
2659 <listitem>
2660 <variablelist>
2661 <varlistentry>
2662 <term><command>[Parameter]</command></term>
2663 <listitem>
2664 <para>
2665 <command>value:</command>Specify when the super invocation should be
2666 performed (FIRST, ANYTIME, LAST). Default value:ANYTIME.
2667 </para>
2668 </listitem>
2669 </varlistentry>
2670 </variablelist>
2671 </listitem>
2672 <listitem>
2673 <para>
2674 Used to annotate a method that, if overridden, must (or should) be invoke super
2675 in the overriding method. Examples of such methods include finalize() and clone().
2676 The argument to the method indicates when the super invocation should occur:
2677 at any time, at the beginning of the overriding method, or at the end of the overriding method.
2678 (This anotation is not implmemented in FindBugs as of September 8, 2006).
2679 </para>
2680 </listitem>
2681 </varlistentry>
2682
2683 <varlistentry>
2684 <term><command>edu.umd.cs.findbugs.annotations.PossiblyNull</command></term>
2685 <listitem>
2686 <para>
2687 This annotation is deprecated. Use CheckForNull instead.
2688 </para>
2689 </listitem>
2690 </varlistentry>
2691
2692 <varlistentry>
2693 <term><command>edu.umd.cs.findbugs.annotations.SuppressWarnings</command></term>
2694 <listitem>
2695 <command>[Target]</command> Type, Field, Method, Parameter, Constructor, Package
2696 </listitem>
2697 <listitem>
2698 <variablelist>
2699 <varlistentry>
2700 <term><command>[Parameter]</command></term>
2701 <listitem>
2702 <para>
2703 <command>value:</command>The name of the warning. More than one name can be specified.
2704 </para>
2705 </listitem>
2706 <listitem>
2707 <para>
2708 <command>justification:</command>Reason why the warning should be ignored. Default value:"".
2709 </para>
2710 </listitem>
2711 </varlistentry>
2712 </variablelist>
2713 </listitem>
2714 <listitem>
2715 <para>
2716 The set of warnings that are to be suppressed by the compiler in the annotated element.
2717 Duplicate names are permitted. The second and successive occurrences of a name are ignored.
2718 The presence of unrecognized warning names is <emphasis>not</emphasis> an error: Compilers
2719 must ignore any warning names they do not recognize. They are, however, free to emit a
2720 warning if an annotation contains an unrecognized warning name. Compiler vendors should
2721 document the warning names they support in conjunction with this annotation type. They
2722 are encouraged to cooperate to ensure that the same names work across multiple compilers.
2723 </para>
2724 </listitem>
2725 </varlistentry>
2726
2727 <varlistentry>
2728 <term><command>edu.umd.cs.findbugs.annotations.UnknownNullness</command></term>
2729 <listitem>
2730 <command>[Target]</command> Field, Method, Parameter
2731 </listitem>
2732 <listitem>
2733 <para>
2734 Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
2735 </para>
2736 </listitem>
2737 </varlistentry>
2738
2739 <varlistentry>
2740 <term><command>edu.umd.cs.findbugs.annotations.UnknownNullness</command></term>
2741 <listitem>
2742 <command>[Target]</command> Field, Method, Parameter
2743 </listitem>
2744 <listitem>
2745 <para>
2746 Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
2747 </para>
2748 </listitem>
2749 </varlistentry>
2750 </variablelist>
2751
2752 <para>
2753 &FindBugs; also supports the following annotations:
2754 <itemizedlist>
2755 <listitem>net.jcip.annotations.GuardedBy</listitem>
2756 <listitem>net.jcip.annotations.Immutable</listitem>
2757 <listitem>net.jcip.annotations.NotThreadSafe</listitem>
2758 <listitem>net.jcip.annotations.ThreadSafe</listitem>
2759 </itemizedlist>
2760 </para>
2761 <para>
2762 You can refer the JCIP annotation <ulink url="http://jcip.net/annotations/doc/index.html">
2763 API documentation</ulink> at <ulink url="http://jcip.net/">Java Concurrency in Practice</ulink>.
2764 </para>
2765 </chapter>
2766
2767 <!--
2768 **************************************************************************
2769 Using rejarForAnalysis
2770 **************************************************************************
2771 -->
2772
2773 <chapter id="rejarForAnalysis">
2774 <title>Using rejarForAnalysis</title>
2775
2776 <para>
2777 If your project consists of many jarfiles or the jarfiles are scattered
2778 over many directories, you may wish to use the <command>rejarForAnalysis
2779 </command> script to make
2780 FindBugs invocation easier. The script collects many jarfiles and combines them
2781 into a single, large jarfile that can then be easily passed to FindBugs for
2782 analysis. This can be particularly useful in combination with the 'find' command
2783 on unix systems; e.g. <command>find . -name '*.jar' | xargs rejarForAnalysis
2784 </command>.
2785 </para>
2786
2787 <para>
2788 The <command>rejarForAnalysis</command> script
2789 can also be used to split a very large project up into a set of jarfiles with
2790 the project classfiles evenly divided between them. This is useful when running
2791 FindBugs on the entire project is not practical due to time or memory consumption.
2792 Instead of running FindBugs on the entire project, you may use <command>
2793 rejarForAnalysis</command> build one large, all-inclusive jarfile
2794 containing all classes, invoke <command>rejarForAnalysis</command>
2795 again to split the project into multiple jarfiles, then run FindBugs
2796 on each divided jarfiles in turn, specifying the the all-inclusive jarfile in
2797 the <command>-auxclasspath</command>.
2798 </para>
2799
2800 <para>
2801 These are the options accepted by the <command>rejarForAnalysis</command> script:
2802 </para>
2803
2804 <variablelist>
2805 <varlistentry>
2806 <term><command>-maxAge</command> <replaceable>days</replaceable></term>
2807 <listitem>
2808 <para>
2809 Maximum age in days (ignore jar files older than this).
2810 </para>
2811 </listitem>
2812 </varlistentry>
2813 <varlistentry>
2814 <term><command>-inputFileList</command> <replaceable>filename</replaceable></term>
2815 <listitem>
2816 <para>
2817 Text file containing names of jar files.
2818 </para>
2819 </listitem>
2820 </varlistentry>
2821 <varlistentry>
2822 <term><command>-maxClasses</command> <replaceable>num</replaceable></term>
2823 <listitem>
2824 <para>
2825 Maximum number of classes per analysis*.jar file.
2826 </para>
2827 </listitem>
2828 </varlistentry>
2829 <varlistentry>
2830 <term><command>-prefix</command> <replaceable>class name prefix</replaceable></term>
2831 <listitem>
2832 <para>
2833 Prefix of class names that should be analyzed (e.g., edu.umd.cs.).
2834 </para>
2835 </listitem>
2836 </varlistentry>
2837 </variablelist>
2838 </chapter>
2839
2840 <!--
2841 **************************************************************************
2842 Data mining
2843 **************************************************************************
2844 -->
2845
2846 <chapter id="datamining">
2847 <title>Data mining of bugs with &FindBugs;&trade;</title>
2848
2849 <para>
2850 FindBugs incorporates an ability to perform sophisticated queries on bug
2851 databases and track warnings across multiple versions of code being
2852 studied, allowing you to do things such as seeing when a bug was first introduced, examining
2853 just the warnings that have been introduced since the last release, or graphing the number
2854 of infinite recursive loops in your code over time.</para>
2855
2856 <para>
2857 These techniques all depend upon the XML format used by FindBugs for storing warnings.
2858 These XML files usually contain just the warnings from one particular analysis run, but
2859 they can also store the results from analyzing a sequence of software builds or versions.
2860 </para>
2861
2862 <para>
2863 Any FindBugs XML bug database contains a version name and timestamp.
2864 FindBugs tries to compute a timestamp from the timestamps of the files that
2865 are analyzed (e.g., the timestamp is intended to be the time the class files
2866 were generated, not analyzed). Each bug database also contains a version name.
2867 Both the version name and timestamp can be set manually using the
2868 <command>setBugDatabaseInfo</command> (<xref linkend="setBugDatabaseInfo" />) command.
2869 </para>
2870
2871 <para>A multiversion bug database assigns a sequence number to each version of
2872 the analyzed code. These sequence numbers are simply successive integers,
2873 starting at 0 (e.g., a bug database for 4 versions of the code will contain
2874 versions 0..3). The bug database will also record the name and timestamp for
2875 each version. The <command>filterBugs</command> command allows you to refer
2876 to a version by sequence number, name or timestamp.</para>
2877
2878 <para>
2879 You can take a sequence (or pair) of single version bug databases and create
2880 from them a multiversion bug database, or combine a multiversion bug database
2881 with a sequence of later single-version bug databases.</para>
2882
2883 <para>
2884 Some of these commands can be invoked as ant tasks. See below for specifics
2885 on how to invoke them and what attributes and arguments they take. All of
2886 the examples assume that the <literal>findbugs.lib</literal>
2887 <literal>refid</literal> is set correctly. Here is one way to set it:
2888 </para>
2889
2890 <programlisting>
2891 <![CDATA[
2892 <!-- findbugs task definition -->
2893 <property name="findbugs.home" value="/your/path/to/findbugs" />
2894 <path id="findbugs.lib">
2895 <fileset dir="${findbugs.home}/lib">
2896 <include name="findbugs-ant.jar"/>
2897 </fileset>
2898 </path>
2899 ]]>
2900 </programlisting>
2901
2902 <sect1 id="commands">
2903 <title>Commands</title>
2904
2905 <para>
2906 All tools for FindBugs data mining are can be invoked from the command line,
2907 and some of the more useful tools can also be invoked from an
2908 ant build file.</para>
2909
2910 <para>
2911 Briefly, the command-line tools are:</para>
2912
2913 <variablelist>
2914 <varlistentry>
2915 <term><command><link linkend="unionBugs">unionBugs</link></command></term>
2916 <listitem>
2917 <para>
2918 combine the results from separate analysis of disjoint
2919 classes
2920 </para>
2921 </listitem>
2922 </varlistentry>
2923 <varlistentry>
2924 <term><command><link linkend="computeBugHistory">computeBugHistory</link></command></term>
2925 <listitem>
2926 <para>Merge bug warnings from multiple versions of
2927 analyzed code into
2928 a single multiversion bug database. This can either be used
2929 to add more versions to an existing multiversion database,
2930 or to create a multiversion database from a sequence of single version
2931 bug warning databases.</para>
2932 </listitem>
2933 </varlistentry>
2934 <varlistentry>
2935 <term><command><link linkend="setBugDatabaseInfo">setBugDatabaseInfo</link></command></term>
2936 <listitem>
2937 <para>Set information such as the revision name or
2938 timestamp in an XML bug database</para>
2939 </listitem>
2940 </varlistentry>
2941 <varlistentry>
2942 <term><command><link linkend="listBugDatabaseInfo">listBugDatabaseInfo</link></command></term>
2943 <listitem>
2944 <para>List information such as the revision name and
2945 timestamp for a list of XML bug databases</para>
2946 </listitem>
2947 </varlistentry>
2948 <varlistentry>
2949 <term><command><link linkend="filterBugs">filterBugs</link></command></term>
2950 <listitem>
2951 <para>Select a subset of a bug database</para>
2952 </listitem>
2953 </varlistentry>
2954 <varlistentry>
2955 <term><command><link linkend="mineBugHistory">mineBugHistory</link></command></term>
2956 <listitem>
2957 <para>Generate a tabular listing of the number of warnings in each
2958 version of a multiversion bug database</para>
2959 </listitem>
2960 </varlistentry>
2961 <varlistentry>
2962 <term><command><link linkend="defectDensity">defectDensity</link></command></term>
2963 <listitem>
2964 <para>List information about defect density
2965 (warnings per 1000 NCSS)
2966 for the entire project and each class and package</para>
2967 </listitem>
2968 </varlistentry>
2969 <varlistentry>
2970 <term><command><link linkend="convertXmlToText">convertXmlToText</link></command></term>
2971 <listitem>
2972 <para>Convert bug warnings in XML format to
2973 a textual one-line-per-bug format, or to HTML</para>
2974 </listitem>
2975 </varlistentry>
2976 </variablelist>
2977
2978
2979 <sect2 id="unionBugs">
2980 <title>unionBugs</title>
2981
2982 <para>
2983 If you have, for example, separately analyzing each jar file used in an application,
2984 you can use this command to combine the separately generated xml bug warning files into
2985 a single file containing all of the warnings.</para>
2986
2987 <para>Do <emphasis>not</emphasis> use this command to combine results from analyzing different versions of the same
2988 file; use <command>computeBugHistory</command> instead.</para>
2989
2990 <para>Specify the xml files on the command line. The result is sent to standard output.</para>
2991 </sect2>
2992
2993 <sect2 id="computeBugHistory">
2994 <title>computeBugHistory</title>
2995
2996 <para>Use this command to generate a bug database containing information from different builds or versions
2997 of software you are analyzing.
2998 History is taken from the first file provided as input; any following
2999 files should be single version bug databases (if they contain history, the history in those
3000 files will be ignored).</para>
3001 <para>By default, output is written to the standard output.
3002 </para>
3003
3004 <para>This functionality may also can be accessed from ant.
3005 First create a taskdef for <command>computeBugHistory</command> in your
3006 build file:
3007 </para>
3008
3009 <programlisting>
3010 <![CDATA[
3011 <taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask">
3012 <classpath refid="findbugs.lib" />
3013 </taskdef>
3014 ]]>
3015 </programlisting>
3016
3017 <para>Attributes for this ant task are listed in the following table.
3018 To specify input files, nest them inside with a
3019 <literal>&lt;datafile&gt;</literal> element. For example:
3020 </para>
3021
3022 <programlisting>
3023 <![CDATA[
3024 <computeBugHistory home="${findbugs.home}" ...>
3025 <datafile name="analyze1.xml"/>
3026 <datafile name="analyze2.xml"/>
3027 </computeBugHistory>
3028 ]]>
3029 </programlisting>
3030
3031 <table id="computeBugHistoryTable">
3032 <title>Options for computeBugHistory command</title>
3033 <tgroup cols="3" align="left">
3034 <thead>
3035 <row>
3036 <entry>Command-line option</entry>
3037 <entry>Ant attribute</entry>
3038 <entry>Meaning</entry>
3039 </row>
3040 </thead>
3041 <tbody>
3042 <row><entry>-output &lt;file&gt;</entry> <entry>output="&lt;file&gt;"</entry> <entry>save output in the named file (may also be an input file)</entry></row>
3043 <row><entry>-overrideRevisionNames[:truth]</entry> <entry>overrideRevisionNames="[true|false]"</entry><entry>override revision names for each version with names computed from the filenames</entry></row>
3044 <row><entry>-noPackageMoves[:truth]</entry> <entry>noPackageMoves="[true|false]"</entry><entry>if a class has moved to another package, treat warnings in that class as seperate</entry></row>
3045 <row><entry>-preciseMatch[:truth]</entry> <entry>preciseMatch="[true|false]"</entry><entry>require bug patterns to match precisely</entry></row>
3046 <row><entry>-precisePriorityMatch[:truth]</entry> <entry>precisePriorityMatch="[true|false]"</entry><entry>consider two warnings as the same only if priorities match exactly</entry></row>
3047 <row><entry>-quiet[:truth]</entry> <entry>quiet="[true|false]"</entry><entry>don't generate any output to standard out unless there is an error</entry></row>
3048 <row><entry>-withMessages[:truth]</entry> <entry>withMessages="[true|false]"</entry><entry>include human-readable messages describing the warnings in XML output</entry></row>
3049 </tbody>
3050 </tgroup>
3051 </table>
3052
3053 </sect2>
3054 <sect2 id="filterBugs">
3055 <title>filterBugs</title>
3056 <para>This command is used to select a subset of warnings from a FindBugs XML warning file
3057 and write the selected subset to a new FindBugs warning file.</para>
3058 <para>
3059 This command takes a sequence of options, and either zero, one or two
3060 filenames of findbugs xml bug files on the command line.</para>
3061 <para>If no file names are provided, the command reads from standard input
3062 and writes to standard output. If one file name is provided,
3063 it reads from the file and writes to standard output.
3064 If two file names are provided, it reads from the first and writes the output
3065 to the second file name.</para>
3066
3067 <para>This functionality may also can be accessed from ant.
3068 First create a taskdef for <command>filterBugs</command> in your
3069 build file:
3070 </para>
3071
3072 <programlisting>
3073 <![CDATA[
3074 <taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsTask">
3075 <classpath refid="findbugs.lib" />
3076 </taskdef>
3077 ]]>
3078 </programlisting>
3079
3080 <para>Attributes for this ant task are listed in the following table.
3081 To specify an input file either use the input attribute or nest it inside
3082 the ant call with a <literal>&lt;datafile&gt;</literal> element. For example:
3083 </para>
3084
3085 <programlisting>
3086 <![CDATA[
3087 <filterBugs home="${findbugs.home}" ...>
3088 <datafile name="analyze.xml"/>
3089 </filterBugs>
3090 ]]>
3091 </programlisting>
3092
3093 <table id="filterOptionsTable">
3094 <title>Options for filterBugs command</title>
3095 <tgroup cols="3" align="left">
3096 <thead>
3097 <row>
3098 <entry>Command-line option</entry>
3099 <entry>Ant attribute</entry>
3100 <entry>Meaning</entry>
3101 </row>
3102 </thead>
3103 <tbody>
3104 <row><entry></entry> <entry>input="&lt;file&gt;"</entry> <entry>use file as input</entry></row>
3105 <row><entry></entry> <entry>output="&lt;file&gt;"</entry> <entry>output results to file</entry></row>
3106 <row><entry>-not</entry> <entry>not="[true|false]"</entry> <entry>reverse (all) switches for the filter</entry></row>
3107 <row><entry>-withSource[:truth]</entry> <entry>withSource="[true|false]"</entry> <entry>only warnings for switch source is available</entry></row>
3108 <row><entry>-exclude &lt;filter file&gt;</entry><entry>exclude="&lt;filter file&gt;"</entry> <entry>exclude bugs matching given filter</entry></row>
3109 <row><entry>-include &lt;filter file&gt;</entry><entry>include="&lt;filter file&gt;"</entry> <entry>include only bugs matching given filter</entry></row>
3110 <row><entry>-annotation &lt;text&gt;</entry> <entry>annotation="&lt;text&gt;"</entry> <entry>allow only warnings containing this text in a manual annotation</entry></row>
3111 <row><entry>-after &lt;when&gt;</entry> <entry>after="&lt;when&gt;"</entry> <entry>allow only warnings that first occurred after this version</entry></row>
3112 <row><entry>-before &lt;when&gt;</entry> <entry>before="&lt;when&gt;"</entry> <entry>allow only warnings that first occurred before this version</entry></row>
3113 <row><entry>-first &lt;when&gt;</entry> <entry>first="&lt;when&gt;"</entry> <entry>allow only warnings that first occurred in this version</entry></row>
3114 <row><entry>-last &lt;when&gt;</entry> <entry>last="&lt;when&gt;"</entry> <entry>allow only warnings that last occurred in this version</entry></row>
3115 <row><entry>-fixed &lt;when&gt;</entry> <entry>fixed="&lt;when&gt;"</entry> <entry>allow only warnings that last occurred in the previous version (clobbers <option>-last</option>)</entry></row>
3116 <row><entry>-present &lt;when&gt;</entry> <entry>present="&lt;when&gt;"</entry> <entry>allow only warnings present in this version</entry></row>
3117 <row><entry>-absent &lt;when&gt;</entry> <entry>absent="&lt;when&gt;"</entry> <entry>allow only warnings absent in this version</entry></row>
3118 <row><entry>-active[:truth]</entry> <entry>active="[true|false]"</entry> <entry>allow only warnings alive in the last sequence number</entry></row>
3119 <row><entry>-introducedByChange[:truth]</entry> <entry>introducedByChange="[true|false]"</entry><entry>allow only warnings introduced by a change of an existing class</entry></row>
3120 <row><entry>-removedByChange[:truth]</entry> <entry>removedByChange="[true|false]"</entry> <entry>allow only warnings removed by a change of a persisting class</entry></row>
3121 <row><entry>-newCode[:truth]</entry> <entry>newCode="[true|false]"</entry> <entry>allow only warnings introduced by the addition of a new class</entry></row>
3122 <row><entry>-removedCode[:truth]</entry> <entry>removedCode="[true|false]"</entry> <entry>allow only warnings removed by removal of a class</entry></row>
3123 <row><entry>-priority &lt;level&gt;</entry> <entry>priority="&lt;level&gt;"</entry> <entry>allow only warnings with this priority or higher</entry></row>
3124 <row><entry>-maxRank &lt;rank&gt;</entry> <entry>rank="[1..20]"</entry> <entry>allow only warnings with this rank or lower</entry></row>
3125 <row><entry>-class &lt;pattern&gt;</entry> <entry>class="&lt;class&gt;"</entry> <entry>allow only bugs whose primary class name matches this pattern</entry></row>
3126 <row><entry>-bugPattern &lt;pattern&gt;</entry> <entry>bugPattern="&lt;pattern&gt;"</entry> <entry>allow only bugs whose type matches this pattern</entry></row>
3127 <row><entry>-category &lt;category&gt;</entry> <entry>category="&lt;category&gt;"</entry> <entry>allow only warnings with a category that starts with this string</entry></row>
3128 <row><entry>-designation &lt;designation&gt;</entry> <entry>designation="&lt;designation&gt;"</entry> <entry>allow only warnings with this designation (e.g., -designation SHOULD_FIX)</entry></row>
3129 <row><entry>-withMessages[:truth] </entry> <entry>withMessages="[true|false]"</entry> <entry>the generated XML should contain textual messages</entry></row>
3130 </tbody>
3131 </tgroup>
3132 </table>
3133
3134 </sect2>
3135
3136 <sect2 id="mineBugHistory">
3137 <title>mineBugHistory</title>
3138 <para>This command generates a table containing counts of the numbers of warnings
3139 in each version of a multiversion bug database.</para>
3140
3141
3142 <para>This functionality may also can be accessed from ant.
3143 First create a taskdef for <command>mineBugHistory</command> in your
3144 build file:
3145 </para>
3146
3147 <programlisting>
3148 <![CDATA[
3149 <taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask">
3150 <classpath refid="findbugs.lib" />
3151 </taskdef>
3152 ]]>
3153 </programlisting>
3154
3155 <para>Attributes for this ant task are listed in the following table.
3156 To specify an input file either use the <literal>input</literal>
3157 attribute or nest it inside the ant call with a
3158 <literal>&lt;datafile&gt;</literal> element. For example:
3159 </para>
3160
3161 <programlisting>
3162 <![CDATA[
3163 <mineBugHistory home="${findbugs.home}" ...>
3164 <datafile name="analyze.xml"/>
3165 </mineBugHistory>
3166 ]]>
3167 </programlisting>
3168
3169 <table id="mineBugHistoryOptionsTable">
3170 <title>Options for mineBugHistory command</title>
3171 <tgroup cols="3" align="left">
3172 <thead>
3173 <row>
3174 <entry>Command-line option</entry>
3175 <entry>Ant attribute</entry>
3176 <entry>Meaning</entry>
3177 </row>
3178 </thead>
3179 <tbody>
3180 <row><entry></entry> <entry>input="&lt;file&gt;"</entry> <entry>use file as input</entry></row>
3181 <row><entry></entry> <entry>output="&lt;file&gt;"</entry> <entry>write output to file</entry></row>
3182 <row><entry>-formatDates</entry> <entry>formatDates="[true|false]"</entry> <entry>render dates in textual form</entry></row>
3183 <row><entry>-noTabs</entry> <entry>noTabs="[true|false]"</entry> <entry>delimit columns with groups of spaces instead of tabs (see below)</entry></row>
3184 <row><entry>-summary</entry> <entry>summary="[true|false]"</entry> <entry>output terse summary of changes over the last ten entries</entry></row>
3185 </tbody>
3186 </tgroup>
3187 </table>
3188
3189 <para>
3190 The <option>-noTabs</option> output can be easier to read from a shell
3191 with a fixed-width font.
3192 Because numeric columns are right-justified, spaces may precede the
3193 first column value. This option also causes <option>-formatDates</option>
3194 to render dates in terser format without embedded whitespace.
3195 </para>
3196
3197 <para>The table is a tab-separated (barring <option>-noTabs</option>)
3198 table with the following columns:</para>
3199
3200 <table id="mineBugHistoryColumns">
3201 <title>Columns in mineBugHistory output</title>
3202 <tgroup cols="2" align="left">
3203 <thead>
3204 <row>
3205 <entry>Title</entry>
3206 <entry>Meaning</entry>
3207 </row>
3208 </thead>
3209 <tbody>
3210 <row><entry>seq</entry><entry>Sequence number (successive integers, starting at 0)</entry></row>
3211 <row><entry>version</entry><entry>Version name</entry></row>
3212 <row><entry>time</entry><entry>Release timestamp</entry></row>
3213 <row><entry>classes</entry><entry>Number of classes analyzed</entry></row>
3214 <row><entry>NCSS</entry><entry>Non Commenting Source Statements</entry></row>
3215 <row><entry>added</entry><entry>Count of new warnings for a class that existed in the previous version</entry></row>
3216 <row><entry>newCode</entry><entry>Count of new warnings for a class that did not exist in the previous version</entry></row>
3217 <row><entry>fixed</entry><entry>Count of warnings removed from a class that remains in the current version</entry></row>
3218 <row><entry>removed</entry><entry>Count of warnings in the previous version for a class that is not present in the current version</entry></row>
3219 <row><entry>retained</entry><entry>Count of warnings that were in both the previous and current version</entry></row>
3220 <row><entry>dead</entry><entry>Warnings that were present in earlier versions but in neither the current version or the immediately preceeding version</entry></row>
3221 <row><entry>active</entry><entry>Total warnings present in the current version</entry></row>
3222 </tbody>
3223 </tgroup>
3224 </table>
3225 </sect2>
3226
3227 <sect2 id="defectDensity">
3228 <title>defectDensity</title>
3229 <para>
3230 This command lists information about defect density (warnings per 1000 NCSS) for the entire project and each class and package.
3231 It can either be invoked with no files specified on the command line (in which case it reads from standard input)
3232 or with one file specified on the command line.</para>
3233 <para>It generates a table with the following columns, and with one
3234 row for the entire project, and one row for each package or class that contains at least
3235 4 warnings.</para>
3236 <table id="defectDensityColumns">
3237 <title>Columns in defectDensity output</title>
3238 <tgroup cols="2" align="left">
3239 <thead>
3240 <row>
3241 <entry>Title</entry>
3242 <entry>Meaning</entry>
3243 </row>
3244 </thead>
3245 <tbody>
3246 <row><entry>kind</entry><entry>project, package or class</entry></row>
3247 <row><entry>name</entry><entry>The name of the project, package or class</entry></row>
3248 <row><entry>density</entry><entry>Number of warnings generated per 1000 lines of NCSS.</entry></row>
3249 <row><entry>bugs</entry><entry>Number of warnings</entry></row>
3250 <row><entry>NCSS</entry><entry>Calculated number of NCSS</entry></row>
3251 </tbody>
3252 </tgroup>
3253 </table>
3254 </sect2>
3255
3256 <sect2 id="convertXmlToText">
3257 <title>convertXmlToText</title>
3258
3259 <para>
3260 This command converts a warning collection in XML format to a text
3261 format with one line per warning, or to HTML.
3262 </para>
3263
3264 <para>This functionality may also can be accessed from ant.
3265 First create a taskdef for <command>convertXmlToText</command> in your
3266 build file:
3267 </para>
3268
3269 <programlisting>
3270 <![CDATA[
3271 <taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask">
3272 <classpath refid="findbugs.lib" />
3273 </taskdef>
3274 ]]>
3275 </programlisting>
3276
3277 <para>Attributes for this ant task are listed in the following table.</para>
3278
3279 <table id="convertXmlToTextTable">
3280 <title>Options for convertXmlToText command</title>
3281 <tgroup cols="3" align="left">
3282 <thead>
3283 <row>
3284 <entry>Command-line option</entry>
3285 <entry>Ant attribute</entry>
3286 <entry>Meaning</entry>
3287 </row>
3288 </thead>
3289 <tbody>
3290 <row><entry></entry> <entry>input="&lt;filename&gt;"</entry> <entry>use file as input</entry></row>
3291 <row><entry></entry> <entry>output="&lt;filename&gt;"</entry> <entry>output results to file</entry></row>
3292 <row><entry>-longBugCodes</entry> <entry>longBugCodes="[true|false]"</entry> <entry>use the full bug pattern code instead of two-letter abbreviation</entry></row>
3293 <row><entry></entry> <entry>format="text"</entry> <entry>generate plain text output with one bug per line (command-line default)</entry></row>
3294 <row><entry>-html[:stylesheet]</entry> <entry>format="html:&lt;stylesheet&gt;"</entry> <entry>generate output with specified stylesheet (see below), or default.xsl if unspecified</entry></row>
3295 </tbody>
3296 </tgroup>
3297 </table>
3298
3299 <para>
3300 You may specify plain.xsl, default.xsl, fancy.xsl, fancy-hist.xsl,
3301 or your own XSL stylesheet for the -html/format option.
3302 Despite the name of this option, you may specify
3303 a stylesheet that emits something other than html.
3304 When applying a stylesheet other than those included
3305 with FindBugs (listed above), the -html/format option should be used
3306 with a path or URL to the stylesheet.
3307 </para>
3308 </sect2>
3309
3310 <sect2 id="setBugDatabaseInfo">
3311 <title>setBugDatabaseInfo</title>
3312
3313 <para>
3314 This command sets meta-information in a specified warning collection.
3315 It takes the following options:
3316 </para>
3317
3318 <para>This functionality may also can be accessed from ant.
3319 First create a taskdef for <command>setBugDatabaseInfo</command> in your
3320 build file:
3321 </para>
3322
3323 <programlisting>
3324 <![CDATA[
3325 <taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask">
3326 <classpath refid="findbugs.lib" />
3327 </taskdef>
3328 ]]>
3329 </programlisting>
3330
3331 <para>Attributes for this ant task are listed in the following table.
3332 To specify an input file either use the <literal>input</literal>
3333 attribute or nest it inside the ant call with a
3334 <literal>&lt;datafile&gt;</literal> element. For example:
3335 </para>
3336
3337 <programlisting>
3338 <![CDATA[
3339 <setBugDatabaseInfo home="${findbugs.home}" ...>
3340 <datafile name="analyze.xml"/>
3341 </setBugDatabaseInfo>
3342 ]]>
3343 </programlisting>
3344
3345 <table id="setBugDatabaseInfoOptions">
3346 <title>setBugDatabaseInfo Options</title>
3347 <tgroup cols="3" align="left">
3348 <thead>
3349 <row>
3350 <entry>Command-line option</entry>
3351 <entry>Ant attribute</entry>
3352 <entry>Meaning</entry>
3353 </row>
3354 </thead>
3355 <tbody>
3356 <row><entry></entry> <entry>input="&lt;file&gt;"</entry> <entry>use file as input</entry></row>
3357 <row><entry></entry> <entry>output="&lt;file&gt;"</entry> <entry>write output to file</entry></row>
3358 <row><entry>-name &lt;name&gt;</entry> <entry>name="&lt;name&gt;"</entry> <entry>set name for (last) revision</entry></row>
3359 <row><entry>-timestamp &lt;when&gt;</entry> <entry>timestamp="&lt;when&gt;"</entry> <entry>set timestamp for (last) revision</entry></row>
3360 <row><entry>-source &lt;directory&gt;</entry> <entry>source="&lt;directory&gt;"</entry> <entry>add specified directory to the source search path</entry></row>
3361 <row><entry>-findSource &lt;directory&gt;</entry> <entry>findSource="&lt;directory&gt;"</entry> <entry>find and add all relevant source directions contained within specified directory</entry></row>
3362 <row><entry>-suppress &lt;filter file&gt;</entry> <entry>suppress="&lt;filter file&gt;"</entry> <entry>suppress warnings matched by this file (replaces previous suppressions)</entry></row>
3363 <row><entry>-withMessages</entry> <entry>withMessages="[true|false]"</entry> <entry>add textual messages to XML</entry></row>
3364 <row><entry>-resetSource</entry> <entry>resetSource="[true|false]"</entry> <entry>remove all source search paths</entry></row>
3365 </tbody>
3366 </tgroup>
3367 </table>
3368 </sect2>
3369
3370 <sect2 id="listBugDatabaseInfo">
3371 <title>listBugDatabaseInfo</title>
3372
3373 <para>This command takes a list of zero or more xml bug database filenames on the command line.
3374 If zero file names are provided, it reads from standard input and does not generate
3375 a table header.</para>
3376
3377 <para>There is only one option: <option>-formatDates</option> renders dates
3378 in textual form.
3379 </para>
3380
3381 <para>The output is a table one row per bug database and the following columns:</para>
3382 <table id="listBugDatabaseInfoColumns">
3383 <title>listBugDatabaseInfo Columns</title>
3384 <tgroup cols="2" align="left">
3385 <thead>
3386 <row>
3387 <entry>Column</entry>
3388 <entry>Meaning</entry>
3389 </row>
3390 </thead>
3391 <tbody>
3392 <row><entry>version</entry><entry>version name</entry></row>
3393 <row><entry>time</entry><entry>Release timestamp</entry></row>
3394 <row><entry>classes</entry><entry>Number of classes analyzed</entry></row>
3395 <row><entry>NCSS</entry><entry>Non Commenting Source Statements analyzed</entry></row>
3396 <row><entry>total</entry><entry>Total number of warnings of all kinds</entry></row>
3397 <row><entry>high</entry><entry>Total number of high priority warnings of all kinds</entry></row>
3398 <row><entry>medium</entry><entry>Total number of medium/normal priority warnings of all kinds</entry></row>
3399 <row><entry>low</entry><entry>Total number of low priority warnings of all kinds</entry></row>
3400 <row><entry>filename</entry><entry>filename of database</entry></row>
3401 <!--
3402 <row><entry></entry><entry></entry></row>
3403 <row><entry></entry><entry></entry></row>
3404 <row><entry></entry><entry></entry></row>
3405 <row><entry></entry><entry></entry></row>
3406 <row><entry></entry><entry></entry></row>
3407 <row><entry></entry><entry></entry></row>
3408 -->
3409 </tbody>
3410 </tgroup>
3411 </table>
3412
3413 </sect2>
3414
3415 </sect1>
3416
3417 <sect1 id="examples">
3418 <title>Examples</title>
3419 <sect2 id="unixscriptsexamples">
3420 <title>Mining history using proveded shell scrips</title>
3421 <para>In all of the following, the commands are given in a directory that contains
3422 directories jdk1.6.0-b12, jdk1.6.0-b13, ..., jdk1.6.0-b60.</para>
3423
3424 <para>You can use the command:</para>
3425 <screen>
3426 computeBugHistory jdk1.6.0-b* | filterBugs -bugPattern IL_ | mineBugHistory -formatDates
3427 </screen>
3428 <para>to generate the following output:</para>
3429
3430 <screen>
3431 seq version time classes NCSS added newCode fixed removed retained dead active
3432 0 jdk1.6.0-b12 "Thu Nov 11 09:07:20 EST 2004" 13128 811569 0 4 0 0 0 0 4
3433 1 jdk1.6.0-b13 "Thu Nov 18 06:02:06 EST 2004" 13128 811570 0 0 0 0 4 0 4
3434 2 jdk1.6.0-b14 "Thu Dec 02 06:12:26 EST 2004" 13145 811786 0 0 2 0 2 0 2
3435 3 jdk1.6.0-b15 "Thu Dec 09 06:07:04 EST 2004" 13174 811693 0 0 1 0 1 2 1
3436 4 jdk1.6.0-b16 "Thu Dec 16 06:21:28 EST 2004" 13175 811715 0 0 0 0 1 3 1
3437 5 jdk1.6.0-b17 "Thu Dec 23 06:27:22 EST 2004" 13176 811974 0 0 0 0 1 3 1
3438 6 jdk1.6.0-b19 "Thu Jan 13 06:41:16 EST 2005" 13176 812011 0 0 0 0 1 3 1
3439 7 jdk1.6.0-b21 "Thu Jan 27 05:57:52 EST 2005" 13177 812173 0 0 0 0 1 3 1
3440 8 jdk1.6.0-b23 "Thu Feb 10 05:44:36 EST 2005" 13179 812188 0 0 0 0 1 3 1
3441 9 jdk1.6.0-b26 "Thu Mar 03 06:04:02 EST 2005" 13199 811770 0 0 0 0 1 3 1
3442 10 jdk1.6.0-b27 "Thu Mar 10 04:48:38 EST 2005" 13189 812440 0 0 0 0 1 3 1
3443 11 jdk1.6.0-b28 "Thu Mar 17 02:54:22 EST 2005" 13185 812056 0 0 0 0 1 3 1
3444 12 jdk1.6.0-b29 "Thu Mar 24 03:09:20 EST 2005" 13117 809468 0 0 0 0 1 3 1
3445 13 jdk1.6.0-b30 "Thu Mar 31 02:53:32 EST 2005" 13118 809501 0 0 0 0 1 3 1
3446 14 jdk1.6.0-b31 "Thu Apr 07 03:00:14 EDT 2005" 13117 809572 0 0 0 0 1 3 1
3447 15 jdk1.6.0-b32 "Thu Apr 14 02:56:56 EDT 2005" 13169 811096 0 0 0 0 1 3 1
3448 16 jdk1.6.0-b33 "Thu Apr 21 02:46:22 EDT 2005" 13187 811942 0 0 0 0 1 3 1
3449 17 jdk1.6.0-b34 "Thu Apr 28 02:49:00 EDT 2005" 13195 813488 0 1 0 0 1 3 2
3450 18 jdk1.6.0-b35 "Thu May 05 02:49:04 EDT 2005" 13457 829837 0 0 0 0 2 3 2
3451 19 jdk1.6.0-b36 "Thu May 12 02:59:46 EDT 2005" 13462 831278 0 0 0 0 2 3 2
3452 20 jdk1.6.0-b37 "Thu May 19 02:55:08 EDT 2005" 13464 831971 0 0 0 0 2 3 2
3453 21 jdk1.6.0-b38 "Thu May 26 03:08:16 EDT 2005" 13564 836565 0 0 0 0 2 3 2
3454 22 jdk1.6.0-b39 "Fri Jun 03 03:10:48 EDT 2005" 13856 849992 0 1 0 0 2 3 3
3455 23 jdk1.6.0-b40 "Thu Jun 09 03:30:28 EDT 2005" 15972 959619 0 2 0 0 3 3 5
3456 24 jdk1.6.0-b41 "Thu Jun 16 03:19:22 EDT 2005" 15972 959619 0 0 0 0 5 3 5
3457 25 jdk1.6.0-b42 "Fri Jun 24 03:38:54 EDT 2005" 15966 958581 0 0 0 0 5 3 5
3458 26 jdk1.6.0-b43 "Thu Jul 14 03:09:34 EDT 2005" 16041 960544 0 0 0 0 5 3 5
3459 27 jdk1.6.0-b44 "Thu Jul 21 03:05:54 EDT 2005" 16041 960547 0 0 0 0 5 3 5
3460 28 jdk1.6.0-b45 "Thu Jul 28 03:26:10 EDT 2005" 16037 960606 0 0 1 0 4 3 4
3461 29 jdk1.6.0-b46 "Thu Aug 04 03:02:48 EDT 2005" 15936 951355 0 0 0 0 4 4 4
3462 30 jdk1.6.0-b47 "Thu Aug 11 03:18:56 EDT 2005" 15964 952387 0 0 1 0 3 4 3
3463 31 jdk1.6.0-b48 "Thu Aug 18 08:10:40 EDT 2005" 15970 953421 0 0 0 0 3 5 3
3464 32 jdk1.6.0-b49 "Thu Aug 25 03:24:38 EDT 2005" 16048 958940 0 0 0 0 3 5 3
3465 33 jdk1.6.0-b50 "Thu Sep 01 01:52:40 EDT 2005" 16287 974937 1 0 0 0 3 5 4
3466 34 jdk1.6.0-b51 "Thu Sep 08 01:55:36 EDT 2005" 16362 979377 0 0 0 0 4 5 4
3467 35 jdk1.6.0-b52 "Thu Sep 15 02:04:08 EDT 2005" 16477 979399 0 0 0 0 4 5 4
3468 36 jdk1.6.0-b53 "Thu Sep 22 02:00:28 EDT 2005" 16019 957900 0 0 1 0 3 5 3
3469 37 jdk1.6.0-b54 "Thu Sep 29 01:54:34 EDT 2005" 16019 957900 0 0 0 0 3 6 3
3470 38 jdk1.6.0-b55 "Thu Oct 06 01:54:14 EDT 2005" 16051 959014 0 0 0 0 3 6 3
3471 39 jdk1.6.0-b56 "Thu Oct 13 01:54:12 EDT 2005" 16211 970835 0 0 0 0 3 6 3
3472 40 jdk1.6.0-b57 "Thu Oct 20 01:55:26 EDT 2005" 16279 971627 0 0 0 0 3 6 3
3473 41 jdk1.6.0-b58 "Thu Oct 27 01:56:30 EDT 2005" 16283 971945 0 0 0 0 3 6 3
3474 42 jdk1.6.0-b59 "Thu Nov 03 01:56:58 EST 2005" 16232 972193 0 0 0 0 3 6 3
3475 43 jdk1.6.0-b60 "Thu Nov 10 01:54:18 EST 2005" 16235 972346 0 0 0 0 3 6 3
3476 </screen>
3477
3478 <para>
3479 We could also generate that information directly, without creating an intermediate db.xml file, using the command
3480 </para>
3481
3482 <screen>
3483 computeBugHistory jdk1.6.0-b*/jre/lib/rt.xml | filterBugs -bugPattern IL_ db.xml | mineBugHistory -formatDates
3484 </screen>
3485
3486 <para>We can then use that information to display a graph showing the number of infinite recursive loops
3487 found by FindBugs in each build of Sun's JDK1.6.0. The blue area indicates the number of infinite
3488 recursive loops in that build, the red area above it indicates the number of infinite recursive loops that existed
3489 in some previous version but not in the current version (thus, the combined height of the red and blue areas
3490 is guaranteed to never decrease, and goes up whenever a new infinite recursive loop bug is introduced). The height
3491 of the red area is computed as the sum of the fixed, removed and dead values for each version.
3492 The reductions in builds 13 and 14 came after Sun was notified about the bugs found by FindBugs in the JDK.
3493 </para>
3494 <mediaobject>
3495 <imageobject>
3496 <imagedata fileref="infiniteRecursiveLoops.png" />
3497 </imageobject>
3498 </mediaobject>
3499
3500 <para>
3501 Given the db.xml file that contains the results for all the jdk1.6.0 builds, the following command will show the history of high and medium priority correctness warnings:
3502 </para>
3503
3504 <screen>
3505 filterBugs -priority M -category C db.xml | mineBugHistory -formatDates
3506 </screen>
3507
3508 <para>
3509 generating the table:
3510 </para>
3511
3512 <screen>
3513 seq version time classes NCSS added newCode fixed removed retained dead active
3514 0 jdk1.6.0-b12 "Thu Nov 11 09:07:20 EST 2004" 13128 811569 0 1075 0 0 0 0 1075
3515 1 jdk1.6.0-b13 "Thu Nov 18 06:02:06 EST 2004" 13128 811570 0 0 0 0 1075 0 1075
3516 2 jdk1.6.0-b14 "Thu Dec 02 06:12:26 EST 2004" 13145 811786 3 0 6 0 1069 0 1072
3517 3 jdk1.6.0-b15 "Thu Dec 09 06:07:04 EST 2004" 13174 811693 2 1 3 0 1069 6 1072
3518 4 jdk1.6.0-b16 "Thu Dec 16 06:21:28 EST 2004" 13175 811715 0 0 1 0 1071 9 1071
3519 5 jdk1.6.0-b17 "Thu Dec 23 06:27:22 EST 2004" 13176 811974 0 0 1 0 1070 10 1070
3520 6 jdk1.6.0-b19 "Thu Jan 13 06:41:16 EST 2005" 13176 812011 0 0 0 0 1070 11 1070
3521 7 jdk1.6.0-b21 "Thu Jan 27 05:57:52 EST 2005" 13177 812173 0 0 1 0 1069 11 1069
3522 8 jdk1.6.0-b23 "Thu Feb 10 05:44:36 EST 2005" 13179 812188 0 0 0 0 1069 12 1069
3523 9 jdk1.6.0-b26 "Thu Mar 03 06:04:02 EST 2005" 13199 811770 0 0 2 1 1066 12 1066
3524 10 jdk1.6.0-b27 "Thu Mar 10 04:48:38 EST 2005" 13189 812440 1 0 1 1 1064 15 1065
3525 11 jdk1.6.0-b28 "Thu Mar 17 02:54:22 EST 2005" 13185 812056 0 0 0 0 1065 17 1065
3526 12 jdk1.6.0-b29 "Thu Mar 24 03:09:20 EST 2005" 13117 809468 3 0 8 26 1031 17 1034
3527 13 jdk1.6.0-b30 "Thu Mar 31 02:53:32 EST 2005" 13118 809501 0 0 0 0 1034 51 1034
3528 14 jdk1.6.0-b31 "Thu Apr 07 03:00:14 EDT 2005" 13117 809572 0 0 0 0 1034 51 1034
3529 15 jdk1.6.0-b32 "Thu Apr 14 02:56:56 EDT 2005" 13169 811096 1 1 0 1 1033 51 1035
3530 16 jdk1.6.0-b33 "Thu Apr 21 02:46:22 EDT 2005" 13187 811942 3 0 2 1 1032 52 1035
3531 17 jdk1.6.0-b34 "Thu Apr 28 02:49:00 EDT 2005" 13195 813488 0 1 0 0 1035 55 1036
3532 18 jdk1.6.0-b35 "Thu May 05 02:49:04 EDT 2005" 13457 829837 0 36 2 0 1034 55 1070
3533 19 jdk1.6.0-b36 "Thu May 12 02:59:46 EDT 2005" 13462 831278 0 0 0 0 1070 57 1070
3534 20 jdk1.6.0-b37 "Thu May 19 02:55:08 EDT 2005" 13464 831971 0 1 1 0 1069 57 1070
3535 21 jdk1.6.0-b38 "Thu May 26 03:08:16 EDT 2005" 13564 836565 1 7 2 6 1062 58 1070
3536 22 jdk1.6.0-b39 "Fri Jun 03 03:10:48 EDT 2005" 13856 849992 6 39 5 0 1065 66 1110
3537 23 jdk1.6.0-b40 "Thu Jun 09 03:30:28 EDT 2005" 15972 959619 7 147 11 0 1099 71 1253
3538 24 jdk1.6.0-b41 "Thu Jun 16 03:19:22 EDT 2005" 15972 959619 0 0 0 0 1253 82 1253
3539 25 jdk1.6.0-b42 "Fri Jun 24 03:38:54 EDT 2005" 15966 958581 3 0 1 2 1250 82 1253
3540 26 jdk1.6.0-b43 "Thu Jul 14 03:09:34 EDT 2005" 16041 960544 5 11 15 8 1230 85 1246
3541 27 jdk1.6.0-b44 "Thu Jul 21 03:05:54 EDT 2005" 16041 960547 0 0 0 0 1246 108 1246
3542 28 jdk1.6.0-b45 "Thu Jul 28 03:26:10 EDT 2005" 16037 960606 19 0 2 0 1244 108 1263
3543 29 jdk1.6.0-b46 "Thu Aug 04 03:02:48 EDT 2005" 15936 951355 13 1 1 32 1230 110 1244
3544 30 jdk1.6.0-b47 "Thu Aug 11 03:18:56 EDT 2005" 15964 952387 163 8 7 20 1217 143 1388
3545 31 jdk1.6.0-b48 "Thu Aug 18 08:10:40 EDT 2005" 15970 953421 0 0 0 0 1388 170 1388
3546 32 jdk1.6.0-b49 "Thu Aug 25 03:24:38 EDT 2005" 16048 958940 1 11 1 0 1387 170 1399
3547 33 jdk1.6.0-b50 "Thu Sep 01 01:52:40 EDT 2005" 16287 974937 19 27 16 7 1376 171 1422
3548 34 jdk1.6.0-b51 "Thu Sep 08 01:55:36 EDT 2005" 16362 979377 1 15 3 0 1419 194 1435
3549 35 jdk1.6.0-b52 "Thu Sep 15 02:04:08 EDT 2005" 16477 979399 0 0 1 1 1433 197 1433
3550 36 jdk1.6.0-b53 "Thu Sep 22 02:00:28 EDT 2005" 16019 957900 13 12 16 20 1397 199 1422
3551 37 jdk1.6.0-b54 "Thu Sep 29 01:54:34 EDT 2005" 16019 957900 0 0 0 0 1422 235 1422
3552 38 jdk1.6.0-b55 "Thu Oct 06 01:54:14 EDT 2005" 16051 959014 1 4 7 0 1415 235 1420
3553 39 jdk1.6.0-b56 "Thu Oct 13 01:54:12 EDT 2005" 16211 970835 6 8 37 0 1383 242 1397
3554 40 jdk1.6.0-b57 "Thu Oct 20 01:55:26 EDT 2005" 16279 971627 0 0 0 0 1397 279 1397
3555 41 jdk1.6.0-b58 "Thu Oct 27 01:56:30 EDT 2005" 16283 971945 0 1 1 0 1396 279 1397
3556 42 jdk1.6.0-b59 "Thu Nov 03 01:56:58 EST 2005" 16232 972193 6 0 5 0 1392 280 1398
3557 43 jdk1.6.0-b60 "Thu Nov 10 01:54:18 EST 2005" 16235 972346 0 0 0 0 1398 285 1398
3558 44 jdk1.6.0-b61 "Thu Nov 17 01:58:42 EST 2005" 16202 971134 2 0 4 0 1394 285 1396
3559 </screen>
3560 </sect2>
3561
3562 <sect2 id="incrementalhistory">
3563 <title>Incremental history maintenance</title>
3564
3565 <para>
3566 If db.xml contains the results of running findbugs over builds b12 - b60, we can update db.xml to include the results of analyzing b61 with the commands:
3567 </para>
3568 <screen>
3569 computeBugHistory -output db.xml db.xml jdk1.6.0-b61/jre/lib/rt.xml
3570 </screen>
3571 </sect2>
3572
3573 </sect1>
3574
3575 <sect1 id="antexample">
3576 <title>Ant example</title>
3577 <para>
3578 Here is a complete ant script example for both running findbugs and running a chain of data-mining tools afterward:
3579 </para>
3580 <screen>
3581 <![CDATA[
3582 <project name="analyze_asm_util" default="findbugs">
3583 <!-- findbugs task definition -->
3584 <property name="findbugs.home" value="/Users/ben/Documents/workspace/findbugs/findbugs" />
3585 <property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en -Duser.region=EN -Dfindbugs.home=${findbugs.home}" />
3586
3587 <path id="findbugs.lib">
3588 <fileset dir="${findbugs.home}/lib">
3589 <include name="findbugs-ant.jar"/>
3590 </fileset>
3591 </path>
3592
3593 <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
3594 <classpath refid="findbugs.lib" />
3595 </taskdef>
3596
3597 <taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask">
3598 <classpath refid="findbugs.lib" />
3599 </taskdef>
3600
3601 <taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask">
3602 <classpath refid="findbugs.lib" />
3603 </taskdef>
3604
3605 <taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask">
3606 <classpath refid="findbugs.lib" />
3607 </taskdef>
3608
3609 <!-- findbugs task definition -->
3610 <target name="findbugs">
3611 <antcall target="analyze" />
3612 <antcall target="mine" />
3613 </target>
3614
3615 <!-- analyze task -->
3616 <target name="analyze">
3617 <!-- run findbugs against asm-util -->
3618 <findbugs home="${findbugs.home}"
3619 output="xml:withMessages"
3620 timeout="90000000"
3621 reportLevel="experimental"
3622 workHard="true"
3623 effort="max"
3624 adjustExperimental="true"
3625 jvmargs="${jvmargs}"
3626 failOnError="true"
3627 outputFile="out.xml"
3628 projectName="Findbugs"
3629 debug="false">
3630 <class location="asm-util-3.0.jar" />
3631 </findbugs>
3632 </target>
3633
3634 <target name="mine">
3635
3636 <!-- Set info to the latest analysis -->
3637 <setBugDatabaseInfo home="${findbugs.home}"
3638 withMessages="true"
3639 name="asm-util-3.0.jar"
3640 input="out.xml"
3641 output="out-rel.xml"/>
3642
3643 <!-- Checking if history file already exists (out-hist.xml) -->
3644 <condition property="mining.historyfile.available">
3645 <available file="out-hist.xml"/>
3646 </condition>
3647 <condition property="mining.historyfile.notavailable">
3648 <not>
3649 <available file="out-hist.xml"/>
3650 </not>
3651 </condition>
3652
3653 <!-- this target is executed if the history file do not exist (first run) -->
3654 <antcall target="history-init">
3655 <param name="data.file" value="out-rel.xml" />
3656 <param name="hist.file" value="out-hist.xml" />
3657 </antcall>
3658 <!-- else this one is executed -->
3659 <antcall target="history">
3660 <param name="data.file" value="out-rel.xml" />
3661 <param name="hist.file" value="out-hist.xml" />
3662 <param name="hist.summary.file" value="out-hist.txt" />
3663 </antcall>
3664 </target>
3665
3666 <!-- Initializing history file -->
3667 <target name="history-init" if="mining.historyfile.notavailable">
3668 <copy file="${data.file}" tofile="${hist.file}" />
3669 </target>
3670
3671 <!-- Computing bug history -->
3672 <target name="history" if="mining.historyfile.available">
3673 <!-- Merging ${data.file} into ${hist.file} -->
3674 <computeBugHistory home="${findbugs.home}"
3675 withMessages="true"
3676 output="${hist.file}">
3677 <dataFile name="${hist.file}"/>
3678 <dataFile name="${data.file}"/>
3679 </computeBugHistory>
3680
3681 <!-- Compute history into ${hist.summary.file} -->
3682 <mineBugHistory home="${findbugs.home}"
3683 formatDates="true"
3684 noTabs="true"
3685 input="${hist.file}"
3686 output="${hist.summary.file}"/>
3687 </target>
3688
3689 </project>
3690 ]]>
3691 </screen>
3692 </sect1>
3693 </chapter>
3694
3695
3696 <!--
3697 **************************************************************************
3698 License
3699 **************************************************************************
3700 -->
3701
3702 <chapter id="license">
3703 <title>License</title>
3704
3705 <para>
3706 The name FindBugs and the FindBugs logo is trademarked by the University
3707 of Maryland.
3708 FindBugs is free software distributed under the terms of the
3709 <ulink url="http://www.gnu.org/licenses/lgpl.html">Lesser GNU Public License</ulink>.
3710 You should have received a copy of the license in the file <filename>LICENSE.txt</filename>
3711 in the &FindBugs; distribution.
3712 </para>
3713
3714 <para>
3715 You can find the latest version of FindBugs, along with its source code, from the
3716 <ulink url="http://findbugs.sourceforge.net">FindBugs web page</ulink>.
3717 </para>
3718
3719 </chapter>
3720
3721
3722 <!--
3723 **************************************************************************
3724 Acknowledgments
3725 **************************************************************************
3726 -->
3727 <chapter id="acknowledgments">
3728 <title>Acknowledgments</title>
3729
3730 <sect1>
3731 <title>Contributors</title>
3732
3733 <para>&FindBugs; was originally written by Bill Pugh (<email>pugh@cs.umd.edu</email>).
3734 David Hovemeyer (<email>daveho@cs.umd.edu</email>) implemented some of the
3735 detectors, added the Swing GUI, and is a co-maintainer.</para>
3736
3737 <para>Mike Fagan (<email>mfagan@tde.com</email>) contributed the &Ant; build script,
3738 the &Ant; task, and several enhancements and bug fixes to the GUI.</para>
3739
3740 <para>Germano Leichsenring contributed Japanese translations of the bug
3741 summaries.</para>
3742
3743 <para>David Li contributed the Emacs bug report format.</para>
3744
3745 <para>Peter D. Stout contributed recursive detection of Class-Path
3746 attributes in analyzed Jar files, German translations of
3747 text used in the Swing GUI, and other fixes.</para>
3748
3749 <para>Peter Friese wrote the &FindBugs; Eclipse plugin.</para>
3750
3751 <para>Rohan Lloyd contributed several Mac OS X enhancements,
3752 bug detector improvements,
3753 and maintains the Fink package for &FindBugs;.</para>
3754
3755 <para>Hiroshi Okugawa translated the &FindBugs; manual and
3756 more of the bug summaries into Japanese.</para>
3757
3758 <para>Phil Crosby enhanced the Eclipse plugin to add a view
3759 to display the bug details.</para>
3760
3761 <para>Dave Brosius fixed a number of bugs, added user preferences
3762 to the Swing GUI, improved several bug detectors, and
3763 contributed the string concatenation detector.</para>
3764
3765 <para>Thomas Klaeger contributed a number of bug fixes and
3766 bug detector improvements.</para>
3767
3768 <para>Andrei Loskutov made a number of improvements to the
3769 Eclipse plugin.</para>
3770
3771 <para>Brian Goetz contributed a major refactoring of the
3772 visitor classes to improve readability and understandability.</para>
3773
3774 <para> Pete Angstadt fixed several problems in the Swing GUI.</para>
3775
3776 <para>Francis Lalonde provided a task resource file for the
3777 FindBugs Ant task.</para>
3778
3779 <para>Garvin LeClaire contributed support for output in
3780 Xdocs format, for use by Maven.</para>
3781
3782 <para>Holger Stenzhorn contributed improved German translations of items
3783 in the Swing GUI.</para>
3784
3785 <para>Juha Knuutila contributed Finnish translations of items
3786 in the Swing GUI.</para>
3787
3788 <para>Tanel Lebedev contributed Estonian translations of items
3789 in the Swing GUI.</para>
3790
3791 <para>Hanai Shisei (ruimo) contributed full Japanese translations of
3792 bug messages, and text used in the Swing GUI.</para>
3793
3794 <para>David Cotton contributed Fresh translations for bug
3795 messages and for the Swing GUI.</para>
3796
3797 <para>Michael Tamm contributed support for the "errorProperty" attribute
3798 in the Ant task.</para>
3799
3800 <para>Thomas Kuehne improved the German translation of the Swing GUI.</para>
3801
3802 <para>Len Trigg improved source file support for the Emacs output mode.</para>
3803
3804 <para>Greg Bentz provided a fix for the hashcode/equals detector.</para>
3805
3806 <para>K. Hashimoto contributed internationalization fixes and several other
3807 bug fixes.</para>
3808
3809 <para>
3810 Glenn Boysko contributed support for ignoring specified local
3811 variables in the dead local store detector.
3812 </para>
3813
3814 <para>
3815 Jay Dunning contributed a detector to find equality comparisons
3816 of floating-point values, and overhauled the analysis summary
3817 report and its representation in the saved XML format.
3818 </para>
3819
3820 <para>
3821 Olivier Parent contributed updated French translations for bug descriptions and
3822 Swing GUI.
3823 </para>
3824
3825 <para>
3826 Chris Nappin contributed the <filename>plain.xsl</filename>
3827 stylesheet.
3828 </para>
3829
3830 <para>
3831 Etienne Giraudy contributed the <filename>fancy.xsl</filename> and <filename>fancy-hist.xsl</filename>
3832 stylesheets, and made improvements to the <command>-xml:withMessages</command>
3833 option.
3834 </para>
3835
3836 <para>
3837 Takashi Okamoto fixed bugs in the project preferences dialog
3838 in the Eclipse plugin, and contributed to its internationalization and localization.
3839 </para>
3840
3841 <para>Thomas Einwaller fixed bugs in the project preferences dialog in the Eclipse plugin.</para>
3842
3843 <para>Jeff Knox contributed support for the warningsProperty attribute
3844 in the Ant task.</para>
3845
3846 <para>Peter Hendriks extended the Eclipse plugin preferences,
3847 and fixed a bug related to renaming the Eclipse plugin ID.</para>
3848
3849 <para>Mark McKay contributed an Ant task to launch the findbugs frame.</para>
3850
3851 <para>Dieter von Holten (dvholten) contributed
3852 some German improvements to findbugs_de.properties.</para>
3853
3854
3855 <para>If you have contributed to &FindBugs;, but aren't mentioned above,
3856 please send email to <email>findbugs@cs.umd.edu</email> (and also accept
3857 our humble apologies).</para>
3858
3859 </sect1>
3860
3861 <sect1>
3862 <title>Software Used</title>
3863
3864 <para>&FindBugs; uses several open-source software packages, without which its
3865 development would have been much more difficult.</para>
3866
3867 <sect2>
3868 <title>BCEL</title>
3869 <para>&FindBugs; includes software developed by the Apache Software Foundation
3870 (<ulink url="http://www.apache.org/">http://www.apache.org/</ulink>).
3871 Specifically, it uses the <ulink url="http://jakarta.apache.org/bcel/">Byte Code
3872 Engineering Library</ulink>.</para>
3873 </sect2>
3874
3875 <sect2>
3876 <title>ASM</title>
3877 <para>&FindBugs; uses the <ulink url="http://asm.objectweb.org/">ASM</ulink>
3878 bytecode framework, which is distributed under the following license:</para>
3879
3880 <blockquote>
3881 <para>
3882 Copyright (c) 2000-2005 INRIA, France Telecom
3883 All rights reserved.
3884 </para>
3885
3886 <para>
3887 Redistribution and use in source and binary forms, with or without
3888 modification, are permitted provided that the following conditions
3889 are met:
3890 </para>
3891
3892 <orderedlist numeration="arabic">
3893 <listitem><para>
3894 Redistributions of source code must retain the above copyright
3895 notice, this list of conditions and the following disclaimer.
3896 </para></listitem>
3897 <listitem><para>
3898 Redistributions in binary form must reproduce the above copyright
3899 notice, this list of conditions and the following disclaimer in the
3900 documentation and/or other materials provided with the distribution.
3901 </para></listitem>
3902 <listitem><para>
3903 Neither the name of the copyright holders nor the names of its
3904 contributors may be used to endorse or promote products derived from
3905 this software without specific prior written permission.
3906 </para></listitem>
3907 </orderedlist>
3908
3909 <para>
3910 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3911 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3912 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3913 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
3914 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3915 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3916 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3917 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3918 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3919 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
3920 THE POSSIBILITY OF SUCH DAMAGE.
3921 </para>
3922 </blockquote>
3923 </sect2>
3924
3925 <sect2>
3926 <title>DOM4J</title>
3927 <para>&FindBugs; uses <ulink url="http://dom4j.org">DOM4J</ulink>, which is
3928 distributed under the following license:</para>
3929
3930 <blockquote>
3931 <para>
3932 Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
3933 </para>
3934
3935 <para>
3936 Redistribution and use of this software and associated documentation
3937 ("Software"), with or without modification, are permitted provided that
3938 the following conditions are met:
3939 </para>
3940
3941 <orderedlist numeration="arabic">
3942 <listitem><para>
3943 Redistributions of source code must retain copyright statements and
3944 notices. Redistributions must also contain a copy of this document.
3945 </para></listitem>
3946 <listitem><para>
3947 Redistributions in binary form must reproduce the above copyright
3948 notice, this list of conditions and the following disclaimer in the
3949 documentation and/or other materials provided with the distribution.
3950 </para></listitem>
3951 <listitem><para>
3952 The name "DOM4J" must not be used to endorse or promote products
3953 derived from this Software without prior written permission
3954 of MetaStuff, Ltd. For written permission, please contact
3955 <email>dom4j-info@metastuff.com</email>.
3956 </para></listitem>
3957 <listitem><para>
3958 Products derived from this Software may not be called "DOM4J" nor may
3959 "DOM4J" appear in their names without prior written permission of
3960 MetaStuff, Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
3961 </para></listitem>
3962 <listitem><para>
3963 Due credit should be given to the DOM4J Project (<ulink url="http://dom4j.org/">http://dom4j.org/</ulink>).
3964 </para></listitem>
3965 </orderedlist>
3966
3967 <para>
3968 THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS''
3969 AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
3970 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
3971 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS
3972 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
3973 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
3974 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
3975 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
3976 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
3977 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3978 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3979 </para>
3980 </blockquote>
3981
3982 </sect2>
3983
3984 </sect1>
3985
3986 </chapter>
3987
3988
3989 </book>
+0
-36
doc/manual.xsl less more
0 <?xml version='1.0'?>
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 version='1.0'
3 xmlns="http://www.w3.org/TR/xhtml1/transitional"
4 exclude-result-prefixes="#default">
5
6 <!-- build.xml will substitute the real path to chunk.xsl here. -->
7 <xsl:import href="/Users/pugh/tools/docbook-xsl-1.76.1/html/chunk.xsl"/>
8
9 <xsl:template name="user.header.content">
10
11 </xsl:template>
12
13 <!-- This causes the stylesheet to put chapters in a single HTML file,
14 rather than putting individual sections into separate files. -->
15 <xsl:variable name="chunk.section.depth">0</xsl:variable>
16
17 <!-- Put the HTML in the "manual" directory. -->
18 <xsl:variable name="base.dir">manual/</xsl:variable>
19
20 <!-- Enumerate sections. -->
21 <xsl:variable name="section.autolabel">1</xsl:variable>
22
23 <!-- Name the HTML files based on the id of the document elements. -->
24 <xsl:variable name="use.id.as.filename">1</xsl:variable>
25
26 <!-- Use graphics in admonitions -->
27 <xsl:variable name="admon.graphics">1</xsl:variable>
28
29 <!-- Admonition graphics are in the same place as the generated HTML. -->
30 <xsl:variable name="admon.graphics.path"></xsl:variable>
31
32 <!-- Just put chapters and sect1s in the TOC. -->
33 <xsl:variable name="toc.section.depth">1</xsl:variable>
34
35 </xsl:stylesheet>
+0
-2806
doc/manual_ja.xml less more
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://findbugs.googlecode.com/svn/trunk/findbugs/etc/docbook/docbookx.dtd"
2 [
3 <!ENTITY FindBugs "<application>FindBugs</application>">
4 <!ENTITY Ant "<application>Ant</application>">
5 <!ENTITY Saxon "<application>Saxon</application>">
6 <!ENTITY FBHome "<replaceable>$FINDBUGS_HOME</replaceable>">
7 <!ENTITY FBHomeWin "<replaceable>&#x25;FINDBUGS_HOME&#x25;</replaceable>">
8 <!ENTITY nbsp "&#160;">
9 ]>
10 <book lang="ja" id="findbugs-manual">
11
12 <bookinfo>
13 <title>&FindBugs;&trade; マニュアル</title>
14
15 <authorgroup>
16 <author>
17 <firstname>David</firstname>
18 <othername>H.</othername>
19 <surname>Hovemeyer</surname>
20 </author>
21 <author>
22 <firstname>William</firstname>
23 <othername>W.</othername>
24 <surname>Pugh</surname>
25 </author>
26 </authorgroup>
27
28 <copyright>
29 <year>2003</year>
30 <year>2004</year>
31 <year>2005</year>
32 <year>2006</year>
33 <year>2008</year>
34 <holder>University of Maryland</holder>
35 </copyright>
36
37 <legalnotice>
38 <para>このマニュアルは、クリエイティブ・コモンズ表示-非営利-継承に基づく使用許諾がなされています。使用許諾書をご覧になる場合は、 <ulink url="http://creativecommons.org/licenses/by-nc-sa/1.0/deed.ja">http://creativecommons.org/licenses/by-nc-sa/1.0/</ulink> にアクセスするか、クリエイティブ・コモンズ(559 Nathan Abbott Way, Stanford, California 94305, USA)に書簡を送付してください。</para>
39 <para>名称「FindBugs」および FindBugs のロゴは、メリーランド大学の登録商標です。</para>
40 </legalnotice>
41
42 <edition>2.0.3</edition>
43
44 <pubdate>17:16:15 EST, 22 November, 2013</pubdate>
45
46 </bookinfo>
47
48 <!--
49 **************************************************************************
50 Introduction
51 **************************************************************************
52 -->
53
54 <chapter id="introduction">
55 <title>はじめに</title>
56
57 <para>&FindBugs;&trade; は、Java プログラムの中のバグを見つけるプログラムです。このプログラムは、「バグ パターン」の実例を探します。「バグ パターン」とは、エラーとなる可能性の高いコードの事例です。</para>
58
59 <para>この文書は、&FindBugs; バージョン 2.0.3 について説明してます。私たちは、 &FindBugs; に対するフィードバックを心待ちにしています。どうぞ、 <ulink url="http://findbugs.sourceforge.net">&FindBugs; Web ページ</ulink> にアクセスしてください。&FindBugs; についての最新情報、連絡先および &FindBugs; メーリングリストなどのサポート情報を入手することができます。</para>
60
61 <sect1>
62 <title>必要条件</title>
63 <para>&FindBugs; を使用するには、 <ulink url="http://java.sun.com/j2se">Java 2 Standard Edition</ulink>, バージョン 1.5 以降のバージョンと互換性のあるランタイム環境が必要です。&FindBugs; は、プラットフォーム非依存であり、 GNU/Linux 、 Windows 、 MacOS X プラットフォーム上で動作することが知られています。</para>
64
65 <para>&FindBugs; を使用するためには、少なくとも 512 MB のメモリが必要です。巨大なプロジェクトを解析するためには、それより多くのメモリが必要とされることがあります。</para>
66 </sect1>
67
68 </chapter>
69
70 <!--
71 **************************************************************************
72 Installing FindBugs
73 **************************************************************************
74 -->
75
76 <chapter id="installing">
77 <title>&FindBugs;&trade; のインストール</title>
78
79 <para>この章では、 &FindBugs; のインストール方法を説明します。</para>
80
81 <sect1>
82 <title>配布物の展開</title>
83
84 <para>&FindBugs; をインストールする最も簡単な方法は、バイナリ配布物をダウンロードすることです。 バイナリ配布物は、 <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.tar.gz?download">gzipped tar 形式</ulink> および <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.zip?download">zip 形式</ulink> がそれぞれ入手可能です。バイナリ配布物をダウンロードしてきたら、それを任意のディレクトリーに展開します。</para>
85
86 <para>gzipped tar 形式配布物の展開方法例:<screen>
87 <prompt>$ </prompt><command>gunzip -c findbugs-2.0.3.tar.gz | tar xvf -</command>
88 </screen>
89 </para>
90
91 <para>zip 形式配布物の展開方法例:<screen>
92 <prompt>C:\Software&gt;</prompt><command>unzip findbugs-2.0.3.zip</command>
93 </screen>
94 </para>
95
96 <para>バイナリ配布物の展開すると、通常は <filename class="directory">findbugs-2.0.3</filename> ディレクトリーが作成されます。例えば、ディレクトリー <filename class="directory">C:\Software</filename> でバイナリ配布物を展開すると、ディレクトリー <filename class="directory">C:\Software\findbugs-2.0.3</filename> に &FindBugs; は展開されます。このディレクトリーが &FindBugs; のホームディレクトリーになります。このマニュアルでは、このホームディレクトリーを &FBHome; (Windowsでは &FBHomeWin;) を用いて参照します。</para>
97 </sect1>
98
99 </chapter>
100
101 <!--
102 **************************************************************************
103 Compiling FindBugs from Source
104 **************************************************************************
105 -->
106
107 <chapter id="building">
108 <title>&FindBugs;&trade; のソールからのビルド</title>
109
110 <para>この章では、 &FindBugs; をソースコードからビルドする方法を説明します。&FindBugs; を修正することに興味がないのであれば、 <link linkend="running">次の章</link> に進んでください。</para>
111
112 <sect1>
113 <title>前提条件</title>
114
115 <para>ソースから &FindBugs; をコンパイルするためには、以下のものが必要です。<itemizedlist>
116 <listitem>
117 <para><ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3-source.zip?download">&FindBugs; のソース配布物</ulink>
118 </para>
119 </listitem>
120 <listitem>
121 <para>
122 <ulink url="http://java.sun.com/j2se/">JDK 1.5.0 ベータ またはそれ以降</ulink>
123 </para>
124 </listitem>
125 <listitem>
126 <para>
127 <ulink url="http://ant.apache.org/">Apache &Ant;</ulink>, バージョン 1.6.3 またはそれ以降</para>
128 </listitem>
129 </itemizedlist>
130 </para>
131
132 <warning>
133 <para>Redhat Linux システムの <filename>/usr/bin/ant</filename> に同梱されている &Ant; のバージョンでは、 &FindBugs; のコンパイルは<emphasis>うまくできません</emphasis>。<ulink url="http://ant.apache.org/">&Ant; web サイト</ulink>からバイナリ配布物をダウンロードしてインストールすることを推奨します。&Ant; を実行する場合は、 環境変数 <replaceable>JAVA_HOME</replaceable> が JDK 1.5 (またはそれ以降)をインストールしたディレクトリーを指していることを確認してください。</para>
134 </warning>
135
136 <para>体裁の整った &FindBugs; のドキュメントを生成したい場合は、以下のソフトウェアも必要となります:<itemizedlist>
137 <listitem>
138 <para><ulink url="http://docbook.sourceforge.net/projects/xsl/index.html">DocBook XSL スタイルシート</ulink>。&FindBugs; のマニュアルを HTML に変換するのに必要です。</para>
139 </listitem>
140 <listitem>
141 <para><ulink url="http://saxon.sourceforge.net/">&Saxon; XSLT プロセッサー</ulink>。(同様に、 &FindBugs; のマニュアルを HTML に変換するのに必要です。)</para>
142 </listitem>
143 <!--
144 <listitem>
145 <para>
146 </para>
147 </listitem>
148 -->
149 </itemizedlist>
150 </para>
151
152 </sect1>
153
154 <sect1>
155 <title>ソース配布物の展開</title>
156 <para>ソース配布物をダウンロードした後に、それを作業用ディレクトリーに展開する必要があります。通常は、次のようなコマンドで展開を行います:<screen>
157 <prompt>$ </prompt><command>unzip findbugs-2.0.3-source.zip</command>
158 </screen>
159
160 </para>
161 </sect1>
162
163 <sect1>
164 <title><filename>local.properties</filename> の修正</title>
165 <para>FindBugs のドキュメントをビルドするためには、 <filename>local.properties</filename> ファイルを修正する必要があります。このファイルは、 &FindBugs; をビルドする際に <ulink url="http://ant.apache.org/">&Ant;</ulink> <filename>build.xml</filename> ファイルが参照します。FindBugs のドキュメントをビルドしない場合は、このファイルは無視してもかまいません。</para>
166
167 <para><filename>local.properties</filename> での定義は、 <filename>build.properties</filename> ファイルでの定義に優先します。<filename>build.properties</filename> は次のような内容です:<programlisting>
168 <![CDATA[
169 # User Configuration:
170 # This section must be modified to reflect your system.
171
172 local.software.home =/export/home/daveho/linux
173
174 # Set this to the directory containing the DocBook Modular XSL Stylesheets
175 # from http://docbook.sourceforge.net/projects/xsl/
176
177 xsl.stylesheet.home =${local.software.home}/docbook/docbook-xsl-1.71.1
178
179 # Set this to the directory where Saxon (http://saxon.sourceforge.net/)
180 # is installed.
181
182 saxon.home =${local.software.home}/java/saxon-6.5.5
183 ]]>
184 </programlisting>
185 </para>
186
187 <para><varname>xsl.stylesheet.home</varname> プロパティーには、<ulink url="http://docbook.sourceforge.net/projects/xsl/">DocBook Modular XSL スタイルシート</ulink>がインストールしてあるディレクトリーの絶対パスを指定します。&FindBugs; ドキュメントを生成しようと考えている場合にのみ、このプロパティーを指定する必要があります。</para>
188
189 <para><varname>saxon.home</varname> プロパティーには、<ulink url="http://saxon.sourceforge.net/">&Saxon; XSLT プロセッサー</ulink>がインストールしてあるディレクトリーの絶対パスを指定します。&FindBugs; ドキュメントを生成しようと考えている場合にのみ、このプロパティーを指定する必要があります。</para>
190
191 </sect1>
192
193 <sect1>
194 <title>&Ant; の実行</title>
195
196 <para>ソース配布物の展開、 &Ant; のインストール、<filename>build.properties</filename>(<filename>local.properties</filename>) の修正 (これは任意) およびツール (&Saxon; など)の環境構築ができれば、 &FindBugs; をビルドするための準備は完了です。&Ant; の起動する方法は、単にコマンドを実行するだけです。<screen>
197 <prompt>$ </prompt><command>ant <replaceable>target</replaceable></command>
198 </screen><replaceable>target</replaceable> には以下のいずれかを指定します: <variablelist> <varlistentry> <term><command>build</command></term>
199 <listitem>
200 <para>このターゲットは、 &FindBugs; のコードをコンパイルします。これは、デフォルトのターゲットです。</para>
201 </listitem>
202 </varlistentry>
203
204 <varlistentry>
205 <term><command>docs</command></term>
206 <listitem>
207 <para>このターゲットは、ドキュメントの整形を行います(また、副作用としていくつかのソースのコンパイルも行います。)</para>
208 </listitem>
209 </varlistentry>
210
211 <varlistentry>
212 <term><command>runjunit</command></term>
213 <listitem>
214 <para>このターゲットは、コンパイルを行い &FindBugs; が持っている JUnit テストを実行します。ユニットテストが失敗した場合は、エラーメッセージが表示されます。</para>
215 </listitem>
216 </varlistentry>
217
218 <varlistentry>
219 <term><command>bindist</command></term>
220 <listitem>
221 <para>&FindBugs; のバイナリ配布物を構築します。このターゲットは、 <filename>.zip</filename> および <filename>.tar.gz</filename> のアーカイブをそれぞれ作成します。</para>
222 </listitem>
223 </varlistentry>
224 </variablelist>
225 </para>
226
227 <para>&Ant; コマンドの実行後、次のような出力が表示されるはずです。 (この前に &Ant; が実行したタスクに関するメッセージもいくらか出力されます。):<screen>
228 <computeroutput>
229 BUILD SUCCESSFUL
230 Total time: 17 seconds
231 </computeroutput>
232 </screen>
233 </para>
234
235 </sect1>
236
237 <sect1>
238 <title>ソースディレクトリーからの &FindBugs;&trade; の実行</title>
239 <para><command>build</command> ターゲットの実行が終了すると、バイナリ配布物と同様の状態が作業ディレクトリーに構築されるように &FindBugs; の&Ant; ビルドスクリプトは記述されています。したがって、<xref linkend="running"/> の &FindBugs; の実行に関する情報はソース配布物の場合にも応用できます。</para>
240 </sect1>
241
242 </chapter>
243
244
245 <!--
246 **************************************************************************
247 Running FindBugs
248 **************************************************************************
249 -->
250
251 <chapter id="running">
252 <title>&FindBugs;&trade; の実行</title>
253
254 <para>&FindBugs; には2つのユーザーインタフェースがあります。すなわち、グラフィカルユーザーインタフェース (GUI) および コマンドラインインタフェースです。この章では、それぞれのインタフェースの実行方法について説明します。</para>
255
256 <warning>
257 <para>この章は、現在書き直し中です。書き直しはまだ完了していません。</para>
258 </warning>
259
260 <!--
261 <sect1>
262 <title>Executing the &FindBugs;&trade; GUI</title>
263 </sect1>
264 -->
265
266 <sect1>
267 <title>クイック・スタート</title>
268 <para>Windows システムで &FindBugs; を起動する場合は、 <filename>&FBHomeWin;\lib\findbugs.jar</filename> ファイルをダブルクリックしてください。 &FindBugs; GUI が起動します。</para>
269
270 <para>Unix 、 Linux または Mac OS X システムの場合は、<filename>&FBHome;/bin/findbugs</filename> スクリプトを実行するか、以下のコマンドを実行します。<screen>
271 <command>java -jar &FBHome;/lib/findbugs.jar</command></screen>これで、 &FindBugs; GUI が起動します。</para>
272
273 <para>GUI の使用方法については、 <xref linkend="gui"/> を参照してください。</para>
274 </sect1>
275
276 <sect1>
277
278 <title>&FindBugs; の起動</title>
279
280 <para>このセクションでは、 &FindBugs; の起動方法を説明します。&FindBugs; を起動するには2つの方法があります。すなわち、直接起動する方法、および、ラップしているスクリプトを使用する方法です。</para>
281
282
283 <sect2 id="directInvocation">
284 <title>&FindBugs; の直接起動</title>
285
286 <para>最初に述べる &FindBugs; の起動方法は、 <filename>&FBHome;/lib/findbugs.jar</filename> を直接実行する方法です。JVM (<command>java</command>) 実行プログラムの <command>-jar</command> コマンドラインスイッチを使用します。(&FindBugs;のバージョンが 1.3.5 より前の場合は、ラップしているスクリプトを使用する必要があります。)</para>
287
288 <para>&FindBugs; を直接起動するための、一般的な構文は以下のようになります。<screen>
289 <command>java <replaceable>[JVM 引数]</replaceable> -jar &FBHome;/lib/findbugs.jar <replaceable>オプション…</replaceable></command>
290 </screen>
291 </para>
292
293 <!--
294 <para>
295 By default, executing <filename>findbugs.jar</filename> runs the
296 &FindBugs; graphical user interface (GUI). On windows systems,
297 you can double-click on <filename>findbugs.jar</filename> to launch
298 the GUI. From a command line, the command
299 <screen>
300 java -jar <replaceable>&FBHome;</replaceable>/lib/findbugs.jar</screen>
301 will launch the GUI.
302 </para>
303 -->
304
305 <sect3 id="chooseUI">
306 <title> ユーザーインタフェースの選択</title>
307
308 <para>1 番目のコマンドラインオプションは、起動する &FindBugs; ユーザーインタフェースを選択するためのものです。指定可能な値は次の通りです:</para>
309 <itemizedlist>
310 <listitem>
311 <para>
312 <command>-gui</command>: グラフィカルユーザーインタフェース (GUI) を起動します。</para>
313 </listitem>
314
315 <listitem>
316 <para>
317 <command>-textui</command>: コマンドラインインタフェースを起動します。</para>
318 </listitem>
319
320 <listitem>
321 <para>
322 <command>-version</command>: &FindBugs; のバージョン番号を表示します。</para>
323 </listitem>
324
325 <listitem>
326 <para>
327 <command>-help</command>: &FindBugs; コマンドラインインタフェースのヘルプ情報を表示します。</para>
328 </listitem>
329
330 <listitem>
331 <para>
332 <command>-gui1</command>: 最初に作成された &FindBugs; グラフィカルユーザーインタフェース(すでに廃止されサポートされていない)を起動します。</para>
333 </listitem>
334 </itemizedlist>
335
336 </sect3>
337
338 <sect3 id="jvmArgs">
339 <title>Java 仮想マシン (JVM) 引数</title>
340
341 <para>&FindBugs; を起動する際に有用な Java 仮想マシン 引数をいくつか紹介します。</para>
342
343 <variablelist>
344 <varlistentry>
345 <term><command>-Xmx<replaceable>NN</replaceable>m</command></term>
346 <listitem>
347 <para>Java ヒープサイズの最大値を <replaceable>NN</replaceable> メガバイトに設定します。&FindBugs; は一般的に大容量のメモリサイズを必要とします。大きなプロジェクトでは、 1500 メガバイトを使用することも珍しくありません。</para>
348 </listitem>
349 </varlistentry>
350
351 <varlistentry>
352 <term><command>-D<replaceable>name</replaceable>=<replaceable>value</replaceable></command></term>
353 <listitem>
354 <para>Java システムプロパティーを設定します。例えば、引数 <command>-Duser.language=ja</command> を使用すると GUI 文言が日本語で表示されます。</para>
355 </listitem>
356 </varlistentry>
357
358 <!--
359 <varlistentry>
360 <term></term>
361 <listitem>
362 <para>
363 </para>
364 </listitem>
365 </varlistentry>
366 -->
367 </variablelist>
368 </sect3>
369
370 </sect2>
371
372 <sect2 id="wrapperScript">
373 <title>ラップしているスクリプトを使用した &FindBugs; の起動</title>
374
375 <para>&FindBugs; を起動するもうひとつの方法は、ラップしているスクリプトを使用する方法です。</para>
376
377 <para>Unix 系のシステムにおいては、次のようなコマンドでラップしているスクリプトを起動します :<screen>
378 <prompt>$ </prompt><command>&FBHome;/bin/findbugs <replaceable>オプション…</replaceable></command>
379 </screen>
380 </para>
381
382 <para>Windows システムにおいては、ラップしているスクリプトを起動するコマンドは次のようになります。<screen>
383 <prompt>C:\My Directory&gt;</prompt><command>&FBHomeWin;\bin\findbugs.bat <replaceable>オプション…</replaceable></command>
384 </screen>
385 </para>
386
387 <para>Unix 系システム および Windows システムのどちらにおいても、ディレクトリー <filename><replaceable>$FINDBUGS_HOME</replaceable>/bin</filename> を環境変数 <filename>PATH</filename> に追加するだけで、 <command>findbugs</command> コマンドを使用して FindBugs を起動することができます。</para>
388
389 <sect3 id="wrapperOptions">
390 <title>ラップしているスクリプトのコマンドラインオプション</title>
391 <para>&FindBugs; のラップしているスクリプトは、次のようなコマンドラインオプションをサポートしています。これらのコマンドラインオプションは &FindBugs; プログラム 自体が操作するのでは<emphasis>なく</emphasis>、どちらかといえば、ラップしているスクリプトの方が処理を行います。</para>
392 <variablelist>
393 <varlistentry>
394 <term><command>-jvmArgs <replaceable>引数</replaceable></command></term>
395 <listitem>
396 <para>JVM に受け渡される引数を指定します。例えば、次のような JVM プロパティが設定できます:<screen>
397 <prompt>$ </prompt><command>findbugs -textui -jvmArgs &quot;-Duser.language=ja&quot; <replaceable>myApp.jar</replaceable></command>
398 </screen>
399 </para>
400 </listitem>
401 </varlistentry>
402
403 <varlistentry>
404 <term><command>-javahome <replaceable>ディレクトリー</replaceable></command></term>
405 <listitem>
406 <para>&FindBugs; の実行に使用する JRE (Java ランタイム環境) がインストールされているディレクトリーを指定します。</para>
407 </listitem>
408 </varlistentry>
409
410 <varlistentry>
411 <term><command>-maxHeap <replaceable>サイズ</replaceable></command></term>
412 <listitem>
413 <para>Java ヒープサイズの最大値をメガバイト単位で指定します。デフォルトは、 256 です。巨大なプログラムやライブラリを分析するには、もっと大きなメモリー容量が必要になる可能性があります。</para>
414 </listitem>
415 </varlistentry>
416
417 <varlistentry>
418 <term><command>-debug</command></term>
419 <listitem>
420 <para>ディテクタ実行およびクラス分析のトレース情報が標準出力に出力されます。分析が予期せず失敗した際の、トラブルシューティングに有用です。</para>
421 </listitem>
422 </varlistentry>
423
424 <varlistentry>
425 <term><command>-property</command> <replaceable>name=value</replaceable></term>
426 <listitem>
427 <para>このオプションを使用してシステムプロパティーを設定することができます。 &FindBugs; はシステムプロパティーを使用して分析特性の設定を行います。<xref linkend="analysisprops"/> を参照してください。このオプションを複数指定して、複数のシステムプロパティを設定することが可能です。注: Windows の多くのバージョンでは、 <replaceable>name=value</replaceable> 文字列を引用符で囲む必要があります。</para>
428 </listitem>
429 </varlistentry>
430
431 </variablelist>
432
433 </sect3>
434
435 </sect2>
436
437 </sect1>
438
439 <sect1 id="commandLineOptions">
440 <title>コマンドラインオプション</title>
441
442 <!--
443 <para>
444
445 There are two ways to invoke &FindBugs;. The first invokes the the Graphical User Interface (GUI):
446
447 <screen>
448 <prompt>$ </prompt><command>findbugs <replaceable>[standard options]</replaceable> <replaceable>[GUI options]</replaceable></command>
449 </screen>
450
451 The second invokes the Command Line Interface (Text UI):
452
453 <screen>
454 <prompt>$ </prompt><command>findbugs -textui <replaceable>[standard options]</replaceable> <replaceable>[Text UI options]</replaceable></command>
455 </screen>
456 </para>
457 -->
458
459 <para>このセクションでは、 &FindBugs; がサポートするコマンドラインオプションについて説明します。ここで示すコマンドラインオプションは、 &FindBugs; 直接起動、または、ラップしているスクリプトによる起動で使用できます。</para>
460
461 <sect2>
462 <title>共通のコマンドラインオプション</title>
463
464 <para>ここで示すオプションは、 GUI および コマンドラインインタフェースの両方で使用できます。</para>
465
466 <variablelist>
467
468 <varlistentry>
469 <term><command>-effort:min</command></term>
470 <listitem>
471 <para>このオプションを指定すると、精度を上げるために大量のメモリーを消費する分析が無効になります。&FindBugs; の実行時にメモリー不足になったり、分析を完了するまでに異常に長い時間がかかる場合に試してみてください。</para>
472 </listitem>
473 </varlistentry>
474
475
476 <varlistentry>
477 <term><command>-effort:max</command></term>
478 <listitem>
479 <para>精度が高く、より多くのバグを検出する分析を有効にします。ただし、多くのメモリー容量を必要とし、また、完了までの時間が多くかかる可能性があります。</para>
480 </listitem>
481 </varlistentry>
482
483 <varlistentry>
484 <term><command>-project</command> <replaceable>project</replaceable></term>
485 <listitem>
486 <para>分析するプロジェクトを指定します。指定するプロジェクトファイルには、 GUI を使って作成したものを使用してください。ファイルの拡張子は、一般的には <filename>.fb</filename> または <filename>.fbp</filename> です。</para>
487 </listitem>
488 </varlistentry>
489
490 <!--
491 <varlistentry>
492 <term><command></command></term>
493 <listitem>
494 <para>
495
496 </para>
497 </listitem>
498 </varlistentry>
499 -->
500
501 </variablelist>
502
503 </sect2>
504
505 <sect2>
506 <title>GUI オプション</title>
507
508 <para>ここで示すオプションは、グラフィカルユーザーインタフェースでのみ使用できます。<variablelist> <varlistentry> <term><command>-look:</command><replaceable>plastic|gtk|native</replaceable></term>
509 <listitem>
510 <para>Swing のルック・アンド・フィールを設定します。</para>
511 </listitem>
512 </varlistentry>
513
514 </variablelist>
515 </para>
516 </sect2>
517
518 <sect2>
519 <title>テキストユーザーインタフェースオプション</title>
520
521 <para>ここで示すオプションは、テキストユーザーインタフェースでのみ使用できます。</para>
522
523 <variablelist>
524 <varlistentry>
525 <term><command>-sortByClass</command></term>
526 <listitem>
527 <para>報告されるバグ検索結果をクラス名でソートします。</para>
528 </listitem>
529 </varlistentry>
530
531 <varlistentry>
532 <term><command>-include</command> <replaceable>filterFile.xml</replaceable></term>
533 <listitem>
534 <para><replaceable>filterFile.xml</replaceable> で指定したフィルターに一致したバグ検索結果のみ報告されます。<xref linkend="filter"/> を参照してください。</para>
535 </listitem>
536 </varlistentry>
537
538 <varlistentry>
539 <term><command>-exclude</command> <replaceable>filterFile.xml</replaceable></term>
540 <listitem>
541 <para><replaceable>filterFile.xml</replaceable> で指定したフィルターに一致したバグ検索結果は報告されません。<xref linkend="filter"/> を参照してください。</para>
542 </listitem>
543 </varlistentry>
544
545 <varlistentry>
546 <term><command>-onlyAnalyze</command> <replaceable>com.foobar.MyClass,com.foobar.mypkg.*</replaceable></term>
547 <listitem>
548 <para>コンマ区切りで指定したクラスおよびパッケージのみに限定して、バグ検出の分析を行うようにします。フィルターと違って、このオプションを使うと一致しないクラスおよびパッケージに対する分析の実行を回避することができます。大きなプロジェクトにおいて、このオプションを活用すると分析にかかる時間を大きく削減することができる可能性があります。(しかしながら、アプリケーションの全体で実行していないために不正確な結果を出してしまうディテクタがある可能性もあります。) クラスはパッケージも含んだ完全な名前を指定する必要があります。また、パッケージは、 Java の <literal>import</literal> 文でパッケージ下のすべてのクラスをインポートするときと同じ方法で指定します。 (すなわち、パッケージの完全な名前に <literal>.*</literal> を付け加えた形です。)<literal>.*</literal> の代わりに <literal>.-</literal> を指定すると、サブパッケージも含めてすべてが分析されます。</para>
549 </listitem>
550 </varlistentry>
551
552 <varlistentry>
553 <term><command>-low</command></term>
554 <listitem>
555 <para>すべてのバグが報告されます。</para>
556 </listitem>
557 </varlistentry>
558
559 <varlistentry>
560 <term><command>-medium</command></term>
561 <listitem>
562 <para>優先度 (中) および優先度 (高) のバグが報告されます。これは、デフォルトの設定値です。</para>
563 </listitem>
564 </varlistentry>
565
566 <varlistentry>
567 <term><command>-high</command></term>
568 <listitem>
569 <para>優先度 (高) のバグのみが報告されます。</para>
570 </listitem>
571 </varlistentry>
572
573 <varlistentry>
574 <term><command>-relaxed</command></term>
575 <listitem>
576 <para>手抜き報告モードです。このオプションを指定すると、多くのディテクタにおいて 誤検出を回避するためのヒューリスティック機能が抑止されます。</para>
577 </listitem>
578 </varlistentry>
579
580 <varlistentry>
581 <term><command>-xml</command></term>
582 <listitem>
583 <para>バグ報告が XML で作成されます。作成された XML データは 、後で GUI で見ることができます。このオプションは <command>-xml:withMessages</command> と指定することもできます。こうすると 出力 XML には 各バグに関して人間に読むことができるメッセージが含まれるようになります。このオプションで作成された XML ファイルは 報告書に変換するのが簡単です。</para>
584 </listitem>
585 </varlistentry>
586
587 <varlistentry>
588 <term><command>-html</command></term>
589 <listitem>
590 <para>HTML 出力が生成されます。デフォルトでは &FindBugs; は <filename>default.xsl</filename> <ulink url="http://www.w3.org/TR/xslt">XSLT</ulink> スタイルシートを使用して HTML 出力を生成します: このファイルは、 <filename>findbugs.jar</filename> の中、または、 &FindBugs; のソース配布物もしくはバイナリ配布物の中にあります。このオプションには、次のようなバリエーションも存在します。すなわち、 <command>-html:plain.xsl</command> 、 <command>-html:fancy.xsl</command> および <command>-html:fancy-hist.xsl</command> です。<filename>plain.xsl</filename> スタイルシートは Javascript や DOM を利用しません。したがって、古いWeb ブラウザ使用時や印刷時にも比較的うまく表示されるでしょう。<filename>fancy.xsl</filename> スタイルシートは DOM と Javascript を利用してナビゲーションを行います。また、ビジュアル表示に CSS を使用します。<command>fancy-hist.xsl</command> は <command>fancy.xsl</command> スタイルシートを更に進化させたものです。DOM や Javascript をふんだんに駆使して、バグの一覧を動的にフィルタリングします。</para>
591
592 <para>ユーザー自身の XSLT スタイルシートを用いて HTML への変換を行いたい場合は、 <command>-html:<replaceable>myStylesheet.xsl</replaceable></command> のように指定してください。ここで、 <replaceable>myStylesheet.xsl</replaceable> はユーザーが使用したいスタイルシートのファイル名です。</para>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry>
597 <term><command>-emacs</command></term>
598 <listitem>
599 <para>バグ報告が Emacs 形式で作成されます。</para>
600 </listitem>
601 </varlistentry>
602
603 <varlistentry>
604 <term><command>-xdocs</command></term>
605 <listitem>
606 <para>バグ報告が xdoc XML 形式で作成されます。Apache Mavenで使用できます。</para>
607 </listitem>
608 </varlistentry>
609
610 <varlistentry>
611 <term><command>-output</command> <replaceable>ファイル名</replaceable></term>
612 <listitem>
613 <para>指定したファイルに出力結果が作成されます。</para>
614 </listitem>
615 </varlistentry>
616
617 <varlistentry>
618 <term><command>-outputFile</command> <replaceable>ファイル名</replaceable></term>
619 <listitem>
620 <para>この引数は、使用すべきではありません。代わりに、 <command>-output</command> を使用してください。</para>
621 </listitem>
622 </varlistentry>
623
624 <varlistentry>
625 <term><command>-nested</command><replaceable>[:true|false]</replaceable></term>
626 <listitem>
627 <para>このオプションは、ファイルやディレクトリーの中で入れ子になった jar および zip ファイルを分析するかどうかを指定します。デフォルトでは、入れ子になった jar および zip ファイルも分析します。入れ子になった jar および zip ファイルの分析するを無効にする場合は、 <command>-nested:false</command> をコマンドライン引数に追加してください。</para>
628 </listitem>
629 </varlistentry>
630
631 <varlistentry>
632 <term><command>-auxclasspath</command> <replaceable>クラスパス</replaceable></term>
633 <listitem>
634 <para>分析時に使用する補助クラスパスを設定します。分析するプログラムで使用するjarファイルやクラスディレクトリーをすべて指定してください。補助クラスパスに指定したクラスは分析の対象にはなりません。</para>
635 </listitem>
636 </varlistentry>
637
638 <!--
639 <varlistentry>
640 <term><command></command> <replaceable></replaceable></term>
641 <listitem>
642 <para>
643 </para>
644 </listitem>
645 </varlistentry>
646 -->
647
648 </variablelist>
649
650 </sect2>
651 </sect1>
652
653
654 </chapter>
655
656 <chapter id="gui">
657 <title>&FindBugs; GUI の使用方法</title>
658
659 <para>この章では、&FindBugs; グラフィカルユーザーインタフェース (GUI) の使用方法を説明します。</para>
660
661 <sect1>
662 <title>プロジェクトの作成</title>
663 <para><command>findbugs</command> コマンドで &FindBugs; を起動してから、メニューで <menuchoice><guimenu>File</guimenu><guimenuitem>New Project</guimenuitem></menuchoice> を選択してください。そうすると、次のようなダイアログが表示されます:<mediaobject>
664 <imageobject>
665 <imagedata fileref="project-dialog.png"/>
666 </imageobject>
667 </mediaobject>
668 </para>
669
670 <para>「Class archives and directories to analyze」テキストフィールドの横にある 「Add」ボタンを押すと、バグを分析する java クラスを含んでいる Java アーカイブファイル (zip, jar, ear, or war file) を選択して指定できます。複数の アーカイブ/ディレクトリーを追加することが可能です。</para>
671
672 <para>また、分析を行う Java アーカイブのソースコードを含んだソースディレクトリーを指定することもできます。そうすると、バグの可能性があるソースコードの場所が、&FindBugs; 上でハイライトして表示されます。ソースディレクトリーは、Java パッケージ階層のルートディレクトリーを指定する必要があります。例えば、ユーザのアプリケーションが <varname>org.foobar.myapp</varname> パッケージの中にある場合は、 <filename class="directory">org</filename> ディレクトリーの親ディレクトリーをソースディレクトリーリストに指定する必要があります。</para>
673
674 <para>もうひとつ、任意指定の手順があります。それは、補助用の Jar ファイルおよびディレクトリーを 「Auxiliary classpath locations」のエントリーに追加することです。分析するアーカイブ/ディレクトリーにも標準の実行時クラスパスにも含まれていないクラスを、分析するアーカイブ/ディレクトリーが参照している場合は、この項目を設定した方がいいでしょう。クラス階層に関する情報を使用するバグディテクタが、 &FindBugs; にはいくつかあります。したがって、&FindBugs; が分析を行うクラスの完全なクラス階層を参照できれば、より正確な分析結果を取得することができます。</para>
675
676 </sect1>
677
678 <sect1>
679 <title>分析の実行</title>
680 <para>アーカイブ、ディレクトリーおよびソースディレクトリーの指定ができれば、「Finish」ボタンを押して Jar ファイルに含まれるクラスに対する分析を実行します。巨大なプロジェクトを古いコンピュータ上で実行すると、かなりの時間(数十分)がかかることに注意してください。大容量メモリである最近のコンピュータなら、大きなプログラムであっても数分程度で分析できます。</para>
681 </sect1>
682
683 <sect1>
684 <title>結果の閲覧</title>
685
686 <para>分析が完了すると、次のような画面が表示されます :<mediaobject>
687 <imageobject>
688 <imagedata fileref="example-details.png"/>
689 </imageobject>
690 </mediaobject>
691 </para>
692
693 <para>左上のペインにはバグ階層ツリーが表示されます。これは、分析でみつかったバグの検索結果が階層的に表示されたものです。</para>
694
695 <para>上部のペインでバグ検索結果を選択すると、下部の「Details」ペインにバグの詳細説明が表示されます。更に、ソースがみつかれば、右上のソースコードペインにバグの出現箇所に該当するソースコードが表示されます。上図の例で表示されているバグは、ストリームオブジェクトがクローズされていないというものです。ソースコード・ウィンドウにおいて当該ストリームオブジェクトを生成している行がハイライトされています。</para>
696
697 <para>バグの検索結果に対してテキストで注釈を入れることができます。階層ツリー図のすぐ下にあるテキストボックスに注釈を入力してください。記録しておきたい情報を何でも自由に入力することができます。バグ結果ファイルの保存および読み込みを行ったときに、注釈も保存されます。</para>
698
699 </sect1>
700
701 <sect1>
702 <title>保存と読み込み</title>
703
704 <para>メニュー項目から <menuchoice><guimenu>File</guimenu><guimenuitem>Save as...</guimenuitem></menuchoice> を選択すると、ユーザーの作業結果を保存することができます。「Save as...」ダイアログにあるドロップダウン・リストの中から「FindBugs analysis results (.xml)」を選択ことで、ユーザーが指定した jar ファイルリストやバグ検索結果などの作業結果を保存することができます。また、jar ファイルリストのみを保存する選択肢 (「FindBugs project file (.fbp)」) やバグ検索結果のみを保存する選択肢 (「FindBugs analysis file (.fba)」) もあります。保存したファイルは、メニュー項目から <menuchoice><guimenu>File</guimenu><guimenuitem>Open...</guimenuitem></menuchoice> を選択することで、読み込むことができます。</para>
705
706 </sect1>
707
708 <!--
709 <sect1 id="textui">
710 <title>Using the &FindBugs;&trade; Command Line Interface</title>
711
712 <para>
713 The &FindBugs; Command Line Interface (or Text UI) can be used to
714 analyze an application for bugs non-interactively. Each bug instance will be
715 reported on a single line. All output is written to the standard output file descriptor.
716 <xref linkend="filter" /> explains how bug reports may be filtered in order
717 to get only the output you're interested in.
718 </para>
719
720 <para>
721 See <xref linkend="commandLineOptions" /> for a description of how to invoke the
722 Command Line Interface.
723 </para>
724 </sect1>
725 -->
726
727 </chapter>
728
729 <!--
730 **************************************************************************
731 Using the FindBugs Ant task
732 **************************************************************************
733 -->
734
735 <chapter id="anttask">
736 <title>&FindBugs;&trade; &Ant; タスクの使用方法</title>
737
738 <para>この章では、 &FindBugs; を <ulink url="http://ant.apache.org/">&Ant;</ulink> のビルドスクリプトに組み入れる方法について説明します。 <ulink url="http://ant.apache.org/">&Ant;</ulink> は、ビルドや配備を行うことができる Java でよく使用されるツールです。&FindBugs; &Ant; タスクを使用すると、 ビルドスクリプトを作成して機械的に &FindBugs; による Java コードの分析を実行することができます。</para>
739
740 <para>この &Ant; タスクは、 Mike Fagan 氏の多大な貢献によるものです。</para>
741
742 <sect1>
743 <title>&Ant; タスクのインストール</title>
744
745 <para>&Ant; タスクのインストールは、 <filename>&FBHome;/lib/findbugs-ant.jar</filename> を &Ant; インストールディレクトリーの<filename>lib</filename> サブディレクトリーにコピーするだけです。<note>
746 <para>使用する &Ant; タスクと &FindBugs; 本体は、同梱されていた同じバージョンのものを使用することを強く推奨します。別のバージョンの &FindBugs; に含まれていた &Ant; タスク Jar ファイルでの動作は保証しません。</para>
747 </note>
748 </para>
749
750 </sect1>
751
752 <sect1>
753 <title>build.xml の書き方</title>
754
755 <para>&FindBugs; を <filename>build.xml</filename> (&Ant; ビルドスクリプト) に組み入れるためにはまず、タスク定義を記述する必要があります。タスク定義は次のように記述します。:<screen>
756 &lt;taskdef name=&quot;findbugs&quot; classname=&quot;edu.umd.cs.findbugs.anttask.FindBugsTask&quot;/&gt;
757 </screen>タスク定義は、 <literal>findbugs</literal> 要素を <filename>build.xml</filename> 上に記述したとき、そのタスクの実行に使用されるクラスを指定します。</para>
758
759 <para>タスク定義の記述をすれば、<literal>findbugs</literal> タスクを使ってターゲットを定義できます。次に示すのは、 Apache <ulink url="http://jakarta.apache.org/bcel/">BCEL</ulink> ライブラリーを分析する場合を想定した <filename>build.xml</filename> の記述例です。<screen>
760 &lt;property name=&quot;findbugs.home&quot; value=&quot;/export/home/daveho/work/findbugs&quot; /&gt;
761
762 &lt;target name=&quot;findbugs&quot; depends=&quot;jar&quot;&gt;
763 &lt;findbugs home=&quot;${findbugs.home}&quot;
764 output=&quot;xml&quot;
765 outputFile=&quot;bcel-fb.xml&quot; &gt;
766 &lt;auxClasspath path=&quot;${basedir}/lib/Regex.jar&quot; /&gt;
767 &lt;sourcePath path=&quot;${basedir}/src/java&quot; /&gt;
768 &lt;class location=&quot;${basedir}/bin/bcel.jar&quot; /&gt;
769 &lt;/findbugs&gt;
770 &lt;/target&gt;
771 </screen><literal>findbugs</literal> 要素には、 <literal>home</literal> 属性が必須です。 &FindBugs; のインストールディレクトリーすなわち &FBHome; の値を設定します。<xref linkend="installing"/> を参照してください。</para>
772
773 <para>このターゲットは <filename>bcel.jar</filename> に対して &FindBugs; を実行します。この Jar ファイルは、 BCEL ビルドスクリプトによって作成されるものです。(上記のターゲットが「jar」ターゲットに依存している (depends) と設定することにより、 &FindBugs; が実行される前に当該ライブラリーが完全にコンパイルされていることを保証しています。) &FindBugs; の出力は、 XML 形式で <filename>bcel-fb.xml</filename> ファイルに保存されます。補助 Jar ファイル <filename>Regex.jar</filename> を aux classpath に記述しています。なぜなら、当該 Jar ファイルが BCEL メイン・ライブラリーから参照されるからです。source path を指定することで、保存されるバグデータに BCEL ソースコードへの正確な参照が記述されます。</para>
774 </sect1>
775
776 <sect1>
777 <title>タスクの実行</title>
778
779 <para>コマンドラインから &Ant; を起動する例を次に示します。前述の <literal>findbugs</literal> ターゲットを使用しています。<screen>
780 <prompt>[daveho@noir]$</prompt> <command>ant findbugs</command>
781 Buildfile: build.xml
782
783 init:
784
785 compile:
786
787 examples:
788
789 jar:
790
791 findbugs:
792 [findbugs] Running FindBugs...
793 [findbugs] Bugs were found
794 [findbugs] Output saved to bcel-fb.xml
795
796 BUILD SUCCESSFUL
797 Total time: 35 seconds
798 </screen>この事例においては、XML ファイルでバグ検索結果を保存しているので、 &FindBugs; GUI を使って結果を参照することができます。 <xref linkend="running"/> を参照してください。</para>
799
800 </sect1>
801
802 <sect1>
803 <title>パラメーター</title>
804
805 <para>このセクションでは、 &FindBugs; タスクを使用する際に、指定することができるパラメーターについて説明します。<variablelist> <varlistentry> <term><literal>class</literal></term>
806 <listitem>
807 <para>分析の対象となるクラス群を指定するためのネストされる要素です。<literal>class</literal> 要素には <literal>location</literal> 属性の指定が必須です。分析対象となるアーカイブファイル (jar, zip, 他)、ディレクトリーまたはクラスファイルの名前を記述します。1 つの <literal>findbugs</literal> 要素に対して、複数の <literal>class</literal> 子要素を指定することができます。</para>
808 </listitem>
809 </varlistentry>
810
811 <varlistentry>
812 <term><literal>auxClasspath</literal></term>
813 <listitem>
814 <para>任意指定のネストされる要素です。分析対象のライブラリーまたはアプリケーションによって使用されているが分析の対象にはしたくないクラスを含んでいるクラスパス (Jar ファイルまたはディレクトリー) を指定します。 &Ant; の Java タスクにある <literal>classpath</literal> 要素 と同じ方法で指定することができます。</para>
815 </listitem>
816 </varlistentry>
817
818 <varlistentry>
819 <term><literal>sourcePath</literal></term>
820 <listitem>
821 <para>任意指定のネストされる要素です。分析対象 Java コードのコンパイル時に使用したソースファイルを含んでいるソースディレクトリーへのパスを指定します。ソースパスを指定することにより、生成される XML のバグ出力結果に完全なソース情報をもたせることができ、後になって GUI で参照することができます。</para>
822 </listitem>
823 </varlistentry>
824
825 <varlistentry>
826 <term><literal>home</literal></term>
827 <listitem>
828 <para>必須属性です。&FindBugs; がインストールされているディレクトリー名を設定します。</para>
829 </listitem>
830 </varlistentry>
831
832 <varlistentry>
833 <term><literal>quietErrors</literal></term>
834 <listitem>
835 <para>任意指定のブール値属性です。true を設定すると、深刻な分析エラー発生やクラスがみつからないといった情報が &FindBugs; 出力に記録されません。デフォルトは、 false です。</para>
836 </listitem>
837 </varlistentry>
838
839 <varlistentry>
840 <term><literal>reportLevel</literal></term>
841 <listitem>
842 <para>任意指定の属性です。報告されるバグの優先度のしきい値を指定します。「low」に設定すると、すべてのバグが報告されます。「medium」 (デフォルト) に設定すると、優先度 (中)および優先度 (高)のバグが報告されます。「high」に設定すると、優先度 (高) のバグのみが報告されます。</para>
843 </listitem>
844 </varlistentry>
845
846 <varlistentry>
847 <term><literal>output</literal></term>
848 <listitem>
849 <para>任意指定の属性です。出力形式を指定します。「xml」 (デフォルト) に設定すると、出力は XML 形式になります。「xml:withMessages」 に設定すると、出力は人間が読めるメッセージ が追加された XML 形式になります。(XSL スタイルシートを使ってレポートを作成することを計画している場合はこの形式を使用してください。) 「html」に設定すると、出力は HTML 形式(デフォルトのスタイルシートは default.xsl) になります。 「text」に設定すると、出力は特別なテキスト形式になります。「emacs」に設定すると、出力は <ulink url="http://www.gnu.org/software/emacs/">Emacs</ulink> エラーメッセージ形式になります。「xdocs」に設定すると、出力は Apache Maven で使用できる xdoc XML になります。</para>
850 </listitem>
851 </varlistentry>
852 <varlistentry>
853 <term><literal>stylesheet</literal></term>
854 <listitem>
855 <para>任意指定の属性です。output 属性 に html を指定した場合に、 HTML 出力作成に使用されるスタイルシートを指定します。FindBugs 配布物に含まれているスタイルシートは、 default.xsl、 fancy.xsl 、 fancy-hist.xsl 、 plain.xsl および summary.xsl です。デフォルト値は default.xsl です。</para>
856 </listitem>
857 </varlistentry>
858
859 <varlistentry>
860 <term><literal>sort</literal></term>
861 <listitem>
862 <para>任意指定の属性です。<literal>output</literal> 属性に「text」を指定した場合に、バグの報告をクラス順にソートするかどうかを <literal>sort</literal> 属性で指定します。デフォルトは、 true です。</para>
863 </listitem>
864 </varlistentry>
865
866 <varlistentry>
867 <term><literal>outputFile</literal></term>
868 <listitem>
869 <para>任意指定の属性です。指定した場合、&FindBugs; の出力はその名前のファイルへと保存されます。省略時、出力は &Ant; によって直接表示されます。</para>
870 </listitem>
871 </varlistentry>
872
873 <varlistentry>
874 <term><literal>debug</literal></term>
875 <listitem>
876 <para>任意指定のブール値属性です。true に設定すると、 &FindBugs; は 診断情報を出力します。どのクラスを分析しているか、どのパグパターンディテクタが実行されているか、という情報が表示されます。デフォルトは、 false です。</para>
877 </listitem>
878 </varlistentry>
879
880 <varlistentry>
881 <term><literal>effort</literal></term>
882 <listitem>
883 <para>分析の活動レベルを設定します。<literal>min</literal> 、<literal>default</literal> または <literal>max</literal> のいずれかの値を設定してください。分析レベルの設定に関する詳細情報は、 <xref linkend="commandLineOptions"/> を参照してください。</para>
884 </listitem>
885 </varlistentry>
886
887 <varlistentry>
888 <term><literal>conserveSpace</literal></term>
889 <listitem>
890 <para>effort=&quot;min&quot; と同義です。</para>
891 </listitem>
892 </varlistentry>
893
894 <varlistentry>
895 <term><literal>workHard</literal></term>
896 <listitem>
897 <para>effort=&quot;max&quot; と同義です。</para>
898 </listitem>
899 </varlistentry>
900
901 <varlistentry>
902 <term><literal>visitors</literal></term>
903 <listitem>
904 <para>任意指定の属性です。どのバグディテクタを実行するかをコンマ区切りのリストで指定します。バグディテクタはパッケージ指定なしのクラス名で指定します。省略時、デフォルトで無効化されているものを除くすべてのディテクタが実行されます。</para>
905 </listitem>
906 </varlistentry>
907
908 <varlistentry>
909 <term><literal>omitVisitors</literal></term>
910 <listitem>
911 <para>任意指定の属性です。<literal>visitors</literal> 属性と似ていますが、こちらは <emphasis>実行されない</emphasis> ディテクタを指定します。</para>
912 </listitem>
913 </varlistentry>
914
915 <varlistentry>
916 <term><literal>excludeFilter</literal></term>
917 <listitem>
918 <para>任意指定の属性です。フィルターファイル名を指定します。報告から除外されるバグを指定します。<xref linkend="filter"/> を参照してください。</para>
919 </listitem>
920 </varlistentry>
921
922 <varlistentry>
923 <term><literal>includeFilter</literal></term>
924 <listitem>
925 <para>任意指定の属性です。フィルターファイル名を指定します。報告されるバグを指定します。<xref linkend="filter"/> を参照してください。</para>
926 </listitem>
927 </varlistentry>
928
929 <varlistentry>
930 <term><literal>projectFile</literal></term>
931 <listitem>
932 <para>任意指定の属性です。プロジェクトファイル名を指定します。プロジェクトファイルは、 &FindBugs; GUI で作成します。分析されるクラス、および、補助クラスパス、ソースディレクトリーが記入されてます。プロジェクトファイルを指定した場合は、 <literal>class</literal> 要素・ <literal>auxClasspath</literal> 属性および <literal>sourcePath</literal> 属性を設定する必要はありません。プロジェクトの作成方法は、 <xref linkend="running"/> を参照してください。</para>
933 </listitem>
934 </varlistentry>
935
936 <varlistentry>
937 <term><literal>jvmargs</literal></term>
938 <listitem>
939 <para>任意指定の属性です。&FindBugs; を実行している Java 仮想マシンに対して受け渡される引数を指定します。巨大なプログラムを分析する場合に、 JVM が使用するメモリ容量を増やす指定をするためにこの引数を利用する必要があるかもしれません。</para>
940 </listitem>
941 </varlistentry>
942
943 <varlistentry>
944 <term><literal>systemProperty</literal></term>
945 <listitem>
946 <para>任意指定のネストされる要素です。指定した場合、Java システムプロパティーを定義します。<literal>name</literal> 属性にはシステムプロパティーの名前を指定します。そして、 <literal>value</literal> 属性にはシステムプロパティの値を指定します。</para>
947 </listitem>
948 </varlistentry>
949
950 <varlistentry>
951 <term><literal>timeout</literal></term>
952 <listitem>
953 <para>任意指定の属性です。&FindBugs; を実行している Java プロセス の実行許容時間をミリ秒単位で指定します。時間を超過するとハングアップしていると判断してプロセスが終了されます。デフォルトは、 600,000 ミリ秒 (10 分) です。巨大なプログラムの場合は、 &FindBugs; が分析を完了するまでに 10 分 以上掛かる可能性があることに注意してください。</para>
954 </listitem>
955 </varlistentry>
956
957 <varlistentry>
958 <term><literal>failOnError</literal></term>
959 <listitem>
960 <para>任意指定のブール値属性です。&FindBugs; の実行中にエラーがあった場合に、ビルドプロセス自体を打ち切って異常終了させるかどうかを指定します。デフォルトは、「false」です。</para>
961 </listitem>
962 </varlistentry>
963
964 <varlistentry>
965 <term><literal>errorProperty</literal></term>
966 <listitem>
967 <para>任意指定の属性です。&FindBugs; の実行中にエラーが発生した場合に、「true」が設定されるプロパティーの名前を指定します。</para>
968 </listitem>
969 </varlistentry>
970
971 <varlistentry>
972 <term><literal>warningsProperty</literal></term>
973 <listitem>
974 <para>任意指定の属性です。&FindBugs; が分析したプログラムにバグ報告が 1 件でもある場合に、「true」が設定されるプロパティーの名前を指定します。</para>
975 </listitem>
976 </varlistentry>
977
978 </variablelist>
979
980
981 </para>
982
983 <!--
984
985 -->
986
987 </sect1>
988
989 </chapter>
990
991 <!--
992 **************************************************************************
993 Using the FindBugs Eclipse plugin
994 **************************************************************************
995 -->
996
997 <chapter id="eclipse">
998 <title>&FindBugs;&trade; Eclipse プラグインの使用方法</title>
999
1000 <para>FindBugs Eclipse プラグインを使用することによって、 &FindBugs; を <ulink url="http://www.eclipse.org/">Eclipse</ulink> IDE で使用することができるようになります。このFindBugs Eclipse プラグインは、 Peter Friese 氏の多大な貢献によるものです。Phil Crosby 氏 と Andrei Loskutov 氏は、プラグインの重要な改良に貢献しました。</para>
1001
1002 <sect1>
1003 <title>必要条件</title>
1004
1005 <para>&FindBugs; Eclipse Plugin を使用するためには、 Eclipse 3.3 あるいはそれ以降のバージョン、また、 JRE/JDK 1.5 あるいはそれ以降のバージョンが必要です。</para>
1006
1007 </sect1>
1008
1009 <sect1>
1010 <title>インストール</title>
1011
1012 <para>更新サイトが提供されています。更新サイトを利用して、機械的に FindBugs を Eclipse にインストールできます。また自動的に、最新版のアップデートを照会してインストールすることもできます。内容の異なる 3 つの更新サイトが存在します。</para>
1013
1014 <variablelist><title>FindBugs Eclipse 更新サイト一覧</title>
1015 <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse/">http://findbugs.cs.umd.edu/eclipse/</ulink></term>
1016
1017 <listitem>
1018 <para>FindBugs の公式リリース物を提供します。</para>
1019 </listitem>
1020 </varlistentry>
1021
1022 <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse-candidate/">http://findbugs.cs.umd.edu/eclips-candidate/</ulink></term>
1023
1024 <listitem>
1025 <para>FindBugsの公式リリース物に加えて、公式リリース候補版を提供します。</para>
1026 </listitem>
1027 </varlistentry>
1028
1029 <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse-daily/">http://findbugs.cs.umd.edu/eclipse-daily/</ulink></term>
1030
1031 <listitem>
1032 <para>FindBugsの日次ビルド物を提供します。コンパイルができること以上のテストは行われていません。</para>
1033 </listitem>
1034 </varlistentry>
1035 </variablelist>
1036
1037 <para>また、次に示すリンクから手動でプラグインをダウンロードすることもできます : <ulink url="http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122.zip?download">http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122.zip?download</ulink>. 展開して Eclipse の「plugins」サブディレクトリーに入れてください。(そうすると、 &lt;eclipse インストールディレクトリー &gt;/plugins/edu.umd.cs.findbugs.plugin.eclipse_2.0.3.20131122/findbugs.png が &FindBugs; のロゴファイルへのパスになるはずです。)</para>
1038
1039 <para>プラグインの展開ができたら、 Eclipse を起動して <menuchoice> <guimenu>Help</guimenu> <guimenuitem>About Eclipse Platform</guimenuitem> <guimenuitem>Plug-in Details</guimenuitem> </menuchoice> を選択してください。「FindBugs Project」から提供された「FindBugs Plug-in」というプラグインがあることを確認してください。</para>
1040 </sect1>
1041
1042 <sect1>
1043 <title>プラグインの使用方法</title>
1044
1045 <para>実行するには、 Java プロジェクト上で右クリックして「Find Bugs」を選択します。&FindBugs; が実行されて、バグパターンの実例の可能性があると識別されたコード箇所に問題マーカーがつきます。 (ソース画面および Eclipse 問題ビューに表示されます。)</para>
1046
1047 <para>Java プロジェクトのプロパティーダイアログを開いて「Findbugs」プロパティーページを選択することで、 &FindBugs; の動作をカスタマイズすることができます。選択できる項目には次のようなものがあります :</para>
1048
1049 <itemizedlist>
1050 <listitem>
1051 <para>「Run FindBugs Automatically」チェックボックスの設定。チェックすると、プロジェクト内の Java クラスが修正されるたびに FindBugs が実行されます。</para>
1052 </listitem>
1053
1054 <listitem>
1055 <para>優先度とバグカテゴリーの選択。これらのオプションは、どの警告を表示するかを選択します。例えば、優先度で 「Medium」 を選択すると、優先度 (中) および優先度 (高) の警告のみが表示されます。同様に、「Style」チェックボックスのチェックマークを外すと、Style カテゴリーに属する警告は表示されません。</para>
1056 </listitem>
1057
1058 <listitem>
1059 <para>ディテクタの選択。表からプロジェクトで有効にしたいディテクタを選択することができます。</para>
1060 </listitem>
1061 </itemizedlist>
1062
1063 </sect1>
1064
1065 <sect1>
1066 <title>トラブルシューティング</title>
1067
1068 <para>&FindBugs; Eclipse プラグインは、まだ実験段階です。このセクションでは、プラグインに関する一般的な問題と (判明していれば) それらの問題の解決方法を記述します。</para>
1069
1070 <itemizedlist>
1071 <listitem>
1072 <para>&FindBugs; 問題マーカーが (ソース画面および問題ビューに) 表示されない場合は、問題ビューのフィルター設定を変更してください。詳細情報は <ulink url="http://findbugs.sourceforge.net/FAQ.html#q7">http://findbugs.sourceforge.net/FAQ.html#q7</ulink> を参照してください。</para>
1073 </listitem>
1074
1075 </itemizedlist>
1076
1077 </sect1>
1078
1079
1080 </chapter>
1081
1082
1083 <!--
1084 **************************************************************************
1085 Filter files
1086 **************************************************************************
1087 -->
1088
1089 <chapter id="filter">
1090 <title>フィルターファイル</title>
1091
1092 <para>フィルターファイルを使用することで、特定のクラスやメソッドをバグ報告に含めたりバグ報告から除外したりすることができます。この章では、フィルターファイルの使用方法を説明します。<note>
1093 <title>計画されている機能</title>
1094 <para>フィルターは現在、コマンドラインインタフェースでのみサポートされています。最終的には、フィルターのサポートは GUI にも追加される予定です。</para>
1095 </note>
1096 </para>
1097
1098
1099 <sect1>
1100 <title>フィルターファイルの概要</title>
1101
1102 <para>概念的に言えば、フィルターはバグ検索結果をある基準と照合します。フィルターを定義することで、 特別な取り扱いをするバグ検索結果を選択することができます。例えば、あるバグ検索結果をバグ報告に含めたり、バグ報告から除外したりすることができます。</para>
1103
1104 <para>フィルターファイルは、 <ulink url="http://www.w3.org/XML/">XML</ulink> 文書です。最上位要素が <literal>FindBugsFilter</literal> 要素 であり、その子要素として <literal>Match</literal> 要素を複数個定義します。それぞれの <literal>Match</literal> 要素は、生成されたバグ検索結果に適用される述部にあたります。通常、フィルターはバグ検索結果を除外するために使用します。次に、例を示します:<screen>
1105 <prompt>$ </prompt><command>findbugs -textui -exclude <replaceable>myExcludeFilter.xml</replaceable> <replaceable>myApp.jar</replaceable></command>
1106 </screen>また一方で、的をしぼった報告を得るためにバグ報告結果を選択するためにフィルターを使用することも考えられます :<screen>
1107 <prompt>$ </prompt><command>findbugs -textui -include <replaceable>myIncludeFilter.xml</replaceable> <replaceable>myApp.jar</replaceable></command>
1108 </screen>
1109 </para>
1110
1111 <para>
1112 <literal>Match</literal> 要素は子要素を持ちます。それらの子要素は論理積で述部になります。つまり、述部が真であるためには、すべての子要素が真である必要があります。</para>
1113
1114 </sect1>
1115
1116 <sect1>
1117 <title>マッチング条件の種類</title>
1118
1119 <variablelist>
1120 <varlistentry>
1121 <term><literal>&lt;Bug&gt;</literal></term>
1122 <listitem><para>この要素は、バグパターンを指定して照合します。<literal>pattern</literal> 属性には、コンマ区切りでバグパターン類型のリストを指定します。どの警告がどのバグパターン類型にあたるかは、 <command>-xml</command> オプションをつかって出力されたもの (<literal>BugInstance</literal> 要素の <literal>type</literal> 属性) を見るか、または、 <ulink url="../../bugDescriptions.html">バグ解説ドキュメント</ulink>を参照してください。</para><para>もっと粒度の粗い照合を行いたいときは、 <literal>code</literal> 属性を使用してください。バグ略称のコンマ区切りのリストで指定できます。さらに粒度の粗い照合を行いたいときは、 <literal>category</literal> 属性を使用してください。次に示す、バグカテゴリー名のコンマ区切りのリストで指定できます : <literal>CORRECTNESS</literal>, <literal>MT_CORRECTNESS</literal>, <literal>BAD_PRACTICICE</literal>, <literal>PERFORMANCE</literal>, <literal>STYLE</literal>.</para><para>同じ <literal>&lt;Bug&gt;</literal> 要素に上記の属性を複数指定した場合は、バグパターン名、バグ略称、バグカテゴリーのいずれか1つでも該当すれば、バグパターンは合致すると判定されます。</para><para>下位互換性を持たせたい場合は、 <literal>&lt;Bug&gt;</literal> 要素の代わりに <literal>&lt;BugPattern&gt;</literal> 要素および <literal>&lt;BugCode&gt;</literal> 要素を使用してください。これらの要素はそれぞれ、 <literal>name</literal> 属性で値のリストを指定します。これらの要素は、将来サポートされなくなる可能性があります。</para></listitem>
1123 </varlistentry>
1124
1125 <varlistentry>
1126 <term><literal>&lt;Priority&gt;</literal></term>
1127 <listitem>
1128 <para>この要素は、特定の優先度をもつ警告を照合します。<literal>value</literal> 属性には、整数値を指定します : 1 は優先度(高)、また、 2 は優先度(中) 、 3 は優先度(低) を示します。</para>
1129 </listitem>
1130 </varlistentry>
1131
1132
1133 <varlistentry>
1134 <term><literal>&lt;Package&gt;</literal></term>
1135 <listitem>
1136 <para>この要素は、 <literal>name</literal> 属性で指定した特定のパッケージ内にあるクラスに関連した警告を照合します。入れ子のパッケージは含まれません (Java import 文に従っています) 。しかしながら、正規表現を使うと複数パッケージにマッチさせることは簡単にできます。</para>
1137 </listitem>
1138 </varlistentry>
1139
1140 <varlistentry>
1141 <term><literal>&lt;Class&gt;</literal></term>
1142 <listitem>
1143 <para>この要素は、特定のクラスに関連した警告を照合します。<literal>name</literal> 属性を使用して、照合するクラス名をクラス名そのものか、または、正規表現で指定します。</para>
1144
1145 <para>下位互換性を持たせたい場合は、この要素の代わりに <literal>Match</literal> 要素を使用してください。クラス名そのものの指定は <literal>class</literal> 属性を、クラス名を正規表現で指定する場合は <literal>classregex</literal> 属性をそれぞれ使用してください</para>
1146
1147 <para>もし <literal>Match</literal> 要素に <literal>Class</literal> 要素が無かったり、 <literal>class</literal> / <literal>classregex</literal> 属性が無かったりした場合は、すべてのクラスに適用されます。その場合、想定外に多くのバグ検索結果が一致してしまうことがあり得ます。その場合は、適当なメソッドやフィールドで絞り込んでください。</para>
1148 </listitem>
1149 </varlistentry>
1150
1151 <varlistentry>
1152 <term><literal>&lt;Method&gt;</literal></term>
1153
1154 <listitem><para>この要素は、メソッドを指定します。<literal>name</literal> 属性を使用して、照合するメソッド名をメソッド名そのものか、または、正規表現で指定します。<literal>params</literal> 属性には、コンマ区切りでメソッド引数の型のリストを指定します。<literal>returns</literal> 属性にはメソッドの戻り値の型を指定します。<literal>params</literal> および <literal>returns</literal> においては、クラス名は完全修飾名である必要があります。(例えば、単に &quot;String&quot; ではなく &quot;java.lang.String&quot; としてください。) <literal>params</literal> <literal>returns</literal> のどちらか一方を指定した場合は、もう一方の属性の指定も必須です。なぜならば、メソッドシグニチャーを構築のために必要だからです。<literal>name</literal> 属性、<literal>params</literal> 属性 および <literal>returns</literal> 属性または 3 つの 属性すべて、のどれかを条件とすることできることを意味しています。このように、名前とシグニチャーに基づく様々な種類の条件を規定できます。</para></listitem>
1155 </varlistentry>
1156
1157 <varlistentry>
1158 <term><literal>&lt;Field&gt;</literal></term>
1159
1160 <listitem><para>この要素は、フィールドを指定します。<literal>name</literal> 属性を使用して、照合するフィールド名をフィールド名そのものか、または、正規表現で指定します。また、フィールドのシグニチャーに照らしたフィルタリングをすることができます。 <literal>type</literal> 属性を使用して、フィールドの型を完全修飾名で指定してください。名前とシグニチャーに基づく条件を規定するために、その2つの属性を両方とも指定することができます。</para></listitem>
1161 </varlistentry>
1162
1163 <varlistentry>
1164 <term><literal>&lt;Local&gt;</literal></term>
1165
1166 <listitem><para>この要素は、ローカル変数を指定します。<literal>name</literal> 属性を使用して、照合するローカル変数名をローカル変数名そのものか、または、正規表現で指定します。ローカル変数とは、メソッド内で定義した変数です。</para></listitem>
1167 </varlistentry>
1168
1169 <varlistentry>
1170 <term><literal>&lt;Or&gt;</literal></term>
1171 <listitem><para>この要素は、論理和として <literal>Match</literal> 条項を結合します。すなわち、2つの <literal>Method</literal> 要素を <literal>Or</literal> 条項に入れることで、どちらか一方のメソッドでマッチさせることができます。</para></listitem>
1172 </varlistentry>
1173 </variablelist>
1174
1175 </sect1>
1176
1177 <sect1>
1178 <title>Java 要素名マッチング</title>
1179
1180 <para><literal>Class</literal> 、 <literal>Method</literal> または <literal>Field</literal> の <literal>name</literal> 属性が文字 ~ で始まっている場合は、属性値の残りの部分を Java の正規表現として解釈します。そうして、当該 Java 要素の名前に対しての照合が行われます。</para>
1181
1182 <para>パターンの照合は要素の名前全体に対して行われることに注意してください。そのため、部分一致照合を行いたい場合はパターン文字列の前後に .* を付加して使用する必要があります。</para>
1183
1184 <para>パターンの構文規則に関しては、 <ulink url="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/util/regex/Pattern.html"><literal>java.util.regex.Pattern</literal></ulink> のドキュメントを参照してください。</para>
1185 </sect1>
1186
1187 <sect1>
1188 <title>留意事項</title>
1189
1190 <para>
1191 <literal>Match</literal> 条項は、バグ検索結果に実際に含まれている情報にのみ一致します。すべてのバグ検索結果はクラスを持っています。したがって、一般的に言って、バグを除外するためにはクラスを用いて行うとうまくいくことが多いです。</para>
1192
1193 <para>バグ検索結果の中には、2個以上のクラスを保持しているものもあります。例えば、 DE (dropped exception : 例外の無視) バグは、 例外の無視が発生したメソッドを持っているクラスと、 無視された例外の型を表すクラスの両方を含んだ形で報告されます。<literal>Match</literal> 条項とは、 <emphasis>1番目</emphasis> (主) のクラスのみが照合されます。したがって、例えば、クラス &quot;com.foobar.A&quot; 、 &quot;com.foobar.B&quot; 間での IC (initialization circularity : 初期化時の処理循環) バグ報告を抑止したい場合、以下に示すように 2つの <literal>Match</literal> 条項を使用します :<programlisting>
1194 &lt;Match&gt;
1195 &lt;Class name=&quot;com.foobar.A&quot; /&gt;
1196 &lt;Bug code=&quot;IC&quot; /&gt;
1197 &lt;/Match&gt;
1198
1199 &lt;Match&gt;
1200 &lt;Class name=&quot;com.foobar.B&quot; /&gt;
1201 &lt;Bug code=&quot;IC&quot; /&gt;
1202 &lt;/Match&gt;
1203 </programlisting>明示的に両方のクラスで照合することによって、循環しているどちらのクラスがバグ検索結果の 1 番目になっているかに関係なく一致させることができます。(もちろんこの方法は、処理循環が &quot;com.foobar.A&quot; 、 &quot;com.foobar.B&quot; に加えて3番目のクラスも含んでいる場合は図らずも失敗してしまう恐れがあります。)</para>
1204
1205 <para>多くの種類のバグ報告は、自身が出現したメソッドを報告します。それらのバグ検索結果に対しては、 <literal>Method</literal> 条項を <literal>Match</literal> 要素に加えると期待通りの動作をするでしょう。</para>
1206
1207 </sect1>
1208
1209 <sect1>
1210 <title>例</title>
1211
1212 <para>1. 特定のクラスに対するすべてのバグ報告に一致させます。<programlisting>
1213 <![CDATA[
1214 <Match>
1215 <Class name="com.foobar.MyClass" />
1216 </Match>
1217 ]]>
1218 </programlisting>
1219
1220 </para>
1221
1222 <para>2. バグ略称を指定して、特定のクラスに対する特定の検査項目に一致させます。<programlisting>
1223 <![CDATA[
1224 <Match>
1225 <Class name="com.foobar.MyClass"/ >
1226 <Bug code="DE,UrF,SIC" />
1227 </Match>
1228 ]]>
1229 </programlisting>
1230 </para>
1231
1232 <para>3. バグ略称を指定して、すべてのクラスに対する特定の検査項目に一致させます。<programlisting>
1233 <![CDATA[
1234 <Match>
1235 <Bug code="DE,UrF,SIC" />
1236 </Match>
1237 ]]>
1238 </programlisting>
1239 </para>
1240
1241 <para>4. バグカテゴリーを指定して、すべてのクラスに対する特定の検査項目に一致させます。<programlisting>
1242 <![CDATA[
1243 <Match>
1244 <Bug category="PERFORMANCE" />
1245 </Match>
1246 ]]>
1247 </programlisting>
1248 </para>
1249
1250 <para>5. バグ略称を指定して、特定のクラスの指定されたメソッドに対する特定のバグ種別に一致させます。<programlisting>
1251 <![CDATA[
1252 <Match>
1253 <Class name="com.foobar.MyClass" />
1254 <Or>
1255 <Method name="frob" params="int,java.lang.String" returns="void" />
1256 <Method name="blat" params="" returns="boolean" />
1257 </Or>
1258 <Bug code="DC" />
1259 </Match>
1260 ]]>
1261 </programlisting>
1262 </para>
1263
1264 <para>6. 特定のメソッドに対する特定のバグパターンに一致させます。<programlisting>
1265 <![CDATA[
1266 <!-- open stream に関する誤検出があるメソッド。-->
1267 <Match>
1268 <Class name="com.foobar.MyClass" />
1269 <Method name="writeDataToFile" />
1270 <Bug pattern="OS_OPEN_STREAM" />
1271 </Match>
1272 ]]>
1273 </programlisting>
1274 </para>
1275
1276 <para>7. 特定のメソッドに対する特定の優先度を付与された特定のバグパターンに一致させます。<programlisting>
1277 <![CDATA[
1278 <!-- dead local store (優先度 (中)) に関する誤検出があるメソッド。-->
1279 <Match>
1280 <Class name="com.foobar.MyClass" />
1281 <Method name="someMethod" />
1282 <Bug pattern="DLS_DEAD_LOCAL_STORE" />
1283 <Priority value="2" />
1284 </Match>
1285 ]]>
1286 </programlisting>
1287 </para>
1288
1289 <para>8. AspectJ コンパイラーによって引き起こされるマイナーバグに一致させます (AspectJ の開発者でもない限り、それらのバグに関心を持つことはないと考えます)。<programlisting>
1290 <![CDATA[
1291 <Match>
1292 <Class name="~.*\$AjcClosure\d+" />
1293 <Bug pattern="DLS_DEAD_LOCAL_STORE" />
1294 <Method name="run" />
1295 </Match>
1296 <Match>
1297 <Bug pattern="UUF_UNUSED_FIELD" />
1298 <Field name="~ajc\$.*" />
1299 </Match>
1300 ]]>
1301 </programlisting>
1302 </para>
1303
1304 <para>9. 基盤コードの特定の部分に対するバグに一致させます<programlisting>
1305 <![CDATA[
1306 <!-- すべてのパッケージにある Messages クラスに対する unused fields 警告に一致。 -->
1307 <Match>
1308 <Class name="~.*\.Messages" />
1309 <Bug code="UUF" />
1310 </Match>
1311 <!-- すべての internal パッケージ内の mutable statics 警告に一致。 -->
1312 <Match>
1313 <Package name="~.*\.internal" />
1314 <Bug code="MS" />
1315 </Match>
1316 <!-- ui パッケージ階層内の anonymoous inner classes 警告に一致。 -->
1317 <Match>
1318 <Package name="~com\.foobar\.fooproject\.ui.*" />
1319 <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" />
1320 </Match>
1321 ]]>
1322 </programlisting>
1323 </para>
1324
1325 <para>10. 特定のシグニチャーを持つフィールドまたはメソッドのバグに一致させます。<programlisting>
1326 <![CDATA[
1327 <!-- すべてのクラスの main(String[]) メソッドに対する System.exit(...) usage 警告に一致。 -->
1328 <Match>
1329 <Method returns="void" name="main" params="java.lang.String[]" />
1330 <Method pattern="DM_EXIT" />
1331 </Match>
1332 <!-- すべてのクラスの com.foobar.DebugInfo 型のフィールドに対する UuF 警告に一致。 -->
1333 <Match>
1334 <Field type="com.foobar.DebugInfo" />
1335 <Bug code="UuF" />
1336 </Match>
1337 ]]>
1338 </programlisting>
1339
1340 </para>
1341
1342 </sect1>
1343
1344 <sect1>
1345 <title>完全な例</title>
1346
1347 <programlisting>
1348 <![CDATA[
1349 <FindBugsFilter>
1350 <Match>
1351 <Class name="com.foobar.ClassNotToBeAnalyzed" />
1352 </Match>
1353
1354 <Match>
1355 <Class name="com.foobar.ClassWithSomeBugsMatched" />
1356 <Bug code="DE,UrF,SIC" />
1357 </Match>
1358
1359 <!-- XYZ 違反に一致。-->
1360 <Match>
1361 <Bug code="XYZ" />
1362 </Match>
1363
1364 <!-- "AnotherClass" の特定のメソッドの doublecheck 違反に一致。-->
1365 <Match>
1366 <Class name="com.foobar.AnotherClass" />
1367 <Or>
1368 <Method name="nonOverloadedMethod" />
1369 <Method name="frob" params="int,java.lang.String" returns="void" />
1370 <Method name="blat" params="" returns="boolean" />
1371 </Or>
1372 <Bug code="DC" />
1373 </Match>
1374
1375 <!-- dead local store (優先度 (中)) に関する誤検出があるメソッド。-->
1376 <Match>
1377 <Class name="com.foobar.MyClass" />
1378 <Method name="someMethod" />
1379 <Bug pattern="DLS_DEAD_LOCAL_STORE" />
1380 <Priority value="2" />
1381 </Match>
1382 </FindBugsFilter>
1383 ]]>
1384 </programlisting>
1385
1386 </sect1>
1387
1388
1389 </chapter>
1390
1391
1392 <!--
1393 **************************************************************************
1394 Analysis properties
1395 **************************************************************************
1396 -->
1397
1398 <chapter id="analysisprops">
1399 <title>分析プロパティー</title>
1400
1401 <para>&FindBugs; は分析する場合にいくつかの観点を持っています。そして、観点をカスタマイズして実行することができます。システムプロパティーを使って、それらのオプションを設定します。この章では、分析オプションの設定方法を説明します。</para>
1402
1403 <para>分析オプションの主な目的は、 2 つあります。1 番目は、 &FindBugs; に対して分析されるアプリケーションのメソッドの意味を伝えることです。そうすることで &FindBugs; がより正確な結果を出すことができ、誤検出を減らすことができます。2 番目に、分析を行うに当たりその精度を設定できるようにすることです。分析の精度を落とすことで、メモリ使用量と分析時間を減らすことができます。ただし、本当のバグを見逃したり、誤検出の数が増えるという代償があります。</para>
1404
1405 <para>コマンドラインオプション <command>-property</command> を使って、分析オプションを設定することができます。次に、例を示します:<screen>
1406 <prompt>$ </prompt><command>findbugs -textui -property &quot;cfg.noprune=true&quot; <replaceable>myApp.jar</replaceable></command>
1407 </screen>
1408 </para>
1409
1410 <para>設定することができる分析オプションの一覧を <xref linkend="analysisproptable"/> に示します。</para>
1411
1412 <table id="analysisproptable">
1413 <title>設定可能な分析プロパティー</title>
1414 <tgroup cols="3" align="left">
1415 <thead>
1416 <row>
1417 <entry>プロパティー名</entry>
1418 <entry>設定値</entry>
1419 <entry>目的</entry>
1420 </row>
1421 </thead>
1422 <tbody>
1423 <!--
1424 <row>
1425 <entry>cfg.noprune</entry>
1426 <entry>true or false</entry>
1427 <entry>If true, infeasible exception edges are not pruned from
1428 the control flow graphs of analyzed methods. This option
1429 increases the speed of the analysis (by about 20%-30%),
1430 but causes some detectors to produce more false warnings.</entry>
1431 </row>
1432 -->
1433 <row>
1434 <entry>findbugs.assertionmethods</entry>
1435 <entry>コンマ区切りの完全修飾メソッド名リスト : 例、 &quot;com.foo.MyClass.checkAssertion&quot;</entry>
1436 <entry>このプロパティーには、プログラムが正しいことをチェックするために使われるメソッドを指定します。これらのメソッドを指定することで、 チェックメソッドで確認した値に対する null 参照アクセスディテクタの誤検出を回避できます。</entry>
1437 </row>
1438 <row>
1439 <entry>findbugs.de.comment</entry>
1440 <entry>true または false</entry>
1441 <entry>true に設定すると、 DroppedException (無視された例外) ディテクタは空の catch ブロック にコメントが無いか探します。そして、コメントがみつかった場合には警告が報告されません。</entry>
1442 </row>
1443 <row>
1444 <entry>findbugs.maskedfields.locals</entry>
1445 <entry>true または false</entry>
1446 <entry>true に設定すると、フィールドを隠蔽しているローカル変数に対して優先度(低)の警告が発行されます。デフォルトは、 false です。</entry>
1447 </row>
1448 <row>
1449 <entry>findbugs.nullderef.assumensp</entry>
1450 <entry>true または false</entry>
1451 <entry>使用されません。 (意図 : true に設定すると、null 参照アクセスディテクタはメソッドからの戻り値、または、メソッドに受け渡される引数を null であると仮定します。デフォルトは、 false です。このプロパティーを有効にすると、大量の誤検出が生成されるであろうことに注意してください。)</entry>
1452 </row>
1453 <row>
1454 <entry>findbugs.refcomp.reportAll</entry>
1455 <entry>true または false</entry>
1456 <entry>true に設定すると、 == および != 演算子を使っている疑わしい参照比較がすべて報告されます。 false に設定すると、同様の警告は 1 メソッドにつき 1 つしか発行されません。デフォルトは、 false です。</entry>
1457 </row>
1458 <row>
1459 <entry>findbugs.sf.comment</entry>
1460 <entry>true または false</entry>
1461 <entry>true に設定すると、 SwitchFallthrough ディテクタはソースコードに「fall」または「nobreak」という単語を含んだコメントを記載していない caseラベル に限り警告を報告します。(この機能が正しく動作するためには、正確なソースパスが必要です。) これにより、意図的ではない switch 文の fallthrough を発見し易くなります。</entry>
1462 </row>
1463 <!-- see others at src/doc/manual/sysprops.html
1464 <row>
1465 <entry></entry>
1466 <entry></entry>
1467 <entry></entry>
1468 </row>
1469 -->
1470 </tbody>
1471 </tgroup>
1472 </table>
1473
1474 </chapter>
1475
1476 <!--
1477 **************************************************************************
1478 Annotations
1479 ***************************************************************************
1480 -->
1481
1482 <chapter id="annotations">
1483 <title>アノテーション</title>
1484
1485 <para>&FindBugs; はいくつかのアノテーションをサポートしています。開発者の意図を明確にすることで、 FindBugs はより的確に警告を発行することができます。アノテーションを使用するためには Java 5 が必要であり、 annotations.jar および jsr305.jar ファイルをコンパイル時のクラスパスに含める必要があります。</para>
1486
1487 <variablelist>
1488 <varlistentry>
1489 <term><command>edu.umd.cs.findbugs.annotations.CheckForNull</command></term>
1490 <listitem>
1491 <command>[Target]</command> Field, Method, Parameter
1492 </listitem>
1493 <listitem>
1494 <para>アノテーションをつけた要素は、 null である可能性があります。したがって、当該要素を使用する際は null チェックをするべきです。このアノテーションをメソッドに適用すると、メソッドの戻り値に適用されます。</para>
1495 </listitem>
1496 </varlistentry>
1497
1498 <varlistentry>
1499 <term><command>edu.umd.cs.findbugs.annotations.CheckReturnValue</command></term>
1500 <listitem>
1501 <command>[Target]</command> Method, Constructor
1502 </listitem>
1503 <listitem>
1504 <variablelist>
1505 <varlistentry>
1506 <term><command>[Parameter]</command></term>
1507 <listitem>
1508 <para>
1509 <command>priority:</command> 警告の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1510 </listitem>
1511 <listitem>
1512 <para>
1513 <command>explanation:</command>戻り値をチェックしなけばならない理由をテキストで説明します。デフォルト値 :&quot;&quot;。</para>
1514 </listitem>
1515 </varlistentry>
1516 </variablelist>
1517 </listitem>
1518 <listitem>
1519 <para>このアノテーションを使用して、呼出し後に戻り値をチェックすべきメソッドを表すことができます。</para>
1520 </listitem>
1521 </varlistentry>
1522
1523 <varlistentry>
1524 <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotation</command></term>
1525 <listitem>
1526 <command>[Target]</command> Type, Package
1527 </listitem>
1528 <listitem>
1529 <variablelist>
1530 <varlistentry>
1531 <term><command>[Parameter]</command></term>
1532 <listitem>
1533 <para>
1534 <command>value:</command>アノテーションクラスのclassオブジェクト。複数のクラスを指定することができます。</para>
1535 </listitem>
1536 <listitem>
1537 <para>
1538 <command>priority:</command>省略時の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1539 </listitem>
1540 </varlistentry>
1541 </variablelist>
1542 </listitem>
1543 <listitem>
1544 <para>
1545 Indicates that all members of the class or package should be annotated with the default
1546 value of the supplied annotation classes. This would be used for behavior annotations
1547 such as @NonNull, @CheckForNull, or @CheckReturnValue. In particular, you can use
1548 @DefaultAnnotation(NonNull.class) on a class or package, and then use @Nullable only
1549 on those parameters, methods or fields that you want to allow to be null.
1550 </para>
1551 </listitem>
1552 </varlistentry>
1553
1554 <varlistentry>
1555 <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForFields</command></term>
1556 <listitem>
1557 <command>[Target]</command> Type, Package
1558 </listitem>
1559 <listitem>
1560 <variablelist>
1561 <varlistentry>
1562 <term><command>[Parameter]</command></term>
1563 <listitem>
1564 <para>
1565 <command>value:</command>アノテーションクラスのclassオブジェクト。複数のクラスを指定することができます。</para>
1566 </listitem>
1567 <listitem>
1568 <para>
1569 <command>priority:</command>省略時の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1570 </listitem>
1571 </varlistentry>
1572 </variablelist>
1573 </listitem>
1574 <listitem>
1575 <para>
1576 This is same as the DefaultAnnotation except it only applys to fields.
1577 </para>
1578 </listitem>
1579 </varlistentry>
1580
1581 <varlistentry>
1582 <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForMethods</command></term>
1583 <listitem>
1584 <command>[Target]</command> Type, Package
1585 </listitem>
1586 <listitem>
1587 <variablelist>
1588 <varlistentry>
1589 <term><command>[Parameter]</command></term>
1590 <listitem>
1591 <para>
1592 <command>value:</command>アノテーションクラスのclassオブジェクト。複数のクラスを指定することができます。</para>
1593 </listitem>
1594 <listitem>
1595 <para>
1596 <command>priority:</command>省略時の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1597 </listitem>
1598 </varlistentry>
1599 </variablelist>
1600 </listitem>
1601 <listitem>
1602 <para>
1603 This is same as the DefaultAnnotation except it only applys to methods.
1604 </para>
1605 </listitem>
1606 </varlistentry>
1607
1608 <varlistentry>
1609 <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForParameters</command></term>
1610 <listitem>
1611 <command>[Target]</command> Type, Package
1612 </listitem>
1613 <listitem>
1614 <variablelist>
1615 <varlistentry>
1616 <term><command>[Parameter]</command></term>
1617 <listitem>
1618 <para>
1619 <command>value:</command>アノテーションクラスのclassオブジェクト。複数のクラスを指定することができます。</para>
1620 </listitem>
1621 <listitem>
1622 <para>
1623 <command>priority:</command>省略時の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1624 </listitem>
1625 </varlistentry>
1626 </variablelist>
1627 </listitem>
1628 <listitem>
1629 <para>
1630 This is same as the DefaultAnnotation except it only applys to method parameters.
1631 </para>
1632 </listitem>
1633 </varlistentry>
1634
1635 <varlistentry>
1636 <term><command>edu.umd.cs.findbugs.annotations.NonNull</command></term>
1637 <listitem>
1638 <command>[Target]</command> Field, Method, Parameter
1639 </listitem>
1640 <listitem>
1641 <para>アノテーションをつけた要素は、 null であってはいけません。アノテーションをつけたフィールドは、構築完了後 null であってはいけません。アノテーションをつけたメソッドは、 null ではない値を戻り値としなければなりません。</para>
1642 </listitem>
1643 </varlistentry>
1644
1645 <varlistentry>
1646 <term><command>edu.umd.cs.findbugs.annotations.Nullable</command></term>
1647 <listitem>
1648 <command>[Target]</command> Field, Method, Parameter
1649 </listitem>
1650 <listitem>
1651 <para>アノテーションをつけた要素は、 null であってはいけません。In general, this means developers will have to read the documentation to determine when a null value is acceptable and whether it is neccessary to check for a null value. FindBugs will treat the annotated items as though they had no annotation.</para>
1652 <para>
1653 In pratice this annotation is useful only for overriding an overarching NonNull
1654 annotation.
1655 </para>
1656 </listitem>
1657 </varlistentry>
1658
1659 <varlistentry>
1660 <term><command>edu.umd.cs.findbugs.annotations.OverrideMustInvoke</command></term>
1661 <listitem>
1662 <command>[Target]</command> Method
1663 </listitem>
1664 <listitem>
1665 <variablelist>
1666 <varlistentry>
1667 <term><command>[Parameter]</command></term>
1668 <listitem>
1669 <para>
1670 <command>value:</command>Specify when the super invocation should be
1671 performed (FIRST, ANYTIME, LAST). Default value:ANYTIME.
1672 </para>
1673 </listitem>
1674 </varlistentry>
1675 </variablelist>
1676 </listitem>
1677 <listitem>
1678 <para>
1679 Used to annotate a method that, if overridden, must (or should) be invoke super
1680 in the overriding method. Examples of such methods include finalize() and clone().
1681 The argument to the method indicates when the super invocation should occur:
1682 at any time, at the beginning of the overriding method, or at the end of the overriding method.
1683 (This anotation is not implmemented in FindBugs as of September 8, 2006).
1684 </para>
1685 </listitem>
1686 </varlistentry>
1687
1688 <varlistentry>
1689 <term><command>edu.umd.cs.findbugs.annotations.PossiblyNull</command></term>
1690 <listitem>
1691 <para>
1692 This annotation is deprecated. Use CheckForNull instead.
1693 </para>
1694 </listitem>
1695 </varlistentry>
1696
1697 <varlistentry>
1698 <term><command>edu.umd.cs.findbugs.annotations.SuppressWarnings</command></term>
1699 <listitem>
1700 <command>[Target]</command> Type, Field, Method, Parameter, Constructor, Package
1701 </listitem>
1702 <listitem>
1703 <variablelist>
1704 <varlistentry>
1705 <term><command>[Parameter]</command></term>
1706 <listitem>
1707 <para>
1708 <command>value:</command>The name of the warning. More than one name can be specified.
1709 </para>
1710 </listitem>
1711 <listitem>
1712 <para>
1713 <command>justification:</command>Reason why the warning should be ignored. デフォルト値 :&quot;&quot;。</para>
1714 </listitem>
1715 </varlistentry>
1716 </variablelist>
1717 </listitem>
1718 <listitem>
1719 <para>
1720 The set of warnings that are to be suppressed by the compiler in the annotated element.
1721 Duplicate names are permitted. The second and successive occurrences of a name are ignored.
1722 The presence of unrecognized warning names is <emphasis>not</emphasis> an error: Compilers
1723 must ignore any warning names they do not recognize. They are, however, free to emit a
1724 warning if an annotation contains an unrecognized warning name. Compiler vendors should
1725 document the warning names they support in conjunction with this annotation type. They
1726 are encouraged to cooperate to ensure that the same names work across multiple compilers.
1727 </para>
1728 </listitem>
1729 </varlistentry>
1730
1731 <varlistentry>
1732 <term><command>edu.umd.cs.findbugs.annotations.UnknownNullness</command></term>
1733 <listitem>
1734 <command>[Target]</command> Field, Method, Parameter
1735 </listitem>
1736 <listitem>
1737 <para>
1738 Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
1739 </para>
1740 </listitem>
1741 </varlistentry>
1742
1743 <varlistentry>
1744 <term><command>edu.umd.cs.findbugs.annotations.UnknownNullness</command></term>
1745 <listitem>
1746 <command>[Target]</command> Field, Method, Parameter
1747 </listitem>
1748 <listitem>
1749 <para>
1750 Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
1751 </para>
1752 </listitem>
1753 </varlistentry>
1754 </variablelist>
1755
1756 <para>また、 &FindBugs; 次に示すアノテーションもサポートしています。 :<itemizedlist>
1757 <listitem>net.jcip.annotations.GuardedBy</listitem>
1758 <listitem>net.jcip.annotations.Immutable</listitem>
1759 <listitem>net.jcip.annotations.NotThreadSafe</listitem>
1760 <listitem>net.jcip.annotations.ThreadSafe</listitem>
1761 </itemizedlist>
1762 </para>
1763 <para><ulink url="http://jcip.net/">Java Concurrency in Practice</ulink> の <ulink url="http://jcip.net/annotations/doc/index.html"> API ドキュメント</ulink> を参照してください。</para>
1764 </chapter>
1765
1766 <!--
1767 **************************************************************************
1768 Using rejarForAnalysis
1769 **************************************************************************
1770 -->
1771
1772 <chapter id="rejarForAnalysis">
1773 <title>rejarForAnalysis の使用方法</title>
1774
1775 <para>プロジェクトに多くの jar ファイル があったり、 jar ファイルが多くのディレクトリに点在したりする場合は、 <command>rejarForAnalysis </command> スクリプトを使用すると FindBugs の実行が比較的簡単になります。このスクリプトは、数多い jar ファイルを集めて 1 つの大きな jar ファイルに結合します。そうすると、分析時にFindBugs に jar ファイルを設定することが比較的簡単になります。このスクリプトは、 unix システムの 'find' コマンドと組み合わせるととりわけ有用になります ; 次に例を示します。 <command>find . -name '*.jar' | xargs rejarForAnalysis </command>.</para>
1776
1777 <para>また、 <command>rejarForAnalysis</command> スクリプトは巨大なプロジェクトを複数の jar ファイルに分割することに使用できます。プロジェクトのクラスファイルは、複数の jar ファイルに均等に配分されます。これは、プロジェクト全体に対して FindBugs を実行すると時間とメモリ消費が著しい場合に有用です。プロジェクト全体に対して FindBugs を実行する代わりに、 <command> rejarForAnalysis</command> ですべてのクラスを含む大きな jar ファイルを構築します。続いて、 <command>rejarForAnalysis</command> を再び実行して複数の jar ファイルに分割します。そして、各々の jar ファイルに対して順に FindBugs を実行します。その際、 <command>-auxclasspath</command> に最初に 1 つにまとめた jar ファイルを指定してください。</para>
1778
1779 <para><command>rejarForAnalysis</command> スクリプトに指定することができるオプションを以下に示します :</para>
1780
1781 <variablelist>
1782 <varlistentry>
1783 <term><command>-maxAge</command> <replaceable>日数</replaceable></term>
1784 <listitem>
1785 <para>最後に更新された日からの経過時間を日単位で指定します (指定した日数より古い jar ファイルは無視されます)。</para>
1786 </listitem>
1787 </varlistentry>
1788 <varlistentry>
1789 <term><command>-inputFileList</command> <replaceable>ファイル名</replaceable></term>
1790 <listitem>
1791 <para>jar ファイル名を記載したテキストファイルを指定します。</para>
1792 </listitem>
1793 </varlistentry>
1794 <varlistentry>
1795 <term><command>-maxClasses</command> <replaceable>クラス数</replaceable></term>
1796 <listitem>
1797 <para>analysis*.jar ファイル 1 ファイルに対するクラスの最大数を指定します。</para>
1798 </listitem>
1799 </varlistentry>
1800 <varlistentry>
1801 <term><command>-prefix</command> <replaceable>プレフィックス</replaceable></term>
1802 <listitem>
1803 <para>分析するクラス名のプレフィックスを指定します (例、 edu.umd.cs.) 。</para>
1804 </listitem>
1805 </varlistentry>
1806 </variablelist>
1807 </chapter>
1808
1809 <!--
1810 **************************************************************************
1811 Data mining
1812 **************************************************************************
1813 -->
1814
1815 <chapter id="datamining">
1816 <title>&FindBugs;&trade; によるデータ・マイニング</title>
1817
1818 <para>バグデータベースへの高機能の問い合わせ機能、および、調査対象のコードの複数のバージョンにわたる警告の追跡記録機能を、 FindBugs は内蔵しています。これらを使って次のようなことができます。すなわち、いつバグが最初持ち込まれたかを捜し出すこと、最終リリース以後持ち込まれた警告の分析を行うこと、または、無限再起ループの数を時間軸でグラフにすることです。</para>
1819
1820 <para>これらの技術は、 FindBugs が警告の保存に使う XML 書式を使用します。これらの XML ファイルは、通常、特定の 1 分析に対する警告が入れられています。しかしそれらには、一連のソフトウェアのビルドやバージョンに対する分析結果を格納することもできます。</para>
1821
1822 <para>すべての FindBugs XML バグデータベースには、バージョン名とタイム・スタンプ が入れられています。FindBugs は分析が行われるファイルの更新時刻からタイム・スタンプを計算します (例えば、タイム・スタンプはクラスファイルの生成時刻になるようになっています。分析が行われた時刻ではありません) 。各々のバグデータベースには、バージョン名も入れられています。バージョン名とタイム・スタンプは、 <command>setBugDatabaseInfo</command> (<xref linkend="setBugDatabaseInfo"/>) コマンドを使用して手動で設定することもできます。</para>
1823
1824 <para>複数バージョンを格納するバグデータベースにおいては、分析されるコードの各バージョンごとにシーケンス番号が割り当てられます。これらのシーケンス番号は単に 0 から始まる連続する整数値です (例えば、 4 つのコードバージョンを格納するバグデータベースには、バージョン 0~3 が入れられます) 。バグデータベースにはまた、各バージョンの名前とタイム・スタンプがそれぞれ記録されます。<command>filterBugs</command> コマンドを使用すると、シーケンス番号、バージョン名またはタイム・スタンプからバージョンを参照することができます。</para>
1825
1826 <para>1 バージョンを格納するバグデータベースの集合から、 1 個の複数バージョンバグデータベースを作成することができます。また、複数バージョンバグデータベースに対して、それ以後に作成された 1 バージョンのバグデータベースを結合することができます。</para>
1827
1828 <para>これらのコマンドのいくつかは、 ant タスクとして実行することができます。コマンドの実行方法および属性・引数の詳細は、以下を参照してください。以下のすべての例においては、 <literal>findbugs.lib</literal> <literal>refid</literal> が正しく設定されていることを前提としています。設定方法の一例を次に示します :</para>
1829
1830 <programlisting>
1831 <![CDATA[
1832 <!-- findbugs タスク定義 -->
1833 <property name="findbugs.home" value="/your/path/to/findbugs" />
1834 <path id="findbugs.lib">
1835 <fileset dir="${findbugs.home}/lib">
1836 <include name="findbugs-ant.jar"/>
1837 </fileset>
1838 </path>
1839 ]]>
1840 </programlisting>
1841
1842 <sect1 id="commands">
1843 <title>コマンド</title>
1844
1845 <para>FindBugs データ・マイニング ツールはすべてコマンドラインから実行することができます。また、いくつかのより有用なコマンドは、 ant ビルドファイルから実行することができます。</para>
1846
1847 <para>コマンドラインツールについて簡単に説明します :</para>
1848
1849 <variablelist>
1850 <varlistentry>
1851 <term><command><link linkend="unionBugs">unionBugs</link></command></term>
1852 <listitem>
1853 <para>別のクラスに対する別個の分析結果を結合します。</para>
1854 </listitem>
1855 </varlistentry>
1856 <varlistentry>
1857 <term><command><link linkend="computeBugHistory">computeBugHistory</link></command></term>
1858 <listitem>
1859 <para>複数バージョンから得られた複数のバグ警告を、マージして 1 個の複数バージョンバグデータベースにします。これを使って、既存の複数バージョンバグデータベースに更にバージョンを追加したり、 1 バージョンを格納するバグデータベースの集合から 1 個の複数バージョンバグデータベースを作成したり、できます。</para>
1860 </listitem>
1861 </varlistentry>
1862 <varlistentry>
1863 <term><command><link linkend="setBugDatabaseInfo">setBugDatabaseInfo</link></command></term>
1864 <listitem>
1865 <para>リビジョン名やタイム・スタンプなどの情報を XML データベースに設定します。</para>
1866 </listitem>
1867 </varlistentry>
1868 <varlistentry>
1869 <term><command><link linkend="listBugDatabaseInfo">listBugDatabaseInfo</link></command></term>
1870 <listitem>
1871 <para>XML データベースにあるリビジョン名やタイム・スタンプなどの情報を一覧表示します。</para>
1872 </listitem>
1873 </varlistentry>
1874 <varlistentry>
1875 <term><command><link linkend="filterBugs">filterBugs</link></command></term>
1876 <listitem>
1877 <para>バグデータベースの部分集合を選択します。</para>
1878 </listitem>
1879 </varlistentry>
1880 <varlistentry>
1881 <term><command><link linkend="mineBugHistory">mineBugHistory</link></command></term>
1882 <listitem>
1883 <para>複数バージョンバグデータベースの各バージョン毎の警告数を一覧にした表を作成します。</para>
1884 </listitem>
1885 </varlistentry>
1886 <varlistentry>
1887 <term><command><link linkend="defectDensity">defectDensity</link></command></term>
1888 <listitem>
1889 <para>プロジェクト全体およびクラス毎・パッケージ毎の不良密度 (1000 NCSS 毎の警告数) に関する情報を一覧表示します。</para>
1890 </listitem>
1891 </varlistentry>
1892 <varlistentry>
1893 <term><command><link linkend="convertXmlToText">convertXmlToText</link></command></term>
1894 <listitem>
1895 <para>XML 形式のバグ警告を、 1 行 1 バグのテキスト形式、または、HTML形式に変換します。</para>
1896 </listitem>
1897 </varlistentry>
1898 </variablelist>
1899
1900
1901 <sect2 id="unionBugs">
1902 <title>unionBugs</title>
1903
1904 <para>分析するのにアプリケーションの jar ファイルを分割している場合、このコマンドを使用することで、別個に生成された XML バグ警告ファイルをすべての警告を含んでいる 1 つの ファイルにすることができます。</para>
1905
1906 <para>同じファイルの異なるバージョンを分析した結果を結合する場合は、このコマンドを<emphasis>使用しないでください</emphasis>。代わりに <command>computeBugHistory</command> を使用してください。</para>
1907
1908 <para>XML ファイルは、コマンドラインで指定してください。結果は、標準出力に送られます。</para>
1909 </sect2>
1910
1911 <sect2 id="computeBugHistory">
1912 <title>computeBugHistory</title>
1913
1914 <para>このコマンドを使用することで、分析するソフトウェアの異なるビルドまたはバージョンの情報を含むバグデータベースを生成することができます入力として提供したファイルの 1 番目のファイルから履歴が取得されます。後に続くファイルは 1 バージョンのバグデータベースであるようにしてください (もし、履歴を持っていたとしても無視されます) 。</para>
1915 <para>デフォルトでは、結果は標準出力に送られます。</para>
1916
1917 <para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>computeBugHistory</command> を taskdef で定義します :</para>
1918
1919 <programlisting>
1920 <![CDATA[
1921 <taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask">
1922 <classpath refid="findbugs.lib" />
1923 </taskdef>
1924 ]]>
1925 </programlisting>
1926
1927 <para>この ant タスクに指定できる属性を、下表に一覧で示します。入力ファイルを指定するには、 <literal>&lt;datafile&gt;</literal> 要素を入れ子にして入れてください。次に、例を示します:</para>
1928
1929 <programlisting>
1930 <![CDATA[
1931 <computeBugHistory home="${findbugs.home}" ...>
1932 <datafile name="analyze1.xml"/>
1933 <datafile name="analyze2.xml"/>
1934 </computeBugHistory>
1935 ]]>
1936 </programlisting>
1937
1938 <table id="computeBugHistoryTable">
1939 <title>computeBugHistory コマンドのオプション一覧</title>
1940 <tgroup cols="3" align="left">
1941 <thead>
1942 <row>
1943 <entry>コマンドラインオプション</entry>
1944 <entry>Ant 属性</entry>
1945 <entry>目的</entry>
1946 </row>
1947 </thead>
1948 <tbody>
1949 <row><entry>-output &lt;file&gt;</entry> <entry>output=&quot;&lt;file&gt;&quot;</entry> <entry>出力結果を保存するファイル名を指定します。 (同時に入力ファイルにもなりえます)</entry></row>
1950 <row><entry>-overrideRevisionNames[:truth]</entry> <entry>overrideRevisionNames=&quot;[true|false]&quot;</entry><entry>ファイル名から算出されるそれぞれのバージョン名を指定変更します。</entry></row>
1951 <row><entry>-noPackageMoves[:truth]</entry> <entry>noPackageMoves=&quot;[true|false]&quot;</entry><entry>パッケージを移動したクラスがある場合、当該クラスの警告は別の存在として扱われます。</entry></row>
1952 <row><entry>-preciseMatch[:truth]</entry> <entry>preciseMatch=&quot;[true|false]&quot;</entry><entry>バグパターンが正確に一致することを要求します。</entry></row>
1953 <row><entry>-precisePriorityMatch[:truth]</entry> <entry>precisePriorityMatch=&quot;[true|false]&quot;</entry><entry>優先度が正確に一致した場合のみ警告が同一であると判断されます。</entry></row>
1954 <row><entry>-quiet[:truth]</entry> <entry>quiet=&quot;[true|false]&quot;</entry><entry>エラーが発生しない限り、標準出力には何も表示されません。</entry></row>
1955 <row><entry>-withMessages[:truth]</entry> <entry>withMessages=&quot;[true|false]&quot;</entry><entry>出力 XML に人間が読むことができるバグメッセージが含まれます。</entry></row>
1956 </tbody>
1957 </tgroup>
1958 </table>
1959
1960 </sect2>
1961 <sect2 id="filterBugs">
1962 <title>filterBugs</title>
1963 <para>このコマンドを使用することで、 FindBugs XML 警告ファイルから一部分を選び出して新規 FindBugs 警告ファイルに選択された部分を書き込むことができます。</para>
1964 <para>このコマンドには、オプション群に続いて 0 個から 2 個の findbugs xml バグファイルを指定することができます。</para>
1965 <para>ファイル名をひとつも指定しない場合は、標準入力から読んで標準出力に出力されます。ファイル名を 1 個 指定した場合は、指定したファイルから読んで標準出力に出力されます。ファイル名を 2 個 指定した場合は、 1 番目に指定したファイルから読んで 2 番目に指定したファイルに出力されます。</para>
1966
1967 <para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>filterBugs</command> を taskdef で定義します :</para>
1968
1969 <programlisting>
1970 <![CDATA[
1971 <taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsTask">
1972 <classpath refid="findbugs.lib" />
1973 </taskdef>
1974 ]]>
1975 </programlisting>
1976
1977 <para>この ant タスクに指定できる属性を、下表に一覧で示します。入力ファイルを指定するには、 <literal>input</literal> 属性を使用するか、 <literal>&lt;datafile&gt;</literal> 要素を入れ子にして入れてください。次に、例を示します:</para>
1978
1979 <programlisting>
1980 <![CDATA[
1981 <filterBugs home="${findbugs.home}" ...>
1982 <datafile name="analyze.xml"/>
1983 </filterBugs>
1984 ]]>
1985 </programlisting>
1986
1987 <table id="filterOptionsTable">
1988 <title>filterBugs コマンドのオプション一覧</title>
1989 <tgroup cols="3" align="left">
1990 <thead>
1991 <row>
1992 <entry>コマンドラインオプション</entry>
1993 <entry>Ant 属性</entry>
1994 <entry>目的</entry>
1995 </row>
1996 </thead>
1997 <tbody>
1998 <row><entry/> <entry>input=&quot;&lt;file&gt;&quot;</entry> <entry>入力ファイルを指定します。</entry></row>
1999 <row><entry/> <entry>output=&quot;&lt;file&gt;&quot;</entry> <entry>出力ファイルを指定します。</entry></row>
2000 <row><entry>-not</entry> <entry>not=&quot;[true|false]&quot;</entry> <entry>フィルターのスイッチを反転します。</entry></row>
2001 <row><entry>-withSource[:truth]</entry> <entry>withSource=&quot;[true|false]&quot;</entry> <entry>ソースが入手可能な警告のみ出力されます。</entry></row>
2002 <row><entry>-exclude &lt;filter file&gt;</entry><entry>exclude=&quot;&lt;filter file&gt;&quot;</entry> <entry>フィルターに一致するバグが除外されます。</entry></row>
2003 <row><entry>-include &lt;filter file&gt;</entry><entry>include=&quot;&lt;filter file&gt;&quot;</entry> <entry>フィルターに一致するバグのみを含まれます。</entry></row>
2004 <row><entry>-annotation &lt;text&gt;</entry> <entry>annotation=&quot;&lt;text&gt;&quot;</entry> <entry>手で入力した注釈に指定した文言を含む警告のみ出力されます。</entry></row>
2005 <row><entry>-after &lt;when&gt;</entry> <entry>after=&quot;&lt;when&gt;&quot;</entry> <entry>指定したバージョンより後に初めて出現した警告のみ出力されます。</entry></row>
2006 <row><entry>-before &lt;when&gt;</entry> <entry>before=&quot;&lt;when&gt;&quot;</entry> <entry>指定したバージョンより前に初めて出現した警告のみ出力されます。</entry></row>
2007 <row><entry>-first &lt;when&gt;</entry> <entry>first=&quot;&lt;when&gt;&quot;</entry> <entry>指定したバージョンに初めて出現した警告のみ出力されます。</entry></row>
2008 <row><entry>-last &lt;when&gt;</entry> <entry>last=&quot;&lt;when&gt;&quot;</entry> <entry>指定したバージョンが出現した最後である警告のみ出力されます。</entry></row>
2009 <row><entry>-fixed &lt;when&gt;</entry> <entry>fixed=&quot;&lt;when&gt;&quot;</entry> <entry>指定したバージョンの前回のバージョンが出現した最後である警告のみ出力されます。 (<option>-last</option> に優先します)。</entry></row>
2010 <row><entry>-present &lt;when&gt;</entry> <entry>present=&quot;&lt;when&gt;&quot;</entry> <entry>指定したバージョンに存在する警告のみ出力されます。</entry></row>
2011 <row><entry>-absent &lt;when&gt;</entry> <entry>absent=&quot;&lt;when&gt;&quot;</entry> <entry>指定したバージョンに存在しない警告のみ出力されます。</entry></row>
2012 <row><entry>-active[:truth]</entry> <entry>active=&quot;[true|false]&quot;</entry> <entry>最終通番に存在する警告のみ出力されます。</entry></row>
2013 <row><entry>-introducedByChange[:truth]</entry> <entry>introducedByChange=&quot;[true|false]&quot;</entry><entry>存在するクラスの変更によってもたらされた警告のみ出力されます。</entry></row>
2014 <row><entry>-removedByChange[:truth]</entry> <entry>removedByChange=&quot;[true|false]&quot;</entry> <entry>存在するクラスの変更によって除去された警告のみ出力されます。</entry></row>
2015 <row><entry>-newCode[:truth]</entry> <entry>newCode=&quot;[true|false]&quot;</entry> <entry>新クラスの追加によってもたらされた警告のみ出力されます。</entry></row>
2016 <row><entry>-removedCode[:truth]</entry> <entry>removedCode=&quot;[true|false]&quot;</entry> <entry>クラスの削除によって除去された警告のみ出力されます。</entry></row>
2017 <row><entry>-priority &lt;level&gt;</entry> <entry>priority=&quot;&lt;level&gt;&quot;</entry> <entry>指定した優先度以上の優先度をもつ警告のみ出力されます。</entry></row>
2018 <row><entry>-class &lt;pattern&gt;</entry> <entry>class=&quot;&lt;class&gt;&quot;</entry> <entry>指定したパターンに一致する主クラスをもつ警告のみ出力されます。</entry></row>
2019 <row><entry>-bugPattern &lt;pattern&gt;</entry> <entry>bugPattern=&quot;&lt;pattern&gt;&quot;</entry> <entry>指定したパターンに一致するバグ種別をもつ警告のみ出力されます。</entry></row>
2020 <row><entry>-category &lt;category&gt;</entry> <entry>category=&quot;&lt;category&gt;&quot;</entry> <entry>指定した文字列で始まるカテゴリーの警告のみ出力されます。</entry></row>
2021 <row><entry>-designation &lt;designation&gt;</entry> <entry>designation=&quot;&lt;designation&gt;&quot;</entry> <entry>指定したバグ分類指定をもつ警告のみ出力されます。 (例、 -designation SHOULD_FIX)</entry></row>
2022 <row><entry>-withMessages[:truth] </entry> <entry>withMessages=&quot;[true|false]&quot;</entry> <entry>テキストメッセージを含んだ XML が生成されます。</entry></row>
2023 </tbody>
2024 </tgroup>
2025 </table>
2026
2027 </sect2>
2028
2029 <sect2 id="mineBugHistory">
2030 <title>mineBugHistory</title>
2031 <para>このコマンドを使用することで、複数バージョンバグデータベースの各バージョン毎の警告数を一覧にした表を作成することができます。</para>
2032
2033
2034 <para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>mineBugHistory</command> を taskdef で定義します :</para>
2035
2036 <programlisting>
2037 <![CDATA[
2038 <taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask">
2039 <classpath refid="findbugs.lib" />
2040 </taskdef>
2041 ]]>
2042 </programlisting>
2043
2044 <para>この ant タスクに指定できる属性を、下表に一覧で示します。入力ファイルを指定するには、 <literal>input</literal> 属性を使用するか、 <literal>&lt;datafile&gt;</literal> 要素を入れ子にして入れてください。次に、例を示します:</para>
2045
2046 <programlisting>
2047 <![CDATA[
2048 <mineBugHistory home="${findbugs.home}" ...>
2049 <datafile name="analyze.xml"/>
2050 </mineBugHistory>
2051 ]]>
2052 </programlisting>
2053
2054 <table id="mineBugHistoryOptionsTable">
2055 <title>mineBugHistory コマンドのオプション一覧</title>
2056 <tgroup cols="3" align="left">
2057 <thead>
2058 <row>
2059 <entry>コマンドラインオプション</entry>
2060 <entry>Ant 属性</entry>
2061 <entry>目的</entry>
2062 </row>
2063 </thead>
2064 <tbody>
2065 <row><entry/> <entry>input=&quot;&lt;file&gt;&quot;</entry> <entry>入力ファイルを指定します。</entry></row>
2066 <row><entry/> <entry>output=&quot;&lt;file&gt;&quot;</entry> <entry>出力ファイルを指定します。</entry></row>
2067 <row><entry>-formatDates</entry> <entry>formatDates=&quot;[true|false]&quot;</entry> <entry>データがテキスト形式で描画されます。</entry></row>
2068 <row><entry>-noTabs</entry> <entry>noTabs=&quot;[true|false]&quot;</entry> <entry>タブの代わりに複数スペースでカラムが区切られます (下記参照)。</entry></row>
2069 <row><entry>-summary</entry> <entry>summary=&quot;[true|false]&quot;</entry> <entry>最新 10 件の変更の要約が出力されます。</entry></row>
2070 </tbody>
2071 </tgroup>
2072 </table>
2073
2074 <para><option>-noTabs</option> 出力を使うことで、固定幅フォントのシェルで読み易くなります。数値カラムは右寄せされるので、スペースがカラム値の前に挿入されます。また、このオプションを使用した場合、 <option>-formatDates</option> を指定したときに要約の日付を描画するのに空白が埋め込まれなくなります。</para>
2075
2076 <para>出力される表は、 (<option>-noTabs</option> が無ければ) タブ区切りで次に示すカラムから成ります :</para>
2077
2078 <table id="mineBugHistoryColumns">
2079 <title>mineBugHistory 出力のカラム一覧</title>
2080 <tgroup cols="2" align="left">
2081 <thead>
2082 <row>
2083 <entry>表題</entry>
2084 <entry>目的</entry>
2085 </row>
2086 </thead>
2087 <tbody>
2088 <row><entry>seq</entry><entry>シーケンス番号 (0 始まりの連続した整数値)</entry></row>
2089 <row><entry>version</entry><entry>バージョン名</entry></row>
2090 <row><entry>time</entry><entry>リリースされた日時</entry></row>
2091 <row><entry>classes</entry><entry>分析されたクラス数</entry></row>
2092 <row><entry>NCSS</entry><entry>コメント文を除いた命令数 (Non Commenting Source Statements)</entry></row>
2093 <row><entry>added</entry><entry>前回のバージョンに存在したクラスにおける新規警告数</entry></row>
2094 <row><entry>newCode</entry><entry>前回のバージョンに存在しなかったクラスにおける新規警告数</entry></row>
2095 <row><entry>fixed</entry><entry>現在のバージョンに存在するクラスにおける除去された警告数</entry></row>
2096 <row><entry>removed</entry><entry>現在のバージョンに存在しないクラスの前回のバージョンにおける警告数</entry></row>
2097 <row><entry>retained</entry><entry>現在のバージョンと前回のバージョンの両方に存在する警告の数</entry></row>
2098 <row><entry>dead</entry><entry>以前のバージョンに存在したが現在のバージョンにも直前のバージョンにも存在しない警告の数</entry></row>
2099 <row><entry>active</entry><entry>現在のバージョンに存在する警告総数</entry></row>
2100 </tbody>
2101 </tgroup>
2102 </table>
2103 </sect2>
2104
2105 <sect2 id="defectDensity">
2106 <title>defectDensity</title>
2107 <para>このコマンドを使用することで、プロジェクト全体およびクラス毎・パッケージ毎の不良密度 (1000 NCSS 毎の警告数) に関する情報を一覧表示できます。標準入力から読み込む場合はファイル指定なしで、そうでなければ、コマンドラインでファイルを指定して、このコマンドを実行します。</para>
2108 <para>出力される表は、次に示すカラムから成ります。また、プロジェクト全体情報の行、および、4 個以上の警告を含んでいる各パッケージ情報または各クラス情報の行も出力されます。</para>
2109 <table id="defectDensityColumns">
2110 <title>defectDensity 出力のカラム一覧</title>
2111 <tgroup cols="2" align="left">
2112 <thead>
2113 <row>
2114 <entry>表題</entry>
2115 <entry>目的</entry>
2116 </row>
2117 </thead>
2118 <tbody>
2119 <row><entry>kind</entry><entry>プロジェクト (project)、パッケージ (package) またはクラス (class)</entry></row>
2120 <row><entry>name</entry><entry>プロジェクト、パッケージまたはクラスの名前</entry></row>
2121 <row><entry>density</entry><entry> 1000 NCSS 毎の警告数</entry></row>
2122 <row><entry>bugs</entry><entry>警告数</entry></row>
2123 <row><entry>NCSS</entry><entry>コメント文を除いた命令数 (Non Commenting Source Statements) </entry></row>
2124 </tbody>
2125 </tgroup>
2126 </table>
2127 </sect2>
2128
2129 <sect2 id="convertXmlToText">
2130 <title>convertXmlToText</title>
2131
2132 <para>このコマンドを使用することで、XML 形式のバグ警告を、 1 行 1 バグのテキスト形式、または、HTML形式に変換することができます。</para>
2133
2134 <para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>convertXmlToText</command> を taskdef で定義します :</para>
2135
2136 <programlisting>
2137 <![CDATA[
2138 <taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask">
2139 <classpath refid="findbugs.lib" />
2140 </taskdef>
2141 ]]>
2142 </programlisting>
2143
2144 <para>この ant タスクに指定できる属性を、下表に一覧で示します。</para>
2145
2146 <table id="convertXmlToTextTable">
2147 <title>convertXmlToText コマンドのオプション一覧</title>
2148 <tgroup cols="3" align="left">
2149 <thead>
2150 <row>
2151 <entry>コマンドラインオプション</entry>
2152 <entry>Ant 属性</entry>
2153 <entry>目的</entry>
2154 </row>
2155 </thead>
2156 <tbody>
2157 <row><entry/> <entry>input=&quot;&lt;filename&gt;&quot;</entry> <entry>入力ファイルを指定します。</entry></row>
2158 <row><entry/> <entry>output=&quot;&lt;filename&gt;&quot;</entry> <entry>出力ファイルを指定します。</entry></row>
2159 <row><entry>-longBugCodes</entry> <entry>longBugCodes=&quot;[true|false]&quot;</entry> <entry>2 文字のバグ略称の代わりに、省略なしのバグパターンコードを使用します。</entry></row>
2160 <row><entry/> <entry>format=&quot;text&quot;</entry> <entry>プレーンテキストの出力が作成されます。1 行につき 1 つのバグが出力されます。コマンドライン時のデフォルトです。</entry></row>
2161 <row><entry>-html[:stylesheet]</entry> <entry>format=&quot;html:&lt;stylesheet&gt;&quot;</entry> <entry>指定されたスタイルシートを使用して出力が作成されます (下記参照) 。省略した場合は、 default.xsl が使用されます。</entry></row>
2162 </tbody>
2163 </tgroup>
2164 </table>
2165
2166 <para>-html/format オプションには、plain.xsl 、 default.xsl 、 fancy.xsl 、 fancy-hist.xsl または ユーザ自身が作成した XSL スタイルシートのいずれかを指定することができます。オプション名をよそに、 html 以外の形式を出力するスタイルシートを指定することもできます。FindBugs に含まれているスタイルシート(上述)以外のスタイルシートを使用する場合は、オプション -html/format で当該スタイルシートへのパスまたは URL を指定してください。</para>
2167 </sect2>
2168
2169 <sect2 id="setBugDatabaseInfo">
2170 <title>setBugDatabaseInfo</title>
2171
2172 <para>このコマンドを使用することで、指定したバグ警告にメタ情報を設定することができます。このコマンドには次に示すオプションがあります:</para>
2173
2174 <para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>setBugDatabaseInfo</command> を taskdef で定義します :</para>
2175
2176 <programlisting>
2177 <![CDATA[
2178 <taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask">
2179 <classpath refid="findbugs.lib" />
2180 </taskdef>
2181 ]]>
2182 </programlisting>
2183
2184 <para>この ant タスクに指定できる属性を、下表に一覧で示します。入力ファイルを指定するには、 <literal>input</literal> 属性を使用するか、 <literal>&lt;datafile&gt;</literal> 要素を入れ子にして入れてください。次に、例を示します:</para>
2185
2186 <programlisting>
2187 <![CDATA[
2188 <setBugDatabaseInfo home="${findbugs.home}" ...>
2189 <datafile name="analyze.xml"/>
2190 </setBugDatabaseInfo>
2191 ]]>
2192 </programlisting>
2193
2194 <table id="setBugDatabaseInfoOptions">
2195 <title>setBugDatabaseInfo オプション一覧</title>
2196 <tgroup cols="3" align="left">
2197 <thead>
2198 <row>
2199 <entry>コマンドラインオプション</entry>
2200 <entry>Ant 属性</entry>
2201 <entry>目的</entry>
2202 </row>
2203 </thead>
2204 <tbody>
2205 <row><entry/> <entry>input=&quot;&lt;file&gt;&quot;</entry> <entry>入力ファイルを指定します。</entry></row>
2206 <row><entry/> <entry>output=&quot;&lt;file&gt;&quot;</entry> <entry>出力ファイルを指定します。</entry></row>
2207 <row><entry>-name &lt;name&gt;</entry> <entry>name=&quot;&lt;name&gt;&quot;</entry> <entry>最新リビジョンの名前を設定します。</entry></row>
2208 <row><entry>-timestamp &lt;when&gt;</entry> <entry>timestamp=&quot;&lt;when&gt;&quot;</entry> <entry>最新リビジョンのタイム・スタンプを設定します。</entry></row>
2209 <row><entry>-source &lt;directory&gt;</entry> <entry>source=&quot;&lt;directory&gt;&quot;</entry> <entry>ソースを検索するディレクトリーを追加指定します。</entry></row>
2210 <row><entry>-findSource &lt;directory&gt;</entry> <entry>findSource=&quot;&lt;directory&gt;&quot;</entry> <entry>指定したディレクトリー内を検索して関連するソースの場所を追加します。</entry></row>
2211 <row><entry>-suppress &lt;filter file&gt;</entry> <entry>suppress=&quot;&lt;filter file&gt;&quot;</entry> <entry>指定したファイルに一致する警告を抑止します (以前に指定した抑止設定は置き換えられます)。</entry></row>
2212 <row><entry>-withMessages</entry> <entry>withMessages=&quot;[true|false]&quot;</entry> <entry>XMLにテキストメッセージを追加します。</entry></row>
2213 <row><entry>-resetSource</entry> <entry>resetSource=&quot;[true|false]&quot;</entry> <entry>ソース検索パスをすべて削除します。</entry></row>
2214 </tbody>
2215 </tgroup>
2216 </table>
2217 </sect2>
2218
2219 <sect2 id="listBugDatabaseInfo">
2220 <title>listBugDatabaseInfo</title>
2221
2222 <para>このコマンドの実行においては、コマンドラインで 0 個以上の xml バグデータベースファイル名を指定します。ファイル名を1つも指定しなければ、標準出力から読み込みを行いテーブルのヘッダーは生成されません。</para>
2223
2224 <para>このコマンドには 1 つだけオプションがあります : <option>-formatDates</option> を指定するとテキスト形式でデータが描画されます。</para>
2225
2226 <para>出力される表は、各バグデータベースごとに行を持ち、次に示すカラムから成ります :</para>
2227 <table id="listBugDatabaseInfoColumns">
2228 <title>listBugDatabaseInfo カラム一覧</title>
2229 <tgroup cols="2" align="left">
2230 <thead>
2231 <row>
2232 <entry>カラム</entry>
2233 <entry>目的</entry>
2234 </row>
2235 </thead>
2236 <tbody>
2237 <row><entry>version</entry><entry>バージョン名</entry></row>
2238 <row><entry>time</entry><entry>リリースされた日時</entry></row>
2239 <row><entry>classes</entry><entry>分析されたクラス数</entry></row>
2240 <row><entry>NCSS</entry><entry>コメント文を除いた命令数 (Non Commenting Source Statements)</entry></row>
2241 <row><entry>total</entry><entry>全警告数</entry></row>
2242 <row><entry>high</entry><entry>優先度(高)の警告の総数</entry></row>
2243 <row><entry>medium</entry><entry>優先度(中)の警告の総数</entry></row>
2244 <row><entry>low</entry><entry>優先度(低)の警告の総数</entry></row>
2245 <row><entry>filename</entry><entry>データベースのファイル名</entry></row>
2246 <!--
2247 <row><entry></entry><entry></entry></row>
2248 <row><entry></entry><entry></entry></row>
2249 <row><entry></entry><entry></entry></row>
2250 <row><entry></entry><entry></entry></row>
2251 <row><entry></entry><entry></entry></row>
2252 <row><entry></entry><entry></entry></row>
2253 -->
2254 </tbody>
2255 </tgroup>
2256 </table>
2257
2258 </sect2>
2259
2260 </sect1>
2261
2262 <sect1 id="examples">
2263 <title>例</title>
2264 <sect2 id="unixscriptsexamples">
2265 <title>提供されたシェル・スクリプトを使用しての履歴マイニング</title>
2266 <para>以下はすべて、 jdk1.6.0-b12, jdk1.6.0-b13, ..., jdk1.6.0-b60 のディレクトリに対してコマンドを実行しています。</para>
2267
2268 <para>以下のコマンドを実行してみます :</para>
2269 <screen>
2270 computeBugHistory jdk1.6.0-b* | filterBugs -bugPattern IL_ | mineBugHistory -formatDates
2271 </screen>
2272 <para>すると、次のような出力が行われます :</para>
2273
2274 <screen>
2275 seq version time classes NCSS added newCode fixed removed retained dead active
2276 0 jdk1.6.0-b12 &quot;Thu Nov 11 09:07:20 EST 2004&quot; 13128 811569 0 4 0 0 0 0 4
2277 1 jdk1.6.0-b13 &quot;Thu Nov 18 06:02:06 EST 2004&quot; 13128 811570 0 0 0 0 4 0 4
2278 2 jdk1.6.0-b14 &quot;Thu Dec 02 06:12:26 EST 2004&quot; 13145 811786 0 0 2 0 2 0 2
2279 3 jdk1.6.0-b15 &quot;Thu Dec 09 06:07:04 EST 2004&quot; 13174 811693 0 0 1 0 1 2 1
2280 4 jdk1.6.0-b16 &quot;Thu Dec 16 06:21:28 EST 2004&quot; 13175 811715 0 0 0 0 1 3 1
2281 5 jdk1.6.0-b17 &quot;Thu Dec 23 06:27:22 EST 2004&quot; 13176 811974 0 0 0 0 1 3 1
2282 6 jdk1.6.0-b19 &quot;Thu Jan 13 06:41:16 EST 2005&quot; 13176 812011 0 0 0 0 1 3 1
2283 7 jdk1.6.0-b21 &quot;Thu Jan 27 05:57:52 EST 2005&quot; 13177 812173 0 0 0 0 1 3 1
2284 8 jdk1.6.0-b23 &quot;Thu Feb 10 05:44:36 EST 2005&quot; 13179 812188 0 0 0 0 1 3 1
2285 9 jdk1.6.0-b26 &quot;Thu Mar 03 06:04:02 EST 2005&quot; 13199 811770 0 0 0 0 1 3 1
2286 10 jdk1.6.0-b27 &quot;Thu Mar 10 04:48:38 EST 2005&quot; 13189 812440 0 0 0 0 1 3 1
2287 11 jdk1.6.0-b28 &quot;Thu Mar 17 02:54:22 EST 2005&quot; 13185 812056 0 0 0 0 1 3 1
2288 12 jdk1.6.0-b29 &quot;Thu Mar 24 03:09:20 EST 2005&quot; 13117 809468 0 0 0 0 1 3 1
2289 13 jdk1.6.0-b30 &quot;Thu Mar 31 02:53:32 EST 2005&quot; 13118 809501 0 0 0 0 1 3 1
2290 14 jdk1.6.0-b31 &quot;Thu Apr 07 03:00:14 EDT 2005&quot; 13117 809572 0 0 0 0 1 3 1
2291 15 jdk1.6.0-b32 &quot;Thu Apr 14 02:56:56 EDT 2005&quot; 13169 811096 0 0 0 0 1 3 1
2292 16 jdk1.6.0-b33 &quot;Thu Apr 21 02:46:22 EDT 2005&quot; 13187 811942 0 0 0 0 1 3 1
2293 17 jdk1.6.0-b34 &quot;Thu Apr 28 02:49:00 EDT 2005&quot; 13195 813488 0 1 0 0 1 3 2
2294 18 jdk1.6.0-b35 &quot;Thu May 05 02:49:04 EDT 2005&quot; 13457 829837 0 0 0 0 2 3 2
2295 19 jdk1.6.0-b36 &quot;Thu May 12 02:59:46 EDT 2005&quot; 13462 831278 0 0 0 0 2 3 2
2296 20 jdk1.6.0-b37 &quot;Thu May 19 02:55:08 EDT 2005&quot; 13464 831971 0 0 0 0 2 3 2
2297 21 jdk1.6.0-b38 &quot;Thu May 26 03:08:16 EDT 2005&quot; 13564 836565 0 0 0 0 2 3 2
2298 22 jdk1.6.0-b39 &quot;Fri Jun 03 03:10:48 EDT 2005&quot; 13856 849992 0 1 0 0 2 3 3
2299 23 jdk1.6.0-b40 &quot;Thu Jun 09 03:30:28 EDT 2005&quot; 15972 959619 0 2 0 0 3 3 5
2300 24 jdk1.6.0-b41 &quot;Thu Jun 16 03:19:22 EDT 2005&quot; 15972 959619 0 0 0 0 5 3 5
2301 25 jdk1.6.0-b42 &quot;Fri Jun 24 03:38:54 EDT 2005&quot; 15966 958581 0 0 0 0 5 3 5
2302 26 jdk1.6.0-b43 &quot;Thu Jul 14 03:09:34 EDT 2005&quot; 16041 960544 0 0 0 0 5 3 5
2303 27 jdk1.6.0-b44 &quot;Thu Jul 21 03:05:54 EDT 2005&quot; 16041 960547 0 0 0 0 5 3 5
2304 28 jdk1.6.0-b45 &quot;Thu Jul 28 03:26:10 EDT 2005&quot; 16037 960606 0 0 1 0 4 3 4
2305 29 jdk1.6.0-b46 &quot;Thu Aug 04 03:02:48 EDT 2005&quot; 15936 951355 0 0 0 0 4 4 4
2306 30 jdk1.6.0-b47 &quot;Thu Aug 11 03:18:56 EDT 2005&quot; 15964 952387 0 0 1 0 3 4 3
2307 31 jdk1.6.0-b48 &quot;Thu Aug 18 08:10:40 EDT 2005&quot; 15970 953421 0 0 0 0 3 5 3
2308 32 jdk1.6.0-b49 &quot;Thu Aug 25 03:24:38 EDT 2005&quot; 16048 958940 0 0 0 0 3 5 3
2309 33 jdk1.6.0-b50 &quot;Thu Sep 01 01:52:40 EDT 2005&quot; 16287 974937 1 0 0 0 3 5 4
2310 34 jdk1.6.0-b51 &quot;Thu Sep 08 01:55:36 EDT 2005&quot; 16362 979377 0 0 0 0 4 5 4
2311 35 jdk1.6.0-b52 &quot;Thu Sep 15 02:04:08 EDT 2005&quot; 16477 979399 0 0 0 0 4 5 4
2312 36 jdk1.6.0-b53 &quot;Thu Sep 22 02:00:28 EDT 2005&quot; 16019 957900 0 0 1 0 3 5 3
2313 37 jdk1.6.0-b54 &quot;Thu Sep 29 01:54:34 EDT 2005&quot; 16019 957900 0 0 0 0 3 6 3
2314 38 jdk1.6.0-b55 &quot;Thu Oct 06 01:54:14 EDT 2005&quot; 16051 959014 0 0 0 0 3 6 3
2315 39 jdk1.6.0-b56 &quot;Thu Oct 13 01:54:12 EDT 2005&quot; 16211 970835 0 0 0 0 3 6 3
2316 40 jdk1.6.0-b57 &quot;Thu Oct 20 01:55:26 EDT 2005&quot; 16279 971627 0 0 0 0 3 6 3
2317 41 jdk1.6.0-b58 &quot;Thu Oct 27 01:56:30 EDT 2005&quot; 16283 971945 0 0 0 0 3 6 3
2318 42 jdk1.6.0-b59 &quot;Thu Nov 03 01:56:58 EST 2005&quot; 16232 972193 0 0 0 0 3 6 3
2319 43 jdk1.6.0-b60 &quot;Thu Nov 10 01:54:18 EST 2005&quot; 16235 972346 0 0 0 0 3 6 3
2320 </screen>
2321
2322 <para>次に示すコマンドを実行すると、db.xml 中間ファイルを生成することなく直接同じ情報を作成できます。</para>
2323
2324 <screen>
2325 computeBugHistory jdk1.6.0-b*/jre/lib/rt.xml | filterBugs -bugPattern IL_ db.xml | mineBugHistory -formatDates
2326 </screen>
2327
2328 <para>この情報を使って、 Sun JDK1.6.0 の各ビルドにおいて FindBugs によって発見された無限再起ループの数を表すグラフを表示します。青色の領域は、当該ビルドにおける無限再起ループの数を表しています。その上に描かれている赤色の領域は、以前のバージョンには存在したが当該バージョンでは除去された無限再起ループの数を表しています。 (したがって、赤色の領域と青色の領域を足し合わせた高さは決して減少しないことが保証されています。そして、新たに無限再起ループのバグが持ち込まれた時点で増加します) 。赤色の領域の高さは、当該バージョンにおいて修正または削除されたバグ数の合計で算出されます。バージョン 13 および 14 において見られる減少は、 FindBugs を使用して見つかった JDK のバグの報告を Sun が受け取ったことによるものです。</para>
2329 <mediaobject>
2330 <imageobject>
2331 <imagedata fileref="infiniteRecursiveLoops.png"/>
2332 </imageobject>
2333 </mediaobject>
2334
2335 <para>db.xml ファイルは、 jdk1.6.0 のすべてのビルドに対する検索結果を保持しています。したがって、次に示すコマンドを実行することで、優先度(高)または優先度(低)の正確性に関する警告の履歴が表示されます :</para>
2336
2337 <screen>
2338 filterBugs -priority M -category C db.xml | mineBugHistory -formatDates
2339 </screen>
2340
2341 <para>作成される表の例 :</para>
2342
2343 <screen>
2344 seq version time classes NCSS added newCode fixed removed retained dead active
2345 0 jdk1.6.0-b12 &quot;Thu Nov 11 09:07:20 EST 2004&quot; 13128 811569 0 1075 0 0 0 0 1075
2346 1 jdk1.6.0-b13 &quot;Thu Nov 18 06:02:06 EST 2004&quot; 13128 811570 0 0 0 0 1075 0 1075
2347 2 jdk1.6.0-b14 &quot;Thu Dec 02 06:12:26 EST 2004&quot; 13145 811786 3 0 6 0 1069 0 1072
2348 3 jdk1.6.0-b15 &quot;Thu Dec 09 06:07:04 EST 2004&quot; 13174 811693 2 1 3 0 1069 6 1072
2349 4 jdk1.6.0-b16 &quot;Thu Dec 16 06:21:28 EST 2004&quot; 13175 811715 0 0 1 0 1071 9 1071
2350 5 jdk1.6.0-b17 &quot;Thu Dec 23 06:27:22 EST 2004&quot; 13176 811974 0 0 1 0 1070 10 1070
2351 6 jdk1.6.0-b19 &quot;Thu Jan 13 06:41:16 EST 2005&quot; 13176 812011 0 0 0 0 1070 11 1070
2352 7 jdk1.6.0-b21 &quot;Thu Jan 27 05:57:52 EST 2005&quot; 13177 812173 0 0 1 0 1069 11 1069
2353 8 jdk1.6.0-b23 &quot;Thu Feb 10 05:44:36 EST 2005&quot; 13179 812188 0 0 0 0 1069 12 1069
2354 9 jdk1.6.0-b26 &quot;Thu Mar 03 06:04:02 EST 2005&quot; 13199 811770 0 0 2 1 1066 12 1066
2355 10 jdk1.6.0-b27 &quot;Thu Mar 10 04:48:38 EST 2005&quot; 13189 812440 1 0 1 1 1064 15 1065
2356 11 jdk1.6.0-b28 &quot;Thu Mar 17 02:54:22 EST 2005&quot; 13185 812056 0 0 0 0 1065 17 1065
2357 12 jdk1.6.0-b29 &quot;Thu Mar 24 03:09:20 EST 2005&quot; 13117 809468 3 0 8 26 1031 17 1034
2358 13 jdk1.6.0-b30 &quot;Thu Mar 31 02:53:32 EST 2005&quot; 13118 809501 0 0 0 0 1034 51 1034
2359 14 jdk1.6.0-b31 &quot;Thu Apr 07 03:00:14 EDT 2005&quot; 13117 809572 0 0 0 0 1034 51 1034
2360 15 jdk1.6.0-b32 &quot;Thu Apr 14 02:56:56 EDT 2005&quot; 13169 811096 1 1 0 1 1033 51 1035
2361 16 jdk1.6.0-b33 &quot;Thu Apr 21 02:46:22 EDT 2005&quot; 13187 811942 3 0 2 1 1032 52 1035
2362 17 jdk1.6.0-b34 &quot;Thu Apr 28 02:49:00 EDT 2005&quot; 13195 813488 0 1 0 0 1035 55 1036
2363 18 jdk1.6.0-b35 &quot;Thu May 05 02:49:04 EDT 2005&quot; 13457 829837 0 36 2 0 1034 55 1070
2364 19 jdk1.6.0-b36 &quot;Thu May 12 02:59:46 EDT 2005&quot; 13462 831278 0 0 0 0 1070 57 1070
2365 20 jdk1.6.0-b37 &quot;Thu May 19 02:55:08 EDT 2005&quot; 13464 831971 0 1 1 0 1069 57 1070
2366 21 jdk1.6.0-b38 &quot;Thu May 26 03:08:16 EDT 2005&quot; 13564 836565 1 7 2 6 1062 58 1070
2367 22 jdk1.6.0-b39 &quot;Fri Jun 03 03:10:48 EDT 2005&quot; 13856 849992 6 39 5 0 1065 66 1110
2368 23 jdk1.6.0-b40 &quot;Thu Jun 09 03:30:28 EDT 2005&quot; 15972 959619 7 147 11 0 1099 71 1253
2369 24 jdk1.6.0-b41 &quot;Thu Jun 16 03:19:22 EDT 2005&quot; 15972 959619 0 0 0 0 1253 82 1253
2370 25 jdk1.6.0-b42 &quot;Fri Jun 24 03:38:54 EDT 2005&quot; 15966 958581 3 0 1 2 1250 82 1253
2371 26 jdk1.6.0-b43 &quot;Thu Jul 14 03:09:34 EDT 2005&quot; 16041 960544 5 11 15 8 1230 85 1246
2372 27 jdk1.6.0-b44 &quot;Thu Jul 21 03:05:54 EDT 2005&quot; 16041 960547 0 0 0 0 1246 108 1246
2373 28 jdk1.6.0-b45 &quot;Thu Jul 28 03:26:10 EDT 2005&quot; 16037 960606 19 0 2 0 1244 108 1263
2374 29 jdk1.6.0-b46 &quot;Thu Aug 04 03:02:48 EDT 2005&quot; 15936 951355 13 1 1 32 1230 110 1244
2375 30 jdk1.6.0-b47 &quot;Thu Aug 11 03:18:56 EDT 2005&quot; 15964 952387 163 8 7 20 1217 143 1388
2376 31 jdk1.6.0-b48 &quot;Thu Aug 18 08:10:40 EDT 2005&quot; 15970 953421 0 0 0 0 1388 170 1388
2377 32 jdk1.6.0-b49 &quot;Thu Aug 25 03:24:38 EDT 2005&quot; 16048 958940 1 11 1 0 1387 170 1399
2378 33 jdk1.6.0-b50 &quot;Thu Sep 01 01:52:40 EDT 2005&quot; 16287 974937 19 27 16 7 1376 171 1422
2379 34 jdk1.6.0-b51 &quot;Thu Sep 08 01:55:36 EDT 2005&quot; 16362 979377 1 15 3 0 1419 194 1435
2380 35 jdk1.6.0-b52 &quot;Thu Sep 15 02:04:08 EDT 2005&quot; 16477 979399 0 0 1 1 1433 197 1433
2381 36 jdk1.6.0-b53 &quot;Thu Sep 22 02:00:28 EDT 2005&quot; 16019 957900 13 12 16 20 1397 199 1422
2382 37 jdk1.6.0-b54 &quot;Thu Sep 29 01:54:34 EDT 2005&quot; 16019 957900 0 0 0 0 1422 235 1422
2383 38 jdk1.6.0-b55 &quot;Thu Oct 06 01:54:14 EDT 2005&quot; 16051 959014 1 4 7 0 1415 235 1420
2384 39 jdk1.6.0-b56 &quot;Thu Oct 13 01:54:12 EDT 2005&quot; 16211 970835 6 8 37 0 1383 242 1397
2385 40 jdk1.6.0-b57 &quot;Thu Oct 20 01:55:26 EDT 2005&quot; 16279 971627 0 0 0 0 1397 279 1397
2386 41 jdk1.6.0-b58 &quot;Thu Oct 27 01:56:30 EDT 2005&quot; 16283 971945 0 1 1 0 1396 279 1397
2387 42 jdk1.6.0-b59 &quot;Thu Nov 03 01:56:58 EST 2005&quot; 16232 972193 6 0 5 0 1392 280 1398
2388 43 jdk1.6.0-b60 &quot;Thu Nov 10 01:54:18 EST 2005&quot; 16235 972346 0 0 0 0 1398 285 1398
2389 44 jdk1.6.0-b61 &quot;Thu Nov 17 01:58:42 EST 2005&quot; 16202 971134 2 0 4 0 1394 285 1396
2390 </screen>
2391 </sect2>
2392
2393 <sect2 id="incrementalhistory">
2394 <title>増分履歴メンテナンス</title>
2395
2396 <para>仮に、 db.xml がビルド b12 - b60 に対する findbugs 実行結果を保持している場合、次に示すコマンドを実行することで、 db.xml に b61 に対する実行結果を追加することができます :</para>
2397 <screen>
2398 computeBugHistory -output db.xml db.xml jdk1.6.0-b61/jre/lib/rt.xml
2399 </screen>
2400 </sect2>
2401
2402 </sect1>
2403
2404 <sect1 id="antexample">
2405 <title>Ant の例</title>
2406 <para>findbugs の実行とその後のデータ・マイニングツールの活用の両方を実行している ant スクリプトの完全な例を以下に示します :</para>
2407 <screen>
2408 <![CDATA[
2409 <project name="analyze_asm_util" default="findbugs">
2410 <!-- findbugs タスク定義 -->
2411 <property name="findbugs.home" value="/Users/ben/Documents/workspace/findbugs/findbugs" />
2412 <property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en -Duser.region=EN -Dfindbugs.home=${findbugs.home}" />
2413
2414 <path id="findbugs.lib">
2415 <fileset dir="${findbugs.home}/lib">
2416 <include name="findbugs-ant.jar"/>
2417 </fileset>
2418 </path>
2419
2420 <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
2421 <classpath refid="findbugs.lib" />
2422 </taskdef>
2423
2424 <taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask">
2425 <classpath refid="findbugs.lib" />
2426 </taskdef>
2427
2428 <taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask">
2429 <classpath refid="findbugs.lib" />
2430 </taskdef>
2431
2432 <taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask">
2433 <classpath refid="findbugs.lib" />
2434 </taskdef>
2435
2436 <!-- findbugs タスク定義 -->
2437 <target name="findbugs">
2438 <antcall target="analyze" />
2439 <antcall target="mine" />
2440 </target>
2441
2442 <!-- 分析を行うタスク-->
2443 <target name="analyze">
2444 <!-- asm-util に対して findbugs を実行する -->
2445 <findbugs home="${findbugs.home}"
2446 output="xml:withMessages"
2447 timeout="90000000"
2448 reportLevel="experimental"
2449 workHard="true"
2450 effort="max"
2451 adjustExperimental="true"
2452 jvmargs="${jvmargs}"
2453 failOnError="true"
2454 outputFile="out.xml"
2455 projectName="Findbugs"
2456 debug="false">
2457 <class location="asm-util-3.0.jar" />
2458 </findbugs>
2459 </target>
2460
2461 <target name="mine">
2462
2463 <!-- 最新の分析結果に情報を設定する -->
2464 <setBugDatabaseInfo home="${findbugs.home}"
2465 withMessages="true"
2466 name="asm-util-3.0.jar"
2467 input="out.xml"
2468 output="out-rel.xml"/>
2469
2470 <!-- 履歴ファイル (out-hist.xml) が既に存在するかどうかを確認する -->
2471 <condition property="mining.historyfile.available">
2472 <available file="out-hist.xml"/>
2473 </condition>
2474 <condition property="mining.historyfile.notavailable">
2475 <not>
2476 <available file="out-hist.xml"/>
2477 </not>
2478 </condition>
2479
2480 <!-- このターゲットは、履歴ファイルが存在しないとき (初回) だけ実行されます -->
2481 <antcall target="history-init">
2482 <param name="data.file" value="out-rel.xml" />
2483 <param name="hist.file" value="out-hist.xml" />
2484 </antcall>
2485 <!-- 上記以外の場合に実行されます -->
2486 <antcall target="history">
2487 <param name="data.file" value="out-rel.xml" />
2488 <param name="hist.file" value="out-hist.xml" />
2489 <param name="hist.summary.file" value="out-hist.txt" />
2490 </antcall>
2491 </target>
2492
2493 <!-- 履歴ファイルを初期化します -->
2494 <target name="history-init" if="mining.historyfile.notavailable">
2495 <copy file="${data.file}" tofile="${hist.file}" />
2496 </target>
2497
2498 <!-- バグ履歴を算出します -->
2499 <target name="history" if="mining.historyfile.available">
2500 <!-- ${data.file} を ${hist.file} にマージします -->
2501 <computeBugHistory home="${findbugs.home}"
2502 withMessages="true"
2503 output="${hist.file}">
2504 <dataFile name="${hist.file}"/>
2505 <dataFile name="${data.file}"/>
2506 </computeBugHistory>
2507
2508 <!-- 履歴を算出して ${hist.summary.file} に出力します -->
2509 <mineBugHistory home="${findbugs.home}"
2510 formatDates="true"
2511 noTabs="true"
2512 input="${hist.file}"
2513 output="${hist.summary.file}"/>
2514 </target>
2515
2516 </project>
2517 ]]>
2518 </screen>
2519 </sect1>
2520 </chapter>
2521
2522
2523 <!--
2524 **************************************************************************
2525 License
2526 **************************************************************************
2527 -->
2528
2529 <chapter id="license">
2530 <title>ライセンス</title>
2531
2532 <para>名称「FindBugs」および FindBugs のロゴは、メリーランド大学の登録商標です。FindBugs はフリーソフトウェアであり、 <ulink url="http://www.gnu.org/licenses/lgpl.html">Lesser GNU Public License</ulink> の条件で配布されています。使用承諾書を入手したい場合は、 &FindBugs; 配布物に含まれる <filename>LICENSE.txt</filename> ファイルを参照してください。</para>
2533
2534 <para>最新バージョンの FindBugs および そのソースコードは <ulink url="http://findbugs.sourceforge.net">FindBugs web ページ</ulink> で入手できます。</para>
2535
2536 </chapter>
2537
2538
2539 <!--
2540 **************************************************************************
2541 Acknowledgments
2542 **************************************************************************
2543 -->
2544 <chapter id="acknowledgments">
2545 <title>謝辞</title>
2546
2547 <sect1>
2548 <title>貢献者</title>
2549
2550 <para>&FindBugs; was originally written by Bill Pugh (<email>pugh@cs.umd.edu</email>).
2551 David Hovemeyer (<email>daveho@cs.umd.edu</email>) implemented some of the
2552 detectors, added the Swing GUI, and is a co-maintainer.</para>
2553
2554 <para>Mike Fagan (<email>mfagan@tde.com</email>) contributed the &Ant; build script,
2555 the &Ant; task, and several enhancements and bug fixes to the GUI.</para>
2556
2557 <para>Germano Leichsenring contributed Japanese translations of the bug
2558 summaries.</para>
2559
2560 <para>David Li contributed the Emacs bug report format.</para>
2561
2562 <para>Peter D. Stout contributed recursive detection of Class-Path
2563 attributes in analyzed Jar files, German translations of
2564 text used in the Swing GUI, and other fixes.</para>
2565
2566 <para>Peter Friese wrote the &FindBugs; Eclipse plugin.</para>
2567
2568 <para>Rohan Lloyd contributed several Mac OS X enhancements,
2569 bug detector improvements,
2570 and maintains the Fink package for &FindBugs;.</para>
2571
2572 <para>Hiroshi Okugawa translated the &FindBugs; manual and
2573 more of the bug summaries into Japanese.</para>
2574
2575 <para>Phil Crosby enhanced the Eclipse plugin to add a view
2576 to display the bug details.</para>
2577
2578 <para>Dave Brosius fixed a number of bugs, added user preferences
2579 to the Swing GUI, improved several bug detectors, and
2580 contributed the string concatenation detector.</para>
2581
2582 <para>Thomas Klaeger contributed a number of bug fixes and
2583 bug detector improvements.</para>
2584
2585 <para>Andrei Loskutov made a number of improvements to the
2586 Eclipse plugin.</para>
2587
2588 <para>Brian Goetz contributed a major refactoring of the
2589 visitor classes to improve readability and understandability.</para>
2590
2591 <para> Pete Angstadt fixed several problems in the Swing GUI.</para>
2592
2593 <para>Francis Lalonde provided a task resource file for the
2594 FindBugs Ant task.</para>
2595
2596 <para>Garvin LeClaire contributed support for output in
2597 Xdocs format, for use by Maven.</para>
2598
2599 <para>Holger Stenzhorn contributed improved German translations of items
2600 in the Swing GUI.</para>
2601
2602 <para>Juha Knuutila contributed Finnish translations of items
2603 in the Swing GUI.</para>
2604
2605 <para>Tanel Lebedev contributed Estonian translations of items
2606 in the Swing GUI.</para>
2607
2608 <para>Hanai Shisei (ruimo) contributed full Japanese translations of
2609 bug messages, and text used in the Swing GUI.</para>
2610
2611 <para>David Cotton contributed Fresh translations for bug
2612 messages and for the Swing GUI.</para>
2613
2614 <para>Michael Tamm contributed support for the &quot;errorProperty&quot; attribute
2615 in the Ant task.</para>
2616
2617 <para>Thomas Kuehne improved the German translation of the Swing GUI.</para>
2618
2619 <para>Len Trigg improved source file support for the Emacs output mode.</para>
2620
2621 <para>Greg Bentz provided a fix for the hashcode/equals detector.</para>
2622
2623 <para>K. Hashimoto contributed internationalization fixes and several other
2624 bug fixes.</para>
2625
2626 <para>
2627 Glenn Boysko contributed support for ignoring specified local
2628 variables in the dead local store detector.
2629 </para>
2630
2631 <para>
2632 Jay Dunning contributed a detector to find equality comparisons
2633 of floating-point values, and overhauled the analysis summary
2634 report and its representation in the saved XML format.
2635 </para>
2636
2637 <para>
2638 Olivier Parent contributed updated French translations for bug descriptions and
2639 Swing GUI.
2640 </para>
2641
2642 <para>
2643 Chris Nappin contributed the <filename>plain.xsl</filename>
2644 stylesheet.
2645 </para>
2646
2647 <para>
2648 Etienne Giraudy contributed the <filename>fancy.xsl</filename> and <filename>fancy-hist.xsl</filename>
2649 stylesheets, and made improvements to the <command>-xml:withMessages</command>
2650 option.
2651 </para>
2652
2653 <para>
2654 Takashi Okamoto fixed bugs in the project preferences dialog
2655 in the Eclipse plugin, and contributed to its internationalization and localization.
2656 </para>
2657
2658 <para>Thomas Einwaller fixed bugs in the project preferences dialog in the Eclipse plugin.</para>
2659
2660 <para>Jeff Knox contributed support for the warningsProperty attribute
2661 in the Ant task.</para>
2662
2663 <para>Peter Hendriks extended the Eclipse plugin preferences,
2664 and fixed a bug related to renaming the Eclipse plugin ID.</para>
2665
2666 <para>Mark McKay contributed an Ant task to launch the findbugs frame.</para>
2667
2668 <para>Dieter von Holten (dvholten) contributed
2669 some German improvements to findbugs_de.properties.</para>
2670
2671
2672 <para>If you have contributed to &FindBugs;, but aren't mentioned above,
2673 please send email to <email>findbugs@cs.umd.edu</email> (and also accept
2674 our humble apologies).</para>
2675
2676 </sect1>
2677
2678 <sect1>
2679 <title>使用しているソフトウェア</title>
2680
2681 <para>&FindBugs; は、いくつかのオープンソースソフトウェアパッケージを使用しています。これらがなければ、 &FindBugs; の開発は、より一層困難なものになったことでしょう。</para>
2682
2683 <sect2>
2684 <title>BCEL</title>
2685 <para>&FindBugs; includes software developed by the Apache Software Foundation
2686 (<ulink url="http://www.apache.org/">http://www.apache.org/</ulink>).
2687 Specifically, it uses the <ulink url="http://jakarta.apache.org/bcel/">Byte Code
2688 Engineering Library</ulink>.</para>
2689 </sect2>
2690
2691 <sect2>
2692 <title>ASM</title>
2693 <para>&FindBugs; uses the <ulink url="http://asm.objectweb.org/">ASM</ulink>
2694 bytecode framework, which is distributed under the following license:</para>
2695
2696 <blockquote>
2697 <para>
2698 Copyright (c) 2000-2005 INRIA, France Telecom
2699 All rights reserved.
2700 </para>
2701
2702 <para>
2703 Redistribution and use in source and binary forms, with or without
2704 modification, are permitted provided that the following conditions
2705 are met:
2706 </para>
2707
2708 <orderedlist numeration="arabic">
2709 <listitem><para>
2710 Redistributions of source code must retain the above copyright
2711 notice, this list of conditions and the following disclaimer.
2712 </para></listitem>
2713 <listitem><para>
2714 Redistributions in binary form must reproduce the above copyright
2715 notice, this list of conditions and the following disclaimer in the
2716 documentation and/or other materials provided with the distribution.
2717 </para></listitem>
2718 <listitem><para>
2719 Neither the name of the copyright holders nor the names of its
2720 contributors may be used to endorse or promote products derived from
2721 this software without specific prior written permission.
2722 </para></listitem>
2723 </orderedlist>
2724
2725 <para>
2726 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
2727 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2728 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2729 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2730 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2731 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2732 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2733 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2734 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2735 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2736 THE POSSIBILITY OF SUCH DAMAGE.
2737 </para>
2738 </blockquote>
2739 </sect2>
2740
2741 <sect2>
2742 <title>DOM4J</title>
2743 <para>&FindBugs; uses <ulink url="http://dom4j.org">DOM4J</ulink>, which is
2744 distributed under the following license:</para>
2745
2746 <blockquote>
2747 <para>
2748 Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
2749 </para>
2750
2751 <para>
2752 Redistribution and use of this software and associated documentation
2753 (&quot;Software&quot;), with or without modification, are permitted provided that
2754 the following conditions are met:
2755 </para>
2756
2757 <orderedlist numeration="arabic">
2758 <listitem><para>
2759 Redistributions of source code must retain copyright statements and
2760 notices. Redistributions must also contain a copy of this document.
2761 </para></listitem>
2762 <listitem><para>
2763 Redistributions in binary form must reproduce the above copyright
2764 notice, this list of conditions and the following disclaimer in the
2765 documentation and/or other materials provided with the distribution.
2766 </para></listitem>
2767 <listitem><para>
2768 The name &quot;DOM4J&quot; must not be used to endorse or promote products
2769 derived from this Software without prior written permission
2770 of MetaStuff, Ltd. For written permission, please contact
2771 <email>dom4j-info@metastuff.com</email>.
2772 </para></listitem>
2773 <listitem><para>
2774 Products derived from this Software may not be called &quot;DOM4J&quot; nor may
2775 &quot;DOM4J&quot; appear in their names without prior written permission of
2776 MetaStuff, Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
2777 </para></listitem>
2778 <listitem><para>
2779 Due credit should be given to the DOM4J Project (<ulink url="http://dom4j.org/">http://dom4j.org/</ulink>).
2780 </para></listitem>
2781 </orderedlist>
2782
2783 <para>
2784 THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS''
2785 AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
2786 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2787 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS
2788 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2789 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2790 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
2791 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
2792 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2793 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2794 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2795 </para>
2796 </blockquote>
2797
2798 </sect2>
2799
2800 </sect1>
2801
2802 </chapter>
2803
2804
2805 </book>
+0
-114
doc/performance.html less more
0 <html>
1 <head>
2 <title>FindBugs Performance Improvements and Regressions</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%">
9 <tr>
10
11
12 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
13 <table width="100%" cellspacing="0" border="0">
14 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
15
16 <tr><td>&nbsp;</td></tr>
17
18 <tr><td><b>Docs and Info</b></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
30 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
31
32 <tr><td>&nbsp;</td></tr>
33
34 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
35
36 <tr><td>&nbsp;</td></tr>
37
38 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
39
40 <tr><td>&nbsp;</td></tr>
41
42 <tr><td><b>Development</b></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
51 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
52 </table>
53 </td>
54
55 <td align="left" valign="top">
56
57 <h1>FindBugs Performance Improvements and Regressions</h1> I did a performance check against 179
58 benchmarks applications I regularly test against. Overall (total the total time to analyze all 179
59 benchmarks), FindBugs 2.0 gives a 9% performance improvement over 1.3.9. 154 of the 179 benchmarks saw
60 performance improvements; 24 saw regressions. All of the benchmarks that saw regressions of more than
61 10% were small benchmarks (analyzed in less than 60 seconds), which makes consistent benchmarking
62 particularly difficult. I'm working to repeat the benchmarks, see if the results are consistent. I took
63 a look, and couldn't find anything that stood out as being a performance glitch in FindBugs. I haven't
64 yet done benchmarking with constrained memory. It is possible that you may need to increase the heap
65 size for FindBugs 2.0.
66
67 <h2>Important Request</h2>
68 <p> If you are seeing any significant performance regressions in FindBugs 2.0,
69 I very much need your help. Please either email <a href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
70 or file <a href="http://sourceforge.net/tracker/?atid=614693&amp;group_id=96405&amp;func=browse">a
71 bug report</a>.&nbsp;with the following information from the xml file for your project (from both the
72 1.3.9 and 2.0.0 version if possible). Sending me your code or pointing me to a open source repository
73 would be great, but I know that isn't feasible for a lot of projects. The information I'm requesting
74 doesn't include any information about the code being analyzed other than the total size of the code
75 being analyzed and the total number of issues found at the different confidence levels. The
76 &lt;FindBugsSummary ... &gt; start tag. For example: <quote> <pre>
77 &lt;FindBugsSummary timestamp="Tue, 30 Dec 2008 21:29:52 -0500"
78 total_classes="206" referenced_classes="325" total_bugs="72" total_size="7654" num_packages="21"
79 vm_version="20.4-b02-402" cpu_seconds="62.52" clock_seconds="22.01"
80 peak_mbytes="112.21" alloc_mbytes="1683.38" gc_seconds="1.19"
81 priority_3="56" priority_2="14" priority_1="2"&gt;
82 </pre> </quote> The &lt;FindBugsProfile&gt;...&lt;/FindBugsProfile&gt; element. For example: <quote>
83 <pre>
84 &lt;FindBugsProfile&gt;
85 &lt;ClassProfile name="edu.umd.cs.findbugs.detect.IncompatMask" totalMilliseconds="11"
86 invocations="206" avgMicrosecondsPerInvocation="55" maxMicrosecondsPerInvocation="475"
87 standardDeviationMircosecondsPerInvocation="75"/&gt;
88 &lt;ClassProfile name="edu.umd.cs.findbugs.detect.FindFinalizeInvocations" totalMilliseconds="11"
89 invocations="206" avgMicrosecondsPerInvocation="55" maxMicrosecondsPerInvocation="402"
90 standardDeviationMircosecondsPerInvocation="69"/&gt;
91 &lt;ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.LockDataflowFactory" totalMilliseconds="11"
92 invocations="23" avgMicrosecondsPerInvocation="515" maxMicrosecondsPerInvocation="2637"
93 standardDeviationMircosecondsPerInvocation="639"/&gt;
94 ...
95 &lt;/FindBugsProfile&gt;
96 </pre> </quote>
97 <hr> <p>
98 <script language="JavaScript" type="text/javascript">
99 <!---//hide script from old browsers
100 document.write( "Last updated "+ document.lastModified + "." );
101 //end hiding contents --->
102 </script>
103 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
104 <p>
105 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
106
107 </td>
108
109 </tr>
110 </table>
111
112 </body>
113 </html>
+0
-27
doc/performingARelease.txt less more
0 Create a directory that contains exactly all the files to upload. For example:
1 eclipsePlugin-1.3.6.20081104-source.zip findbugs-1.3.6-rc3-source.zip findbugs-1.3.6-rc3.zip
2 edu.umd.cs.findbugs.plugin.eclipse_1.3.6.20081104.zip findbugs-1.3.6-rc3.tar.gz
3
4 cd to that directory
5 sftp username,findbugs@frs.sourceforge.net
6 sftp> cd /home/frs/project/f/fi/findbugs/findbugs/RELEASE
7 sftp> mput findbugs-*
8 sftp> cd "../../findbugs eclipse plugin/RELEASE
9 fstp> mput edu.* eclipsePlugin*
10 fstp> quit
11
12 Add releases via:
13 https://sourceforge.net/project/admin/editpackages.php?group_id=96405
14
15
16 release daily/candidate/final eclipse plugins
17
18 From findbugs directory, do:
19 rsync -avz web/ username,findbugs@web.sourceforge.net:htdocs/
20
21 For a full release, make a branch in the svn repository:
22
23
24 svn copy "https://findbugs.googlecode.com/svn/trunk" "https://findbugs.googlecode.com/svn/branches/1.X.X"
25
26 For a release candidate, send email to findbugs-discuss and findbugs-core. For a full release, send email to findbugs-announce.
+0
-28
doc/pluginStructure.txt less more
0
1 We have a list of plugins.
2
3 In any particular context, some plugins are enabled.
4
5 DetectorFactoryCollection:
6 Core plugin
7 Collection of plugins
8 Collection of DetectorFactories
9 Adjustment ranker
10
11 I18N
12 ResourceBundles
13 bugPatternMap
14 bugCodeMap
15 categoryDescriptionMap
16
17 Plugin
18 collection of DetectorFactory
19 bug patterns, codes, etc.
20 component plugins
21 bug ranker
22 enabled
23 plugin loader
24
25 CloudFactory
26 registeredClouds
27
+0
-9
doc/plugins.txt less more
0
1 Plugins can be specified in three different ways:
2 * For a standard FindBugd distro, they can be put into the plugins directory
3 * For a JAWS distro, the file pluginlist.properties contains
4 a list of URLs to plugins. These URLs can be relative or absolute. If they
5 are absolute, they are relative to jar file that contained the pluginlist.properties
6 file.
7 * You can define properties findbugs.plugin.*. Each such property defines a URL
8 for a plugin
doc/pressRelease.pdf less more
Binary diff not shown
+0
-138
doc/publications.html less more
0 <html>
1 <head>
2 <title>FindBugs Documents and Publications</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%"><tr>
9
10
11 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
12 <table width="100%" cellspacing="0" border="0">
13 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
14
15 <tr><td>&nbsp;</td></tr>
16
17 <tr><td><b>Docs and Info</b></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
30
31 <tr><td>&nbsp;</td></tr>
32
33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
34
35 <tr><td>&nbsp;</td></tr>
36
37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39 <tr><td>&nbsp;</td></tr>
40
41 <tr><td><b>Development</b></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
51 </table>
52 </td>
53
54 <td align="left" valign="top">
55
56 <h1>FindBugs Documents and Publications</h1>
57
58 <p> This page lists documents, publications, and other sources
59 of information about FindBugs.
60
61 <h2>General Information</h2>
62
63 <ul>
64 <li> The <a href="manual/index.html">FindBugs manual</a> describes how to
65 install and use FindBugs.
66 <li> A <a href="http://www.simeji.com/findbugs/doc/manual_ja/index.html">Japanese translation</a>
67 of the FindBugs manual contributed by Hiroshi Okugawa.
68 <li> A <a href="bugDescriptions.html">list of bug patterns reported by FindBugs</a>.
69 <li> The <a href="FAQ.html">FindBugs FAQ</a> contains answers to frequently asked
70 questions about FindBugs.
71 </ul>
72
73 <h2>Publications</h2>
74
75 <ul>
76 <li> <a href="http://findbugs.sourceforge.net/docs/oopsla2004.pdf">Finding Bugs is Easy</a>, a
77 paper that appeared in the December 2004 issue of SIGPLAN Notices.&nbsp;
78 An extended abstract of the paper appeared in the OOPSLA 2004 Companion,
79 as part of the Onward! track of the conference.&nbsp;
80
81 <!--
82 The raw data
83 we used in the empirical evaluation section is available:
84 <ul>
85 <li> <a href="http://findbugs.sourceforge.net/data/classpath-0.08.xml">classpath-0.08.xml</a>
86 <li> <a href="http://findbugs.sourceforge.net/data/drjava-stable-20040326.xml">drjava-stable-20040326.xml</a>
87 <li> <a href="http://findbugs.sourceforge.net/data/eclipse-3.0.xml">eclipse-3.0.xml</a>
88 <li> <a href="http://findbugs.sourceforge.net/data/jboss-4.0.0RC1.xml">jboss-4.0.0RC1.xml</a>
89 <li> <a href="http://findbugs.sourceforge.net/data/jedit-4.2pre15.xml">jedit-4.2pre15.xml</a>
90 <li> <a href="http://findbugs.sourceforge.net/data/rt-1.5-59.xml">rt-1.5-59.xml</a>
91 </ul>
92 -->
93 <li> <a href="http://www.cs.umd.edu/~jfoster/papers/issre04.pdf">A Comparison of Bug Finding Tools for Java</a>, by Nick Rutar, Christian Almazan, and Jeff Foster,
94 compares several bug checkers for Java, including FindBugs.
95 <li> Chris Grindstaff has written a two-part article about FindBugs
96 (<a href="http://www-106.ibm.com/developerworks/java/library/j-findbug1/">Part 1</a>,
97 <a href="http://www-106.ibm.com/developerworks/java/library/j-findbug2/">Part 2</a>)
98 for IBM developerWorks.
99 </ul>
100
101 <!--
102 <h2>Presentations</h2>
103 <ul>
104 <li> <a href="http://findbugs.sourceforge.net/docs/oopsla2004-slides.pdf">Presentation slides</a>
105 from a talk given by David Hovemeyer at OOPSLA 2004.
106 <li> <a href="http://findbugs.sourceforge.net/docs/FindBugsTalk2.pdf">Presentation slides</a>
107 from a talk given by Bill Pugh at the
108 <a href="http://fc-md.umd.edu/fcmd/index.html"
109 >Fraunhofer Center for Experimental Software Engineering</a>,
110 July 2004
111 <li> <a href="http://findbugs.sourceforge.net/docs/FindBugsJavaOne.pdf">Finding Bugs is Easy</a>,
112 a presentation given by David Hovemeyer and Bill Pugh
113 at <a href="http://java.sun.com/javaone/">JavaOne 2004</a>,
114 June 2004
115 <li> <a href="http://findbugs.sourceforge.net/docs/FindBugsJKeller.pdf">Presentation slides</a>
116 from J. Keller's presentation at the FindBugs JavaOne BOF,
117 June 2004
118 </ul>
119 -->
120
121
122 <hr> <p>
123 <script language="JavaScript" type="text/javascript">
124 <!---//hide script from old browsers
125 document.write( "Last updated "+ document.lastModified + "." );
126 //end hiding contents --->
127 </script>
128 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
129 <p>
130 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
131
132 </td>
133
134 </tr></table>
135
136 </body>
137 </html>
+0
-127
doc/reportingBugs.html less more
0 <html>
1 <head>
2 <title>Reporting Bugs in FindBugs</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%"><tr>
9
10
11 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
12 <table width="100%" cellspacing="0" border="0">
13 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
14
15 <tr><td>&nbsp;</td></tr>
16
17 <tr><td><b>Docs and Info</b></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
30
31 <tr><td>&nbsp;</td></tr>
32
33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
34
35 <tr><td>&nbsp;</td></tr>
36
37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39 <tr><td>&nbsp;</td></tr>
40
41 <tr><td><b>Development</b></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
51 </table>
52 </td>
53
54 <td align="left" valign="top">
55
56 <h1>Reporting Bugs in FindBugs</h1>
57
58 <p>
59 First of all, if you find a bug in FindBugs, and have the
60 skills to fix it, we encourage you to unleash the power of open source and
61 <a href="contributing.html">send us a patch</a>.&nbsp; We will gladly
62 credit you on our website and in the manual.
63 </p>
64
65 <p>
66 Please report bugs using the
67 <a href="http://sourceforge.net/tracker/?atid=614693&group_id=96405&func=browse">Sourceforge
68 bugs tracker</a>.&nbsp; Note that you need to be logged in to sourceforge to
69 use the bug tracker.
70 </p>
71
72 <p>
73 If you cannot use the Sourceforge tracker, you can try sending
74 email to the <a href="http://www.cs.umd.edu/mailman/listinfo/findbugs-discuss"
75 >findbugs-discuss mailing list</a>.&nbsp; You must be subscribed
76 to the list to post a message.
77 </p>
78
79 <p>
80 Finally, as a last resort, you can email <a href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>.&nbsp;
81 However, such emails are much less likely to be handled in a timely manner than
82 posts to the tracker or mailing list.
83 </p>
84
85 <h2>False and Inaccurate Warnings</h2>
86
87 <p>
88 Like most bug-detection tools based on static analysis, FindBugs
89 issues some warnings that do not correspond to real bugs.&nbsp;
90 While in general we would like to make the percentage of such warnings
91 small, we can never fully eliminate them.
92 </p>
93
94 <h2>Information to include</h2>
95
96 <p>
97 When reporting a bug, please include the following information:
98 </p>
99 <ul>
100 <li>Complete list of steps to reproduce the problem</li>
101 <li>If the error occurs during analysis, a jar file, class file,
102 or self-contained Java class that demonstrates the problem</li>
103 <li>FindBugs version</li>
104 <li>JDK/JRE version</li>
105 <li>Host operating system</li>
106 <li>Any exception traces, Eclipse error log entries, etc. that might
107 be relevant</li>
108 </ul>
109
110
111 <hr> <p>
112 <script language="JavaScript" type="text/javascript">
113 <!---//hide script from old browsers
114 document.write( "Last updated "+ document.lastModified + "." );
115 //end hiding contents --->
116 </script>
117 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
118 <p>
119 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
120
121 </td>
122
123 </tr></table>
124
125 </body>
126 </html>
+0
-115
doc/sourceInfo.html less more
0 <html>
1 <head>
2 <title>FindBugs sourceInfo file</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4 </head>
5 <body>
6
7 <table width="100%"><tr>
8
9
10 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
11 <table width="100%" cellspacing="0" border="0">
12 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
13
14 <tr><td>&nbsp;</td></tr>
15
16 <tr><td><b>Docs and Info</b></td></tr>
17 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
29
30 <tr><td>&nbsp;</td></tr>
31
32 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
33
34 <tr><td>&nbsp;</td></tr>
35
36 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
37
38 <tr><td>&nbsp;</td></tr>
39
40 <tr><td><b>Development</b></td></tr>
41 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
50 </table>
51 </td>
52
53 <td align="left" valign="top">
54
55 <h1>FindBugs sourceInfo file</h1>
56
57 <p>The FindBugs analysis engine can be invoked with an optional sourceInfo
58 file. This file gives line number ranges for classes, files and methods. This
59 information is an alternative to getting line number information
60 from the classfiles for methods. Since classfiles only contain line number
61 information
62 for methods, without a sourceInfo file we can't provide line numbers for fields,
63 and for classes we just use the line numbers of the methods in the class.
64
65 <p>The first line of the file should be
66 <pre>
67 sourceInfo version 1.0
68 </pre>
69
70 <p>Following that are a series of lines, each describing a class, field, or method. For each, a starting and ending line number is provided. For example, the following sourceInfo file:
71 <pre>
72 sourceInfo version 1.0
73 a.C,3,8
74 a.C,x,4,4
75 a.C,y,4,4
76 a.C,<init>()V,8,8
77 a.C,f(I)I,5,5
78 a.C,g(Ljava/lang/Object;)I,6,7
79 </pre>
80 provides the following information about the class a.C:
81 <ul>
82 <li> fields x and y are both declared on line 4.
83 <li> the method <code>int f(int)</code> is defined on line 5.
84 <li> the method <code>int g(Object)</code> is defined on lines 6-7.
85 <li> the void constructor for a.C is defined on line 8.
86 </ul>
87 The classnames should be the same format as used by Class.getName():
88 packages are separated by ., inner class names are separated by $.
89 Thus, if the class a.C had an inner class X and it was onb lines 10-15 of the file, the sourceInfo file might contain:
90
91 <pre>
92 a.C$X,10,15
93 </pre>
94
95
96 </table>
97
98
99 <hr> <p>
100 <script language="JavaScript" type="text/javascript">
101 <!---//hide script from old browsers
102 document.write( "Last updated "+ document.lastModified + "." );
103 //end hiding contents --->
104 </script>
105 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
106 <p>
107 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
108
109 </td>
110
111 </tr></table>
112
113 </body>
114 </html>
+0
-202
doc/sysprops.html less more
0 <html>
1 <head>
2 <title>FindBugs Optional System Properties</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4 </head>
5 <body>
6
7 <table width="100%"><tr>
8
9
10 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
11 <table width="100%" cellspacing="0" border="0">
12 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
13
14 <tr><td>&nbsp;</td></tr>
15
16 <tr><td><b>Docs and Info</b></td></tr>
17 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
29
30 <tr><td>&nbsp;</td></tr>
31
32 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
33
34 <tr><td>&nbsp;</td></tr>
35
36 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
37
38 <tr><td>&nbsp;</td></tr>
39
40 <tr><td><b>Development</b></td></tr>
41 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
50 </table>
51 </td>
52
53 <td align="left" valign="top">
54
55 <h1>FindBugs Optional System Properties</h1>
56
57 <p> These system properties can be added to the command line to alter the way
58 findbugs works. These options should be considered experimental. The description
59 gives information if the field is set to true.
60 </p>
61
62 <table width="100%" border="1">
63 <tr bgColor="#F0F0F0"><th>System Property</th><th>Description</th></tr>
64
65 <tr>
66 <td>findbugs.assertionmethods</td>
67 <td>methods supplied by user that have assertions</td>
68 </tr>
69 <tr>
70 <td>findbugs.checkreturn.loadtraining
71 <br/>findbugs.checkreturn.savetraining</td>
72 <td>file name to read/write list of methods whose return values must be checked</td>
73 </tr>
74 <tr>
75 <td>findbugs.de.comment</td>
76 <td>Don't report empty catch blocks if a source comment is found in the block.</td>
77 </tr>
78 <tr>
79 <td>findbugs.dls.exclusions</td>
80 <td>local variables that will be excluded from Dead Local Store</td>
81 </tr>
82 <tr>
83 <td>findbugs.fis.unsyncFactor</td>
84 <td>Default value is 2.0, which means that we report a bug if more than 1/3 of accesses are unsynchronized.</td>
85 </tr>
86 <tr>
87 <td>findbugs.fis.writeBias</td>
88 <td>Default value is 2.0. The idea is that this should be above 1.0, because unsynchronized writes are more dangerous than unsynchronized reads.</td>
89 </tr>
90 <tr>
91 <td>fundbugs.gui.bugCount</td>
92 <td>?</td>
93 </tr>
94 <tr>
95 <td>findbugs.maskedfields.locals</td>
96 <td>Report on local variables that mask fields.</td>
97 </tr>
98 <tr>
99 <td>findbugs.nullderef.assumensp</td>
100 <td>sets value for IsNullValueAnalysisFeatures.UNKNOWN_VALUES_ARE_NSP, but is not used by FindBugs</td>
101 </tr>
102 <tr>
103 <td>findbugs.refcomp.reportAll</td>
104 <td>?</td>
105 </tr>
106 <tr>
107 <td>findbugs.report.SummaryHTML</td>
108 <td>emit SummaryHTML element</td>
109 </tr>
110 <tr>
111 <td>findbugs.sf.comment</td>
112 <td>Ignore switch fall thru bugs if a comment is found with 'fall' or 'nobreak'
113 </tr>
114 <tr>
115 <td>ba.checkAssertions</td>
116 <td>throw excptions on certain illegal class type signatures</td>
117 </tr>
118 <tr>
119 <td>ba.verifyIntegrity</td>
120 <td>enable data structure integrity checks</td>
121 </tr>
122 <tr>
123 <td>BCPMethodReturnCheck.java</td>
124 <td>Add methods to the list requiring a check. (format: "class:method:sig|...")</td>
125 </tr>
126 <tr>
127 <td>dataflow.stackonly</td>
128 <td>?</td>
129 </tr>
130 <tr>
131 <td>fis.eval</td>
132 <td>?</td>
133 </tr>
134 <tr>
135 <td>fis.noAdjustSubclass</td>
136 <td>Adjust field so its class name is the same as the type of reference it is accessed through.</td>
137 </tr>
138 <tr>
139 <td>fos.allowWUS</td>
140 <td>Ignore wrapping streams that are wrapping uninteresting streams (like in memory streams).</td>
141 </tr>
142 <tr>
143 <td>ic.createInstance</td>
144 <td>?</td>
145 </tr>
146 <tr>
147 <td>inva.ncpExtraBranch</td>
148 <td>?</td>
149 </tr>
150 <tr>
151 <td>inva.noAssertHack</td>
152 <td>?</td>
153 </tr>
154 <tr>
155 <td>inva.noSplitDowngradeNSP</td>
156 <td>?</td>
157 </tr>
158 <tr>
159 <td>inva.noSwitchDefaultAsException</td>
160 <td>Don't consider switch default cases as exception paths.</td>
161 </tr>
162 <tr>
163 <td>lineNumberBug</td>
164 <td>Disable the workaround for the bug in BCEL 5.0's LineNumberTable class.</td>
165 </tr>
166 <tr>
167 <td>ma.ugly</td>
168 <td>Report method signature with method class and name.</td>
169 </tr>
170 <tr>
171 <td>mrc.checkall</td>
172 <td>Check for 1.5-specific method return values being ignored even if runtime Java predates 1.5.</td>
173 </tr>
174 <tr>
175 <td>ta.accurateExceptions</td>
176 <td>?</td>
177 </tr>
178 <tr>
179 <td>vna.noRLE</td>
180 <td>Perform redundant load elimination and forward substitution (but not in a correctness-preserving way).</td>
181 </tr>
182
183 </table>
184
185
186 <hr> <p>
187 <script language="JavaScript" type="text/javascript">
188 <!---//hide script from old browsers
189 document.write( "Last updated "+ document.lastModified + "." );
190 //end hiding contents --->
191 </script>
192 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
193 <p>
194 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
195
196 </td>
197
198 </tr></table>
199
200 </body>
201 </html>
+0
-98
doc/team.html less more
0 <html>
1 <head>
2 <title>FindBugs Development Team</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css">
4
5 </head>
6 <body>
7
8 <table width="100%"><tr>
9
10
11 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
12 <table width="100%" cellspacing="0" border="0">
13 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
14
15 <tr><td>&nbsp;</td></tr>
16
17 <tr><td><b>Docs and Info</b></td></tr>
18 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
19 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
30
31 <tr><td>&nbsp;</td></tr>
32
33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
34
35 <tr><td>&nbsp;</td></tr>
36
37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39 <tr><td>&nbsp;</td></tr>
40
41 <tr><td><b>Development</b></td></tr>
42 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
51 </table>
52 </td>
53
54 <td align="left" valign="top">
55
56 <h1>FindBugs Development Team</h1>
57
58 <p> These are the current active members of the FindBugs development team:
59
60 <ul>
61 <li> <a href="http://www.cs.umd.edu/~pugh">Bill Pugh</a> (project lead and primary developer)
62 <li> <a href="http://andrei.gmxhome.de/privat.html">Andrey Loskutov</a>(Eclipse plugin)
63 <li> <a href="http://keithlea.com">Keith Lea</a> (web cloud)
64 </li>
65 </ul>
66
67 <p>Previous and/or inactive members of the FindBugs development team include
68 <ul>
69 <li> <a href="http://goose.ycp.edu/~dhovemey/">David Hovemeyer</a> (project founder),
70 did Ph.D. thesis on FindBugs
71 <li> Nay Ayewah
72 <li> Ben Langmead
73 <li> Tomas Pollak (Eclipse plugin tests)
74 <li> Phil Crosby
75 <li> Peter Friese (Eclipse plugin)
76 <li> Dave Brosius
77 <li> Brian Goetz
78 <li> Rohan Lloyd
79 </ul>
80
81
82 <hr> <p>
83 <script language="JavaScript" type="text/javascript">
84 <!---//hide script from old browsers
85 document.write( "Last updated "+ document.lastModified + "." );
86 //end hiding contents --->
87 </script>
88 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
89 <p>
90 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
91
92 </td>
93
94 </tr></table>
95
96 </body>
97 </html>
doc/umdFindbugs.png less more
Binary diff not shown
+0
-123
doc/updateChecking.html less more
0 <html>
1 <head>
2 <title>Update checking in FindBugs</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css" />
4
5 </head>
6
7 <body>
8
9 <table width="100%">
10 <tr>
11
12
13 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
14 <table width="100%" cellspacing="0" border="0">
15 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
16
17 <tr><td>&nbsp;</td></tr>
18
19 <tr><td><b>Docs and Info</b></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
30 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
31 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
32
33 <tr><td>&nbsp;</td></tr>
34
35 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
36
37 <tr><td>&nbsp;</td></tr>
38
39 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
40
41 <tr><td>&nbsp;</td></tr>
42
43 <tr><td><b>Development</b></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
51 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
52 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
53 </table>
54 </td>
55
56 <td align="left" valign="top">
57
58 <h1>Update checking in FindBugs</h1>
59
60 <p>When FindBugs is run, it now checks for updated versions of FindBugs or plugins. As a side effect
61 of this, our server sees a request for whether there are any updated version of FindBugs available.
62 Third party plugins can independently receive this same information. We are recording
63 information about the operating system, Java version, locale, and Findbugs entry point (ant, command line,
64 GUI, etc), in order to better understand our users.
65
66 <p>For example, here is an example of the information that would be sent to the server:
67 <pre>
68 &lt;?xml version="1.0" encoding="UTF-8"?>
69
70 &lt;findbugs-invocation version="2.0.0-rc1" app-name="UpdateChecker" app-version="" entry-point="UpdateChecker" os="Mac OS X"
71 java-version="1.6" language="en" country="US" uuid="-4bcf8f48ba2842d2"&gt;
72 &lt;plugin id="edu.umd.cs.findbugs.plugins.core" name="Core FindBugs plugin" version="2.0.0-rc1"/&gt;
73 &lt;plugin id="edu.umd.cs.findbugs.plugins.appengine" name="FindBugs Cloud Plugin" version=""/&gt;
74 &lt;plugin id="edu.umd.cs.findbugs.plugins.poweruser" name="Power user commnand line tools" version=""/&gt;
75 &lt;/findbugs-invocation&gt;
76 </pre>
77
78 <p>You can run the main method of edu.umd.cs.findbugs.updates.UpdateChecker to see what would be reported
79 for you, and whether update checking is disabled and/or redirected (e.g., run
80 <pre> java -classpath ~/findbugs/lib/findbugs.jar edu.umd.cs.findbugs.updates.UpdateChecker</pre>
81
82 <p>There is one element of the information sent that needs explanation: the uuid. Since we don't report anything like username,
83 when we receive a bunch of update checks from a particular ip address, we don't know if that is one person running FindBugs many times
84 on a single machine, or many users running FindBugs on many different machines So we generate a random 64 bit integer,
85 store it in the Java user preferences, and report that on each use.
86
87 <h2>Disabling or redirecting update checks</h2>
88 <p>Some organizations or individuals may have policies or preferences to not let us know any information about
89 their running of FindBugs. Note that we do not collect any information about the code being analuzed.
90 Even so, we understand that is very important for a few of our users,
91 and provide several ways for you to disable or redirect FindBugs update checks.
92 <ul>
93 <li>There is a FindBugs plugin, noUpdateChecks.jar, which is in findbugs/optionalPlugin in the standard distribution.
94 If this plugin enabled, all update checks are disabled. You can move that plugin from findbugs/optionalPlugin to findbugs/plugin,
95 to disable it for all users of that distribution. You can also copy it to <pre>~/.findbugs/plugin</pre>,
96 which will disable it for your account for any distribution of FindBugs you invoke (NOTE: double check location
97 of personal FindBugs plugin installation for Windows User).
98 <li>There are noUpdateChecks distributions of FindBugs available from SourceForge. This come with the noUpdateChecks plugin
99 already moved to findbugs/plugin, and the webCloudClient.jar plug in the optional plugin directory (where it is disabled by default).
100
101 <li>You can also redirect all update checks to a local server. This allows you to collect information about who is using
102 what versions of FindBugs in your organization, and keep all of that information private.
103 <li>All of the plugins from the FindBugs project use <pre>http://update.findbugs.org/update-check</pre> as the
104 host we use for update checks. If you wish to ensure that no one from your organization accidently reports any usage
105 information to the FindBugs project, you can blacklist that URL in your firewall
106 <ul>
107 <li>You can also block <pre>http://findbugs-cloud.appspot.com</pre>, the host we use for our publicly hosted
108 repository of bug evaluations (e.g., evaluations in open source projects such as the JDK, Eclipse and GlassFish).
109 While people have to explicitly request that their evaluations be stored into the FindBugs cloud, you
110 can block it to ensure that no one accidently shares evaluations of your own code to the FindBugs cloud. You can also
111 remove the WebCloudClient
112
113 </ul>
114 </li>
115 </ul>
116
117
118 </tr>
119 </table>
120
121 </body>
122 </html>
+0
-199
doc/users.html less more
0 <html>
1 <head>
2 <title>FindBugs&trade; Users and Supporters</title>
3 <link rel="stylesheet" type="text/css" href="findbugs.css" />
4
5 </head>
6
7 <body>
8
9 <table width="100%">
10 <tr>
11
12
13 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%">
14 <table width="100%" cellspacing="0" border="0">
15 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr>
16
17 <tr><td>&nbsp;</td></tr>
18
19 <tr><td><b>Docs and Info</b></td></tr>
20 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr>
21 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr>
22 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr>
23 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr>
24 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr>
25 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr>
26 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr>
27 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr>
28 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr>
29 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr>
30 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr>
31 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr>
32
33 <tr><td>&nbsp;</td></tr>
34
35 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr>
36
37 <tr><td>&nbsp;</td></tr>
38
39 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
40
41 <tr><td>&nbsp;</td></tr>
42
43 <tr><td><b>Development</b></td></tr>
44 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr>
45 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr>
46 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr>
47 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr>
48 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr>
49 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr>
50 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr>
51 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr>
52 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr>
53 </table>
54 </td>
55
56 <td align="left" valign="top">
57
58 <!--
59 <p>
60 <a href="http://findbugs.sourceforge.net/"><img src="buggy-sm.png" alt="FindBugs logo" border="0" /></a>
61 <a href="http://www.umd.edu/"><img src="informal.png" alt="UMD logo" border="0" /></a>
62 </p>
63 -->
64
65 <h1>
66 FindBugs Users
67 </h1>
68
69 <p>
70 There are a
71 <em>lot</em> of FindBugs users; as of September 2006, we've had
72 more than 270,000 downloads.
73
74 </p>
75 <p>
76 FindBugs is used in many companies and organizations. We don't
77 have a list of all the users of FindBugs, and we don't have
78 permission to identify many of the companies where we know
79 FindBugs is being used (getting this permission often involves red
80 tape and lawyers). But here are some statics from Google Analytics
81 showing unique visitors to the FindBugs web pages for the months
82 of June through August, 2006.
83
84 </p>
85 <p align="center">
86 <img src="customers/geoLocation.png" alt="Downloads by country">
87 </p>
88 <p align="center">
89 <img src="customers/geoMap.png" alt="Cities with the most downloads">
90
91 </p>
92 <h2>
93 FindBugs Users
94 </h2>
95 <p>
96 The following companies, projects and organizations have given us
97 permission to identify them as FindBugs users and/or have
98 publically stated that they use FindBugs. Send email to
99 <a href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a> if
100 you'd like to be listed here.
101 </p>
102
103 <table cellpadding="10pt" align="center">
104 <tr>
105 <td align="center">
106 <a href="http://itasoftware.com/"><img
107 src="customers/ITAsoftware.png" alt="ITA Software">
108 </a>
109 </td>
110 <td align="center">
111 <a href="https://glassfish.dev.java.net/"><img
112 src="customers/glassfish.png" alt="Glassfish">
113 </a>
114 </td>
115 </tr>
116 <tr>
117 <td align="center">
118 <a href="https://javaserverfaces.dev.java.net/">Java Server
119 Faces</a>
120 </td>
121 <td align="center">
122 <a href="http://www.objectlab.co.uk/"><img
123 src="http://www.objectlab.co.uk/images/objectlab-web-noblue.gif"
124 alt="ObjectLab">
125 </a>
126 </td>
127 </tr>
128 <tr>
129 <td align="center">
130 <a href="http://www.sat4j.org/"><img
131 src="customers/sat4j.png" alt="SAT 4j">
132 </a>
133 </td>
134 <td align="center">
135 <a href="http://www.sleepycat.com/"><img
136 src="customers/sleepycat.png" alt="SleepyCat">
137 </a>
138 </td>
139 </tr>
140 </table>
141 <h2>
142 FindBugs Supporters
143 </h2>
144 <p>
145 The following companies, organizations and institutions provide
146 financial support for FindBugs. Tax deductable donations to
147 support FindBugs can be made to the University of Maryland.
148
149 </p>
150
151 <table cellpadding="10pt" align="center">
152
153 <tr>
154 <td align="center">
155 <a href="http://www.google.com"><img
156 src="customers/google.png" alt="Google">
157 </a>
158 </td>
159 </tr>
160 <tr>
161 <td align="center">
162 <a href="http://www.sun.com"><img src="customers/sun.png"
163 alt="Sun Microsystems">
164 </a>
165 </td>
166 <td align="center">
167 <a href="http://www.nsf.gov/"><img src="customers/nsf.png"
168 alt="National Science Foundation">
169 </a>
170 </td>
171 </tr>
172 <tr>
173 <td align="center">
174 <a href="http://www.cs.umd.edu/"><img
175 src="customers/logo_umd.png" alt="Univ. of Maryland">
176 </a>
177 </td>
178 </tr>
179 </table>
180
181
182
183 <hr> <p>
184 <script language="JavaScript" type="text/javascript">
185 <!---//hide script from old browsers
186 document.write( "Last updated "+ document.lastModified + "." );
187 //end hiding contents --->
188 </script>
189 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a>
190 <p>
191 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
192
193 </td align="center">
194 </tr>
195 </table>
196
197 </body>
198 </html>
+0
-67
lib/LICENSE_AppleJavaExtensions.txt less more
0
1 AppleJavaExtensions
2 v 1.2
3
4 http://developer.apple.com/samplecode/AppleJavaExtensions/AppleJavaExtensions.html
5
6 This is a pluggable jar of stub classes representing the new Apple
7 eAWT and eIO APIs for Java 1.4 on Mac OS X. The purpose of these
8 stubs is to allow for compilation of eAWT- or eIO-referencing code on
9 platforms other than Mac OS X. These stubs are not intended for the
10 runtime classpath on non-Mac platforms. Please see the OSXAdapter
11 sample for how to write cross-platform code that uses eAWT.
12
13 There is no license file provided for AppleJavaExtensions.jar. Below
14 is a response from Apple to a question about the license.
15
16 On 13 Aug 2004, at 12:33 AM, mdrance@apple.com wrote:
17
18 > Thank you for bringing this up. AppleJavaExtensions is subject to all
19 > the same terms as the other sample code projects from Apple. We will
20 > update the readme to contain the boilerplate legal info. Of course you
21 > can use them on other platforms -- the readme explicitly says this is
22 > their purpose. But I appreciate your caution and attention to detail.
23
24 Below is a copy of the standard Apple sample code disclaimer from another
25 piece of sample code on the same site:
26
27 -------------------------------------------------------------------------
28 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
29 Computer, Inc. ("Apple") in consideration of your agreement to the
30 following terms, and your use, installation, modification or
31 redistribution of this Apple software constitutes acceptance of these
32 terms. If you do not agree with these terms, please do not use,
33 install, modify or redistribute this Apple software.
34
35 In consideration of your agreement to abide by the following terms, and
36 subject to these terms, Apple grants you a personal, non-exclusive
37 license, under Apple's copyrights in this original Apple software (the
38 "Apple Software"), to use, reproduce, modify and redistribute the Apple
39 Software, with or without modifications, in source and/or binary forms;
40 provided that if you redistribute the Apple Software in its entirety and
41 without modifications, you must retain this notice and the following
42 text and disclaimers in all such redistributions of the Apple Software.
43 Neither the name, trademarks, service marks or logos of Apple Computer,
44 Inc. may be used to endorse or promote products derived from the Apple
45 Software without specific prior written permission from Apple. Except
46 as expressly stated in this notice, no other rights or licenses, express
47 or implied, are granted by Apple herein, including but not limited to
48 any patent rights that may be infringed by your derivative works or by
49 other works in which the Apple Software may be incorporated.
50
51 The Apple Software is provided by Apple on an "AS IS" basis. APPLE
52 MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
53 THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
54 FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
55 OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
56
57 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
58 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
59 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
60 INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
61 MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
62 AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
63 STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
64 POSSIBILITY OF SUCH DAMAGE.
65
66 Copyright © 2004 Apple Computer, Inc., All Rights Reserved
lib/asm-src-3.3.zip less more
Binary diff not shown
src/doc/pressRelease.pdf less more
Binary diff not shown