1<html><head>
2      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3   <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>
4FindBugs incorporates an ability to perform sophisticated queries on bug
5databases and track warnings across multiple versions of code being
6studied, allowing you to do things such as seeing when a bug was first introduced, examining
7just the warnings that have been introduced since the last release, or graphing the number
8of infinite recursive loops in your code over time.</p><p>
9These techniques all depend upon the XML format used by FindBugs for storing warnings.
10These XML files usually contain just the warnings from one particular analysis run, but
11they can also store the results from analyzing a sequence of software builds or versions.
12    </p><p>
13Any FindBugs XML bug database contains a version name and timestamp.
14FindBugs tries to compute a timestamp from the timestamps of the files that
15are analyzed (e.g., the timestamp is intended to be the time the class files
16were generated, not analyzed). Each bug database also contains a version name.
17Both the version name and timestamp can be set manually using the
18<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.
19    </p><p>A multiversion bug database assigns a sequence number to each version of
20the analyzed code. These sequence numbers are simply successive integers,
21starting at 0 (e.g., a bug database for 4 versions of the code will contain
22versions 0..3). The bug database will also record the name and timestamp for
23each version. The <span class="command"><strong>filterBugs</strong></span> command allows you to refer
24to a version by sequence number, name or timestamp.</p><p>
25You can take a sequence (or pair) of single version bug databases and create
26from them a multiversion bug database, or combine a multiversion bug database
27with a sequence of later single-version bug databases.</p><p>
28Some of these commands can be invoked as ant tasks.  See below for specifics
29on how to invoke them and what attributes and arguments they take.  All of
30the examples assume that the <code class="literal">findbugs.lib</code>
31<code class="literal">refid</code> is set correctly.  Here is one way to set it:
32</p><pre class="programlisting">
33
34   &lt;!-- findbugs task definition --&gt;
35   &lt;property name="findbugs.home" value="/your/path/to/findbugs" /&gt;
36   &lt;path id="findbugs.lib"&gt;
37      &lt;fileset dir="${findbugs.home}/lib"&gt;
38         &lt;include name="findbugs-ant.jar"/&gt;
39      &lt;/fileset&gt;
40   &lt;/path&gt;
41
42</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>
43All tools for FindBugs data mining are can be invoked from the command line,
44and some of the more useful tools can also be invoked from an
45ant build file.</p><p>
46Briefly, 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>
47                         combine the results from separate analysis of disjoint
48        classes
49                    </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
50            analyzed code into
51            a single multiversion bug database. This can either be used
52            to add more versions to an existing multiversion database,
53            or to create a multiversion database from a sequence of single version
54            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
55timestamp 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
56timestamp 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
57        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
58                         (warnings per 1000 NCSS)
59                         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
60                    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>
61        If you have, for example, separately analyzing each jar file used in an application,
62        you can use this command to combine the separately generated xml bug warning files into
63        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
64            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
65of software you are analyzing.
66History is taken from the first file provided as input; any following
67files should be single version bug databases (if they contain history, the history in those
68files will be ignored).</p><p>By default, output is written to the standard output.
69</p><p>This functionality may also can be accessed from ant.
70First create a taskdef for <span class="command"><strong>computeBugHistory</strong></span> in your
71build file:
72</p><pre class="programlisting">
73
74&lt;taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask"&gt;
75    &lt;classpath refid="findbugs.lib" /&gt;
76&lt;/taskdef&gt;
77
78</pre><p>Attributes for this ant task are listed in the following table.
79To specify input files, nest them inside with a
80<code class="literal">&lt;datafile&gt;</code> element.  For example:
81</p><pre class="programlisting">
82
83&lt;computeBugHistory home="${findbugs.home}" ...&gt;
84    &lt;datafile name="analyze1.xml"/&gt;
85    &lt;datafile name="analyze2.xml"/&gt;
86&lt;/computeBugHistory&gt;
87
88</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
89and write the selected subset to a new FindBugs warning file.</p><p>
90This command takes a sequence of options, and either zero, one or two
91filenames of findbugs xml bug files on the command line.</p><p>If no file names are provided, the command reads from standard input
92and writes to standard output. If one file name is provided,
93it reads from the file and writes to standard output.
94If two file names are provided, it reads from the first and writes the output
95to the second file name.</p><p>This functionality may also can be accessed from ant.
96First create a taskdef for <span class="command"><strong>filterBugs</strong></span> in your
97build file:
98</p><pre class="programlisting">
99
100&lt;taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsTask"&gt;
101    &lt;classpath refid="findbugs.lib" /&gt;
102&lt;/taskdef&gt;
103
104</pre><p>Attributes for this ant task are listed in the following table.
105To specify an input file either use the input attribute or nest it inside
106the ant call with a <code class="literal">&lt;datafile&gt;</code> element.  For example:
107</p><pre class="programlisting">
108
109&lt;filterBugs home="${findbugs.home}" ...&gt;
110    &lt;datafile name="analyze.xml"/&gt;
111&lt;/filterBugs&gt;
112
113</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
114in each version of a multiversion bug database.</p><p>This functionality may also can be accessed from ant.
115First create a taskdef for <span class="command"><strong>mineBugHistory</strong></span> in your
116build file:
117</p><pre class="programlisting">
118
119&lt;taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask"&gt;
120    &lt;classpath refid="findbugs.lib" /&gt;
121&lt;/taskdef&gt;
122
123</pre><p>Attributes for this ant task are listed in the following table.
124To specify an input file either use the <code class="literal">input</code>
125attribute or nest it inside the ant call with a
126<code class="literal">&lt;datafile&gt;</code> element.  For example:
127</p><pre class="programlisting">
128
129&lt;mineBugHistory home="${findbugs.home}" ...&gt;
130    &lt;datafile name="analyze.xml"/&gt;
131&lt;/mineBugHistory&gt;
132
133</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>
134        The <code class="option">-noTabs</code> output can be easier to read from a shell
135        with a fixed-width font.
136        Because numeric columns are right-justified, spaces may precede the
137        first column value. This option also causes <code class="option">-formatDates</code>
138        to render dates in terser format without embedded whitespace.
139        </p><p>The table is a tab-separated (barring <code class="option">-noTabs</code>)
140        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>
141This command lists information about defect density (warnings per 1000 NCSS) for the entire project and each class and package.
142It can either be invoked with no files specified on the command line (in which case it reads from standard input)
143or with one file specified on the command line.</p><p>It generates a table with the following columns, and with one
144row for the entire project, and one row for each package or class that contains at least
1454 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>
146                This command converts a warning collection in XML format to a text
147                format with one line per warning, or to HTML.
148            </p><p>This functionality may also can be accessed from ant.
149First create a taskdef for <span class="command"><strong>convertXmlToText</strong></span> in your
150build file:
151</p><pre class="programlisting">
152
153&lt;taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask"&gt;
154    &lt;classpath refid="findbugs.lib" /&gt;
155&lt;/taskdef&gt;
156
157</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>
158            You may specify plain.xsl, default.xsl, fancy.xsl, fancy-hist.xsl,
159            or your own XSL stylesheet for the -html/format option.
160            Despite the name of this option, you may specify
161            a stylesheet that emits something other than html.
162            When applying a stylesheet other than those included
163            with FindBugs (listed above), the -html/format option should be used
164            with a path or URL to the stylesheet.
165            </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>
166                This command sets meta-information in a specified warning collection.
167                It takes the following options:
168            </p><p>This functionality may also can be accessed from ant.
169First create a taskdef for <span class="command"><strong>setBugDatabaseInfo</strong></span> in your
170build file:
171</p><pre class="programlisting">
172
173&lt;taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask"&gt;
174    &lt;classpath refid="findbugs.lib" /&gt;
175&lt;/taskdef&gt;
176
177</pre><p>Attributes for this ant task are listed in the following table.
178To specify an input file either use the <code class="literal">input</code>
179attribute or nest it inside the ant call with a
180<code class="literal">&lt;datafile&gt;</code> element.  For example:
181</p><pre class="programlisting">
182
183&lt;setBugDatabaseInfo home="${findbugs.home}" ...&gt;
184    &lt;datafile name="analyze.xml"/&gt;
185&lt;/setBugDatabaseInfo&gt;
186
187</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.
188If zero file names are provided, it reads from standard input and does not generate
189a table header.</p><p>There is only one option: <code class="option">-formatDates</code> renders dates
190    in textual form.
191    </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
192directories jdk1.6.0-b12, jdk1.6.0-b13, ..., jdk1.6.0-b60.</p><p>You can use the command:</p><pre class="screen">
193computeBugHistory jdk1.6.0-b* | filterBugs -bugPattern IL_ | mineBugHistory -formatDates
194</pre><p>to generate the following output:</p><pre class="screen">
195seq	version	time	classes	NCSS	added	newCode	fixed	removed	retained	dead	active
1960	jdk1.6.0-b12	"Thu Nov 11 09:07:20 EST 2004"	13128	811569	0	4	0	0	0	0	4
1971	jdk1.6.0-b13	"Thu Nov 18 06:02:06 EST 2004"	13128	811570	0	0	0	0	4	0	4
1982	jdk1.6.0-b14	"Thu Dec 02 06:12:26 EST 2004"	13145	811786	0	0	2	0	2	0	2
1993	jdk1.6.0-b15	"Thu Dec 09 06:07:04 EST 2004"	13174	811693	0	0	1	0	1	2	1
2004	jdk1.6.0-b16	"Thu Dec 16 06:21:28 EST 2004"	13175	811715	0	0	0	0	1	3	1
2015	jdk1.6.0-b17	"Thu Dec 23 06:27:22 EST 2004"	13176	811974	0	0	0	0	1	3	1
2026	jdk1.6.0-b19	"Thu Jan 13 06:41:16 EST 2005"	13176	812011	0	0	0	0	1	3	1
2037	jdk1.6.0-b21	"Thu Jan 27 05:57:52 EST 2005"	13177	812173	0	0	0	0	1	3	1
2048	jdk1.6.0-b23	"Thu Feb 10 05:44:36 EST 2005"	13179	812188	0	0	0	0	1	3	1
2059	jdk1.6.0-b26	"Thu Mar 03 06:04:02 EST 2005"	13199	811770	0	0	0	0	1	3	1
20610	jdk1.6.0-b27	"Thu Mar 10 04:48:38 EST 2005"	13189	812440	0	0	0	0	1	3	1
20711	jdk1.6.0-b28	"Thu Mar 17 02:54:22 EST 2005"	13185	812056	0	0	0	0	1	3	1
20812	jdk1.6.0-b29	"Thu Mar 24 03:09:20 EST 2005"	13117	809468	0	0	0	0	1	3	1
20913	jdk1.6.0-b30	"Thu Mar 31 02:53:32 EST 2005"	13118	809501	0	0	0	0	1	3	1
21014	jdk1.6.0-b31	"Thu Apr 07 03:00:14 EDT 2005"	13117	809572	0	0	0	0	1	3	1
21115	jdk1.6.0-b32	"Thu Apr 14 02:56:56 EDT 2005"	13169	811096	0	0	0	0	1	3	1
21216	jdk1.6.0-b33	"Thu Apr 21 02:46:22 EDT 2005"	13187	811942	0	0	0	0	1	3	1
21317	jdk1.6.0-b34	"Thu Apr 28 02:49:00 EDT 2005"	13195	813488	0	1	0	0	1	3	2
21418	jdk1.6.0-b35	"Thu May 05 02:49:04 EDT 2005"	13457	829837	0	0	0	0	2	3	2
21519	jdk1.6.0-b36	"Thu May 12 02:59:46 EDT 2005"	13462	831278	0	0	0	0	2	3	2
21620	jdk1.6.0-b37	"Thu May 19 02:55:08 EDT 2005"	13464	831971	0	0	0	0	2	3	2
21721	jdk1.6.0-b38	"Thu May 26 03:08:16 EDT 2005"	13564	836565	0	0	0	0	2	3	2
21822	jdk1.6.0-b39	"Fri Jun 03 03:10:48 EDT 2005"	13856	849992	0	1	0	0	2	3	3
21923	jdk1.6.0-b40	"Thu Jun 09 03:30:28 EDT 2005"	15972	959619	0	2	0	0	3	3	5
22024	jdk1.6.0-b41	"Thu Jun 16 03:19:22 EDT 2005"	15972	959619	0	0	0	0	5	3	5
22125	jdk1.6.0-b42	"Fri Jun 24 03:38:54 EDT 2005"	15966	958581	0	0	0	0	5	3	5
22226	jdk1.6.0-b43	"Thu Jul 14 03:09:34 EDT 2005"	16041	960544	0	0	0	0	5	3	5
22327	jdk1.6.0-b44	"Thu Jul 21 03:05:54 EDT 2005"	16041	960547	0	0	0	0	5	3	5
22428	jdk1.6.0-b45	"Thu Jul 28 03:26:10 EDT 2005"	16037	960606	0	0	1	0	4	3	4
22529	jdk1.6.0-b46	"Thu Aug 04 03:02:48 EDT 2005"	15936	951355	0	0	0	0	4	4	4
22630	jdk1.6.0-b47	"Thu Aug 11 03:18:56 EDT 2005"	15964	952387	0	0	1	0	3	4	3
22731	jdk1.6.0-b48	"Thu Aug 18 08:10:40 EDT 2005"	15970	953421	0	0	0	0	3	5	3
22832	jdk1.6.0-b49	"Thu Aug 25 03:24:38 EDT 2005"	16048	958940	0	0	0	0	3	5	3
22933	jdk1.6.0-b50	"Thu Sep 01 01:52:40 EDT 2005"	16287	974937	1	0	0	0	3	5	4
23034	jdk1.6.0-b51	"Thu Sep 08 01:55:36 EDT 2005"	16362	979377	0	0	0	0	4	5	4
23135	jdk1.6.0-b52	"Thu Sep 15 02:04:08 EDT 2005"	16477	979399	0	0	0	0	4	5	4
23236	jdk1.6.0-b53	"Thu Sep 22 02:00:28 EDT 2005"	16019	957900	0	0	1	0	3	5	3
23337	jdk1.6.0-b54	"Thu Sep 29 01:54:34 EDT 2005"	16019	957900	0	0	0	0	3	6	3
23438	jdk1.6.0-b55	"Thu Oct 06 01:54:14 EDT 2005"	16051	959014	0	0	0	0	3	6	3
23539	jdk1.6.0-b56	"Thu Oct 13 01:54:12 EDT 2005"	16211	970835	0	0	0	0	3	6	3
23640	jdk1.6.0-b57	"Thu Oct 20 01:55:26 EDT 2005"	16279	971627	0	0	0	0	3	6	3
23741	jdk1.6.0-b58	"Thu Oct 27 01:56:30 EDT 2005"	16283	971945	0	0	0	0	3	6	3
23842	jdk1.6.0-b59	"Thu Nov 03 01:56:58 EST 2005"	16232	972193	0	0	0	0	3	6	3
23943	jdk1.6.0-b60	"Thu Nov 10 01:54:18 EST 2005"	16235	972346	0	0	0	0	3	6	3
240</pre><p>
241We could also generate that information directly, without creating an intermediate db.xml file, using the command
242</p><pre class="screen">
243computeBugHistory  jdk1.6.0-b*/jre/lib/rt.xml | filterBugs -bugPattern IL_ db.xml | mineBugHistory -formatDates
244</pre><p>We can then use that information to display a graph showing the number of infinite recursive loops
245found by FindBugs in each build of Sun's JDK1.6.0. The blue area indicates the number of infinite
246recursive loops in that build, the red area above it indicates the number of infinite recursive loops that existed
247in some previous version but not in the current version (thus, the combined height of the red and blue areas
248is guaranteed to never decrease, and goes up whenever a new infinite recursive loop bug is introduced). The height
249of the red area is computed as the sum of the fixed, removed and dead values for each version.
250The reductions in builds 13 and 14 came after Sun was notified about the bugs found by FindBugs in the JDK.
251    </p><div class="mediaobject"><img src="infiniteRecursiveLoops.png"></div><p>
252Given 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:
253</p><pre class="screen">
254filterBugs -priority M -category C db.xml | mineBugHistory -formatDates
255</pre><p>
256generating the table:
257</p><pre class="screen">
258seq	version	time	classes	NCSS	added	newCode	fixed	removed	retained	dead	active
2590	jdk1.6.0-b12	"Thu Nov 11 09:07:20 EST 2004"	13128	811569	0	1075	0	0	0	0	1075
2601	jdk1.6.0-b13	"Thu Nov 18 06:02:06 EST 2004"	13128	811570	0	0	0	0	1075	0	1075
2612	jdk1.6.0-b14	"Thu Dec 02 06:12:26 EST 2004"	13145	811786	3	0	6	0	1069	0	1072
2623	jdk1.6.0-b15	"Thu Dec 09 06:07:04 EST 2004"	13174	811693	2	1	3	0	1069	6	1072
2634	jdk1.6.0-b16	"Thu Dec 16 06:21:28 EST 2004"	13175	811715	0	0	1	0	1071	9	1071
2645	jdk1.6.0-b17	"Thu Dec 23 06:27:22 EST 2004"	13176	811974	0	0	1	0	1070	10	1070
2656	jdk1.6.0-b19	"Thu Jan 13 06:41:16 EST 2005"	13176	812011	0	0	0	0	1070	11	1070
2667	jdk1.6.0-b21	"Thu Jan 27 05:57:52 EST 2005"	13177	812173	0	0	1	0	1069	11	1069
2678	jdk1.6.0-b23	"Thu Feb 10 05:44:36 EST 2005"	13179	812188	0	0	0	0	1069	12	1069
2689	jdk1.6.0-b26	"Thu Mar 03 06:04:02 EST 2005"	13199	811770	0	0	2	1	1066	12	1066
26910	jdk1.6.0-b27	"Thu Mar 10 04:48:38 EST 2005"	13189	812440	1	0	1	1	1064	15	1065
27011	jdk1.6.0-b28	"Thu Mar 17 02:54:22 EST 2005"	13185	812056	0	0	0	0	1065	17	1065
27112	jdk1.6.0-b29	"Thu Mar 24 03:09:20 EST 2005"	13117	809468	3	0	8	26	1031	17	1034
27213	jdk1.6.0-b30	"Thu Mar 31 02:53:32 EST 2005"	13118	809501	0	0	0	0	1034	51	1034
27314	jdk1.6.0-b31	"Thu Apr 07 03:00:14 EDT 2005"	13117	809572	0	0	0	0	1034	51	1034
27415	jdk1.6.0-b32	"Thu Apr 14 02:56:56 EDT 2005"	13169	811096	1	1	0	1	1033	51	1035
27516	jdk1.6.0-b33	"Thu Apr 21 02:46:22 EDT 2005"	13187	811942	3	0	2	1	1032	52	1035
27617	jdk1.6.0-b34	"Thu Apr 28 02:49:00 EDT 2005"	13195	813488	0	1	0	0	1035	55	1036
27718	jdk1.6.0-b35	"Thu May 05 02:49:04 EDT 2005"	13457	829837	0	36	2	0	1034	55	1070
27819	jdk1.6.0-b36	"Thu May 12 02:59:46 EDT 2005"	13462	831278	0	0	0	0	1070	57	1070
27920	jdk1.6.0-b37	"Thu May 19 02:55:08 EDT 2005"	13464	831971	0	1	1	0	1069	57	1070
28021	jdk1.6.0-b38	"Thu May 26 03:08:16 EDT 2005"	13564	836565	1	7	2	6	1062	58	1070
28122	jdk1.6.0-b39	"Fri Jun 03 03:10:48 EDT 2005"	13856	849992	6	39	5	0	1065	66	1110
28223	jdk1.6.0-b40	"Thu Jun 09 03:30:28 EDT 2005"	15972	959619	7	147	11	0	1099	71	1253
28324	jdk1.6.0-b41	"Thu Jun 16 03:19:22 EDT 2005"	15972	959619	0	0	0	0	1253	82	1253
28425	jdk1.6.0-b42	"Fri Jun 24 03:38:54 EDT 2005"	15966	958581	3	0	1	2	1250	82	1253
28526	jdk1.6.0-b43	"Thu Jul 14 03:09:34 EDT 2005"	16041	960544	5	11	15	8	1230	85	1246
28627	jdk1.6.0-b44	"Thu Jul 21 03:05:54 EDT 2005"	16041	960547	0	0	0	0	1246	108	1246
28728	jdk1.6.0-b45	"Thu Jul 28 03:26:10 EDT 2005"	16037	960606	19	0	2	0	1244	108	1263
28829	jdk1.6.0-b46	"Thu Aug 04 03:02:48 EDT 2005"	15936	951355	13	1	1	32	1230	110	1244
28930	jdk1.6.0-b47	"Thu Aug 11 03:18:56 EDT 2005"	15964	952387	163	8	7	20	1217	143	1388
29031	jdk1.6.0-b48	"Thu Aug 18 08:10:40 EDT 2005"	15970	953421	0	0	0	0	1388	170	1388
29132	jdk1.6.0-b49	"Thu Aug 25 03:24:38 EDT 2005"	16048	958940	1	11	1	0	1387	170	1399
29233	jdk1.6.0-b50	"Thu Sep 01 01:52:40 EDT 2005"	16287	974937	19	27	16	7	1376	171	1422
29334	jdk1.6.0-b51	"Thu Sep 08 01:55:36 EDT 2005"	16362	979377	1	15	3	0	1419	194	1435
29435	jdk1.6.0-b52	"Thu Sep 15 02:04:08 EDT 2005"	16477	979399	0	0	1	1	1433	197	1433
29536	jdk1.6.0-b53	"Thu Sep 22 02:00:28 EDT 2005"	16019	957900	13	12	16	20	1397	199	1422
29637	jdk1.6.0-b54	"Thu Sep 29 01:54:34 EDT 2005"	16019	957900	0	0	0	0	1422	235	1422
29738	jdk1.6.0-b55	"Thu Oct 06 01:54:14 EDT 2005"	16051	959014	1	4	7	0	1415	235	1420
29839	jdk1.6.0-b56	"Thu Oct 13 01:54:12 EDT 2005"	16211	970835	6	8	37	0	1383	242	1397
29940	jdk1.6.0-b57	"Thu Oct 20 01:55:26 EDT 2005"	16279	971627	0	0	0	0	1397	279	1397
30041	jdk1.6.0-b58	"Thu Oct 27 01:56:30 EDT 2005"	16283	971945	0	1	1	0	1396	279	1397
30142	jdk1.6.0-b59	"Thu Nov 03 01:56:58 EST 2005"	16232	972193	6	0	5	0	1392	280	1398
30243	jdk1.6.0-b60	"Thu Nov 10 01:54:18 EST 2005"	16235	972346	0	0	0	0	1398	285	1398
30344	jdk1.6.0-b61	"Thu Nov 17 01:58:42 EST 2005"	16202	971134	2	0	4	0	1394	285	1396
304</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>
305If 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:
306</p><pre class="screen">
307computeBugHistory -output db.xml db.xml jdk1.6.0-b61/jre/lib/rt.xml
308</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>
309Here is a complete ant script example for both running findbugs and running a chain of data-mining tools afterward:
310</p><pre class="screen">
311
312&lt;project name="analyze_asm_util" default="findbugs"&gt;
313   &lt;!-- findbugs task definition --&gt;
314   &lt;property name="findbugs.home" value="/Users/ben/Documents/workspace/findbugs/findbugs" /&gt;
315   &lt;property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en -Duser.region=EN -Dfindbugs.home=${findbugs.home}" /&gt;
316
317    &lt;path id="findbugs.lib"&gt;
318      &lt;fileset dir="${findbugs.home}/lib"&gt;
319         &lt;include name="findbugs-ant.jar"/&gt;
320      &lt;/fileset&gt;
321   &lt;/path&gt;
322
323   &lt;taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"&gt;
324      &lt;classpath refid="findbugs.lib" /&gt;
325   &lt;/taskdef&gt;
326
327   &lt;taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask"&gt;
328      &lt;classpath refid="findbugs.lib" /&gt;
329   &lt;/taskdef&gt;
330
331   &lt;taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask"&gt;
332      &lt;classpath refid="findbugs.lib" /&gt;
333   &lt;/taskdef&gt;
334
335   &lt;taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask"&gt;
336      &lt;classpath refid="findbugs.lib" /&gt;
337   &lt;/taskdef&gt;
338
339   &lt;!-- findbugs task definition --&gt;
340   &lt;target name="findbugs"&gt;
341      &lt;antcall target="analyze" /&gt;
342      &lt;antcall target="mine" /&gt;
343   &lt;/target&gt;
344
345   &lt;!-- analyze task --&gt;
346   &lt;target name="analyze"&gt;
347      &lt;!-- run findbugs against asm-util --&gt;
348      &lt;findbugs home="${findbugs.home}"
349                output="xml:withMessages"
350                timeout="90000000"
351                reportLevel="experimental"
352                workHard="true"
353                effort="max"
354                adjustExperimental="true"
355                jvmargs="${jvmargs}"
356                failOnError="true"
357                outputFile="out.xml"
358                projectName="Findbugs"
359                debug="false"&gt;
360         &lt;class location="asm-util-3.0.jar" /&gt;
361      &lt;/findbugs&gt;
362   &lt;/target&gt;
363
364   &lt;target name="mine"&gt;
365
366      &lt;!-- Set info to the latest analysis --&gt;
367      &lt;setBugDatabaseInfo home="${findbugs.home}"
368                            withMessages="true"
369                            name="asm-util-3.0.jar"
370                            input="out.xml"
371                            output="out-rel.xml"/&gt;
372
373      &lt;!-- Checking if history file already exists (out-hist.xml) --&gt;
374      &lt;condition property="mining.historyfile.available"&gt;
375         &lt;available file="out-hist.xml"/&gt;
376      &lt;/condition&gt;
377      &lt;condition property="mining.historyfile.notavailable"&gt;
378         &lt;not&gt;
379            &lt;available file="out-hist.xml"/&gt;
380         &lt;/not&gt;
381      &lt;/condition&gt;
382
383      &lt;!-- this target is executed if the history file do not exist (first run) --&gt;
384      &lt;antcall target="history-init"&gt;
385        &lt;param name="data.file" value="out-rel.xml" /&gt;
386        &lt;param name="hist.file" value="out-hist.xml" /&gt;
387      &lt;/antcall&gt;
388      &lt;!-- else this one is executed --&gt;
389      &lt;antcall target="history"&gt;
390        &lt;param name="data.file"         value="out-rel.xml" /&gt;
391        &lt;param name="hist.file"         value="out-hist.xml" /&gt;
392        &lt;param name="hist.summary.file" value="out-hist.txt" /&gt;
393      &lt;/antcall&gt;
394   &lt;/target&gt;
395
396   &lt;!-- Initializing history file --&gt;
397   &lt;target name="history-init" if="mining.historyfile.notavailable"&gt;
398      &lt;copy file="${data.file}" tofile="${hist.file}" /&gt;
399   &lt;/target&gt;
400
401   &lt;!-- Computing bug history --&gt;
402   &lt;target name="history" if="mining.historyfile.available"&gt;
403      &lt;!-- Merging ${data.file} into ${hist.file} --&gt;
404      &lt;computeBugHistory home="${findbugs.home}"
405                           withMessages="true"
406                           output="${hist.file}"&gt;
407            &lt;dataFile name="${hist.file}"/&gt;
408            &lt;dataFile name="${data.file}"/&gt;
409      &lt;/computeBugHistory&gt;
410
411      &lt;!-- Compute history into ${hist.summary.file} --&gt;
412      &lt;mineBugHistory home="${findbugs.home}"
413                        formatDates="true"
414                      noTabs="true"
415                        input="${hist.file}"
416                        output="${hist.summary.file}"/&gt;
417   &lt;/target&gt;
418
419&lt;/project&gt;
420
421</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>