OLD | NEW |
1 <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> | 1 <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> |
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | 2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
3 "file:../etc/docbook/docbookx.dtd" [ | 3 "file:../etc/docbook/docbookx.dtd" [ |
4 <!ENTITY FindBugs "<application>FindBugs</application>"> | 4 <!ENTITY FindBugs "<application>FindBugs</application>"> |
5 <!ENTITY Ant "<application>Ant</application>"> | 5 <!ENTITY Ant "<application>Ant</application>"> |
6 <!ENTITY Saxon "<application>Saxon</application>"> | 6 <!ENTITY Saxon "<application>Saxon</application>"> |
7 <!ENTITY FBHome "<replaceable>$FINDBUGS_HOME</replaceable>"> | 7 <!ENTITY FBHome "<replaceable>$FINDBUGS_HOME</replaceable>"> |
8 <!ENTITY FBHomeWin "<replaceable>%FINDBUGS_HOME%</replaceable>"> | 8 <!ENTITY FBHomeWin "<replaceable>%FINDBUGS_HOME%</replaceable>"> |
9 <!ENTITY nbsp " "> | 9 <!ENTITY nbsp " "> |
10 ]> | 10 ]> |
(...skipping 26 matching lines...) Expand all Loading... |
37 This manual is licensed under the Creative Commons Attribution-NonCommercial-Sha
reAlike License. | 37 This manual is licensed under the Creative Commons Attribution-NonCommercial-Sha
reAlike License. |
38 To view a copy of this license, visit | 38 To view a copy of this license, visit |
39 <ulink url="http://creativecommons.org/licenses/by-nc-sa/1.0/">http://creativeco
mmons.org/licenses/by-nc-sa/1.0/</ulink> | 39 <ulink url="http://creativecommons.org/licenses/by-nc-sa/1.0/">http://creativeco
mmons.org/licenses/by-nc-sa/1.0/</ulink> |
40 or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, Californi
a 94305, USA. | 40 or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, Californi
a 94305, USA. |
41 </para> | 41 </para> |
42 <para> | 42 <para> |
43 The name FindBugs and the FindBugs logo are trademarked by the University of Mar
yland. | 43 The name FindBugs and the FindBugs logo are trademarked by the University of Mar
yland. |
44 </para> | 44 </para> |
45 </legalnotice> | 45 </legalnotice> |
46 | 46 |
47 <edition>2.0.1</edition> | 47 <edition>2.0.3</edition> |
48 | 48 |
49 <pubdate>19:56:04 EDT, 12 July, 2012</pubdate> | 49 <pubdate>17:16:15 EST, 22 November, 2013</pubdate> |
50 | 50 |
51 </bookinfo> | 51 </bookinfo> |
52 | 52 |
53 <!-- | 53 <!-- |
54 ************************************************************************** | 54 ************************************************************************** |
55 Introduction | 55 Introduction |
56 ************************************************************************** | 56 ************************************************************************** |
57 --> | 57 --> |
58 | 58 |
59 <chapter id="introduction"> | 59 <chapter id="introduction"> |
60 <title>Introduction</title> | 60 <title>Introduction</title> |
61 | 61 |
62 <para> &FindBugs;™ is a program to find bugs in Java programs. It looks f
or instances | 62 <para> &FindBugs;™ is a program to find bugs in Java programs. It looks f
or instances |
63 of "bug patterns" --- code instances that are likely to be errors.</para> | 63 of "bug patterns" --- code instances that are likely to be errors.</para> |
64 | 64 |
65 <para> This document describes version 2.0.1 of &FindBugs;.We | 65 <para> This document describes version 2.0.3 of &FindBugs;.We |
66 are very interested in getting your feedback on &FindBugs;. Please visit | 66 are very interested in getting your feedback on &FindBugs;. Please visit |
67 the <ulink url="http://findbugs.sourceforge.net">&FindBugs; web page</ulink> for | 67 the <ulink url="http://findbugs.sourceforge.net">&FindBugs; web page</ulink> for |
68 the latest information on &FindBugs;, contact information, and support resources
such | 68 the latest information on &FindBugs;, contact information, and support resources
such |
69 as information about the &FindBugs; mailing lists.</para> | 69 as information about the &FindBugs; mailing lists.</para> |
70 | 70 |
71 <sect1> | 71 <sect1> |
72 <title>Requirements</title> | 72 <title>Requirements</title> |
73 <para> To use &FindBugs;, you need a runtime environment compatible with | 73 <para> To use &FindBugs;, you need a runtime environment compatible with |
74 <ulink url="http://java.sun.com/j2se">Java 2 Standard Edition</ulink>, version 1
.5 or later. | 74 <ulink url="http://java.sun.com/j2se">Java 2 Standard Edition</ulink>, version 1
.5 or later. |
75 &FindBugs; is platform independent, and is known to run on GNU/Linux, Windows, a
nd | 75 &FindBugs; is platform independent, and is known to run on GNU/Linux, Windows, a
nd |
(...skipping 17 matching lines...) Expand all Loading... |
93 <para> | 93 <para> |
94 This chapter explains how to install &FindBugs;. | 94 This chapter explains how to install &FindBugs;. |
95 </para> | 95 </para> |
96 | 96 |
97 <sect1> | 97 <sect1> |
98 <title>Extracting the Distribution</title> | 98 <title>Extracting the Distribution</title> |
99 | 99 |
100 <para> | 100 <para> |
101 The easiest way to install &FindBugs; is to download a binary distribution. | 101 The easiest way to install &FindBugs; is to download a binary distribution. |
102 Binary distributions are available in | 102 Binary distributions are available in |
103 <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.1.tar.gz?do
wnload">gzipped tar format</ulink> and | 103 <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.tar.gz?do
wnload">gzipped tar format</ulink> and |
104 <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.1.zip?downl
oad">zip format</ulink>. | 104 <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3.zip?downl
oad">zip format</ulink>. |
105 Once you have downloaded a binary distribution, extract it into a directory of y
our choice. | 105 Once you have downloaded a binary distribution, extract it into a directory of y
our choice. |
106 </para> | 106 </para> |
107 | 107 |
108 <para> | 108 <para> |
109 Extracting a gzipped tar format distribution: | 109 Extracting a gzipped tar format distribution: |
110 <screen> | 110 <screen> |
111 <prompt>$ </prompt><command>gunzip -c findbugs-2.0.1.tar.gz | tar xvf -</command
> | 111 <prompt>$ </prompt><command>gunzip -c findbugs-2.0.3.tar.gz | tar xvf -</command
> |
112 </screen> | 112 </screen> |
113 </para> | 113 </para> |
114 | 114 |
115 <para> | 115 <para> |
116 Extracting a zip format distribution: | 116 Extracting a zip format distribution: |
117 <screen> | 117 <screen> |
118 <prompt>C:\Software></prompt><command>unzip findbugs-2.0.1.zip</command> | 118 <prompt>C:\Software></prompt><command>unzip findbugs-2.0.3.zip</command> |
119 </screen> | 119 </screen> |
120 </para> | 120 </para> |
121 | 121 |
122 <para> | 122 <para> |
123 Usually, extracting a binary distribution will create a directory ending in | 123 Usually, extracting a binary distribution will create a directory ending in |
124 <filename class="directory">findbugs-2.0.1</filename>. For example, if you extra
cted | 124 <filename class="directory">findbugs-2.0.3</filename>. For example, if you extra
cted |
125 the binary distribution from the <filename class="directory">C:\Software</filena
me> | 125 the binary distribution from the <filename class="directory">C:\Software</filena
me> |
126 directory, then the &FindBugs; software will be extracted into the directory | 126 directory, then the &FindBugs; software will be extracted into the directory |
127 <filename class="directory">C:\Software\findbugs-2.0.1</filename>. | 127 <filename class="directory">C:\Software\findbugs-2.0.3</filename>. |
128 This directory is the &FindBugs; home directory. We'll refer to it as | 128 This directory is the &FindBugs; home directory. We'll refer to it as |
129 &FBHome; (or &FBHomeWin; for Windows) throughout this manual. | 129 &FBHome; (or &FBHomeWin; for Windows) throughout this manual. |
130 </para> | 130 </para> |
131 </sect1> | 131 </sect1> |
132 | 132 |
133 </chapter> | 133 </chapter> |
134 | 134 |
135 <!-- | 135 <!-- |
136 ************************************************************************** | 136 ************************************************************************** |
137 Compiling FindBugs from Source | 137 Compiling FindBugs from Source |
(...skipping 10 matching lines...) Expand all Loading... |
148 </para> | 148 </para> |
149 | 149 |
150 <sect1> | 150 <sect1> |
151 <title>Prerequisites</title> | 151 <title>Prerequisites</title> |
152 | 152 |
153 <para> | 153 <para> |
154 To compile &FindBugs; from source, you will need the following: | 154 To compile &FindBugs; from source, you will need the following: |
155 <itemizedlist> | 155 <itemizedlist> |
156 <listitem> | 156 <listitem> |
157 <para> | 157 <para> |
158 The <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.1
-source.zip?download" | 158 The <ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3
-source.zip?download" |
159 >&FindBugs; source distribution</ulink> | 159 >&FindBugs; source distribution</ulink> |
160 </para> | 160 </para> |
161 </listitem> | 161 </listitem> |
162 <listitem> | 162 <listitem> |
163 <para> | 163 <para> |
164 <ulink url="http://java.sun.com/j2se/">JDK 1.5.0 or later</ulink> | 164 <ulink url="http://java.sun.com/j2se/">JDK 1.5.0 or later</ulink> |
165 </para> | 165 </para> |
166 </listitem> | 166 </listitem> |
167 <listitem> | 167 <listitem> |
168 <para> | 168 <para> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 </sect1> | 212 </sect1> |
213 | 213 |
214 <sect1> | 214 <sect1> |
215 <title>Extracting the Source Distribution</title> | 215 <title>Extracting the Source Distribution</title> |
216 <para> | 216 <para> |
217 After you download the source distribution, you'll need to extract it into | 217 After you download the source distribution, you'll need to extract it into |
218 a working directory. A typical command to do this is: | 218 a working directory. A typical command to do this is: |
219 | 219 |
220 <screen> | 220 <screen> |
221 <prompt>$ </prompt><command>unzip findbugs-2.0.1-source.zip</command> | 221 <prompt>$ </prompt><command>unzip findbugs-2.0.3-source.zip</command> |
222 </screen> | 222 </screen> |
223 | 223 |
224 </para> | 224 </para> |
225 </sect1> | 225 </sect1> |
226 | 226 |
227 <sect1> | 227 <sect1> |
228 <title>Modifying <filename>local.properties</filename></title> | 228 <title>Modifying <filename>local.properties</filename></title> |
229 <para> | 229 <para> |
230 If you intend to build the FindBugs documentation, | 230 If you intend to build the FindBugs documentation, |
231 you will need to modify the <filename>local.properties</filename> file | 231 you will need to modify the <filename>local.properties</filename> file |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 <term><command>-auxclasspath</command> <replaceable>classpath</replaceable></t
erm> | 931 <term><command>-auxclasspath</command> <replaceable>classpath</replaceable></t
erm> |
932 <listitem> | 932 <listitem> |
933 <para> | 933 <para> |
934 Set the auxiliary classpath for analysis. This classpath should include all | 934 Set the auxiliary classpath for analysis. This classpath should include all |
935 jar files and directories containing classes that are part of the program | 935 jar files and directories containing classes that are part of the program |
936 being analyzed but you do not want to have analyzed for bugs. | 936 being analyzed but you do not want to have analyzed for bugs. |
937 </para> | 937 </para> |
938 </listitem> | 938 </listitem> |
939 </varlistentry> | 939 </varlistentry> |
940 | 940 |
| 941 <varlistentry> |
| 942 <term><command>-userPrefs</command> <replaceable>edu.umd.cs.findbugs.core.pref
s</replaceable></term> |
| 943 <listitem> |
| 944 <para> |
| 945 Set the path of the user preferences file to use, which might override some
of the options abobe. |
| 946 Specifying <literal>userPrefs</literal> as first argument would mean some la
ter |
| 947 options will override them, as last argument would mean they will override s
ome previous options). |
| 948 This rationale behind this option is to reuse FindBugs Eclipse project setti
ngs for command |
| 949 line execution. |
| 950 </para> |
| 951 </listitem> |
| 952 </varlistentry> |
| 953 |
941 <!-- | 954 <!-- |
942 <varlistentry> | 955 <varlistentry> |
943 <term><command></command> <replaceable></replaceable></term> | 956 <term><command></command> <replaceable></replaceable></term> |
944 <listitem> | 957 <listitem> |
945 <para> | 958 <para> |
946 </para> | 959 </para> |
947 </listitem> | 960 </listitem> |
948 </varlistentry> | 961 </varlistentry> |
949 --> | 962 --> |
950 | 963 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 <varlistentry> | 1238 <varlistentry> |
1226 <term><literal>class</literal></term> | 1239 <term><literal>class</literal></term> |
1227 <listitem> | 1240 <listitem> |
1228 <para> | 1241 <para> |
1229 A optional nested element specifying which classes to analyze. The <lite
ral>class</literal> | 1242 A optional nested element specifying which classes to analyze. The <lite
ral>class</literal> |
1230 element must specify a <literal>location</literal> attribute which names
the | 1243 element must specify a <literal>location</literal> attribute which names
the |
1231 archive file (jar, zip, etc.), directory, or class file to be analyzed.
Multiple <literal>class</literal> | 1244 archive file (jar, zip, etc.), directory, or class file to be analyzed.
Multiple <literal>class</literal> |
1232 elements may be specified as children of a single <literal>findbugs</lite
ral> element. | 1245 elements may be specified as children of a single <literal>findbugs</lite
ral> element. |
1233 </para> | 1246 </para> |
1234 <para>In addition to or instead of specifying a <literal>class</literal>
element, | 1247 <para>In addition to or instead of specifying a <literal>class</literal>
element, |
1235 the &FindBugs; task can contain one or more <literal>fileset</literal> e
lement(s) that | 1248 the &FindBugs; task can contain one or more <literal>fileset</literal> e
lement(s) that |
1236 specify files to be analyzed. | 1249 specify files to be analyzed. |
1237 For example, you might use a fileset to specify that all of the jar files
in a directory | 1250 For example, you might use a fileset to specify that all of the jar files
in a directory |
1238 should be analyzed. | 1251 should be analyzed. |
1239 </para> | 1252 </para> |
1240 </listitem> | 1253 </listitem> |
1241 </varlistentry> | 1254 </varlistentry> |
1242 | 1255 |
1243 <varlistentry> | 1256 <varlistentry> |
1244 <term><literal>auxClasspath</literal></term> | 1257 <term><literal>auxClasspath</literal></term> |
1245 <listitem> | 1258 <listitem> |
1246 <para> | 1259 <para> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 </para> | 1298 </para> |
1286 </listitem> | 1299 </listitem> |
1287 </varlistentry> | 1300 </varlistentry> |
1288 | 1301 |
1289 <varlistentry> | 1302 <varlistentry> |
1290 <term><literal>reportLevel</literal></term> | 1303 <term><literal>reportLevel</literal></term> |
1291 <listitem> | 1304 <listitem> |
1292 <para> | 1305 <para> |
1293 An optional attribute. It specifies | 1306 An optional attribute. It specifies |
1294 the confidence/priority threshold for reporting issues. If set to "low",
confidence is not used to filter bugs. | 1307 the confidence/priority threshold for reporting issues. If set to "low",
confidence is not used to filter bugs. |
1295 If set to "medium" (the default), low confidence issues are supressed. | 1308 If set to "medium" (the default), low confidence issues are supressed. |
1296 If set to "high", only high confidence bugs are reported. | 1309 If set to "high", only high confidence bugs are reported. |
1297 </para> | 1310 </para> |
1298 </listitem> | 1311 </listitem> |
1299 </varlistentry> | 1312 </varlistentry> |
1300 | 1313 |
1301 <varlistentry> | 1314 <varlistentry> |
1302 <term><literal>output</literal></term> | 1315 <term><literal>output</literal></term> |
1303 <listitem> | 1316 <listitem> |
1304 <para> | 1317 <para> |
1305 Optional attribute. | 1318 Optional attribute. |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 <term><literal>warningsProperty</literal></term> | 1519 <term><literal>warningsProperty</literal></term> |
1507 <listitem> | 1520 <listitem> |
1508 <para> | 1521 <para> |
1509 Optional attribute which specifies the name of a property | 1522 Optional attribute which specifies the name of a property |
1510 that will be set to "true" if any warnings are reported by | 1523 that will be set to "true" if any warnings are reported by |
1511 &FindBugs; on the analyzed program. | 1524 &FindBugs; on the analyzed program. |
1512 </para> | 1525 </para> |
1513 </listitem> | 1526 </listitem> |
1514 </varlistentry> | 1527 </varlistentry> |
1515 | 1528 |
| 1529 <varlistentry> |
| 1530 <term><literal>userPreferencesFile</literal></term> |
| 1531 <listitem> |
| 1532 <para> |
| 1533 Optional attribute. Set the path of the user preferences file to u
se, which might override some of the options abobe. |
| 1534 Specifying <literal>userPreferencesFile</literal> as first argumen
t would mean some later |
| 1535 options will override them, as last argument would mean they will
override some previous options). |
| 1536 This rationale behind this option is to reuse FindBugs Eclipse pro
ject settings for command |
| 1537 line execution. |
| 1538 </para> |
| 1539 </listitem> |
| 1540 </varlistentry> |
| 1541 |
1516 </variablelist> | 1542 </variablelist> |
1517 | 1543 |
1518 | 1544 |
1519 </para> | 1545 </para> |
1520 | 1546 |
1521 <!-- | 1547 <!-- |
1522 | 1548 |
1523 --> | 1549 --> |
1524 | 1550 |
1525 </sect1> | 1551 </sect1> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 <listitem> | 1610 <listitem> |
1585 <para> | 1611 <para> |
1586 Provides the daily build of FindBugs. No testing other than that it com
piles. | 1612 Provides the daily build of FindBugs. No testing other than that it com
piles. |
1587 </para> | 1613 </para> |
1588 </listitem> | 1614 </listitem> |
1589 </varlistentry> | 1615 </varlistentry> |
1590 </variablelist> | 1616 </variablelist> |
1591 | 1617 |
1592 <para>You can also manually | 1618 <para>You can also manually |
1593 download the plugin from the following link: | 1619 download the plugin from the following link: |
1594 <ulink url="http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plug
in.eclipse_2.0.1.20120712.zip?download" | 1620 <ulink url="http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plug
in.eclipse_2.0.3.20131122.zip?download" |
1595 >http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_
2.0.1.20120712.zip?download</ulink>. | 1621 >http://prdownloads.sourceforge.net/findbugs/edu.umd.cs.findbugs.plugin.eclipse_
2.0.3.20131122.zip?download</ulink>. |
1596 Extract it in Eclipse's "plugins" subdirectory. | 1622 Extract it in Eclipse's "plugins" subdirectory. |
1597 (So <eclipse_install_dir>/plugins/edu.umd.cs.findbugs.plugin.eclipse_2.0.1
.20120712/findbugs.png | 1623 (So <eclipse_install_dir>/plugins/edu.umd.cs.findbugs.plugin.eclipse_2.0.3
.20131122/findbugs.png |
1598 should be the path to the &FindBugs; logo.) | 1624 should be the path to the &FindBugs; logo.) |
1599 | 1625 |
1600 </para> | 1626 </para> |
1601 | 1627 |
1602 <para> | 1628 <para> |
1603 Once the plugin is extracted, start Eclipse and choose | 1629 Once the plugin is extracted, start Eclipse and choose |
1604 <menuchoice> | 1630 <menuchoice> |
1605 <guimenu>Help</guimenu> | 1631 <guimenu>Help</guimenu> |
1606 <guimenuitem>About Eclipse Platform</guimenuitem> | 1632 <guimenuitem>About Eclipse Platform</guimenuitem> |
1607 <guimenuitem>Plug-in Details</guimenuitem> | 1633 <guimenuitem>Plug-in Details</guimenuitem> |
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3955 </blockquote> | 3981 </blockquote> |
3956 | 3982 |
3957 </sect2> | 3983 </sect2> |
3958 | 3984 |
3959 </sect1> | 3985 </sect1> |
3960 | 3986 |
3961 </chapter> | 3987 </chapter> |
3962 | 3988 |
3963 | 3989 |
3964 </book> | 3990 </book> |
OLD | NEW |