• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://findbugs.googlecode.com/svn/trunk/findbugs/etc/docbook/docbookx.dtd"
3[
4<!ENTITY FindBugs "<application>FindBugs</application>">
5<!ENTITY Ant "<application>Ant</application>">
6<!ENTITY Saxon "<application>Saxon</application>">
7<!ENTITY FBHome "<replaceable>$FINDBUGS_HOME</replaceable>">
8<!ENTITY FBHomeWin "<replaceable>&#x25;FINDBUGS_HOME&#x25;</replaceable>">
9<!ENTITY nbsp "&#160;">
10]>
11<book lang="ja" id="findbugs-manual">
12
13<bookinfo>
14<title>&FindBugs;&trade; マニュアル</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</year>
31  <year>2004</year>
32  <year>2005</year>
33  <year>2006</year>
34  <year>2008</year>
35  <holder>University of Maryland</holder>
36</copyright>
37
38<legalnotice>
39<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>
40<para>名称「FindBugs」および FindBugs のロゴは、メリーランド大学の登録商標です。</para>
41</legalnotice>
42
43<edition>2.0.3</edition>
44
45<pubdate>17:16:15 EST, 22 November, 2013</pubdate>
46
47</bookinfo>
48
49<!--
50   **************************************************************************
51   Introduction
52   **************************************************************************
53-->
54
55<chapter id="introduction">
56<title>はじめに</title>
57
58<para>&FindBugs;&trade; は、Java プログラムの中のバグを見つけるプログラムです。このプログラムは、「バグ パターン」の実例を探します。「バグ パターン」とは、エラーとなる可能性の高いコードの事例です。</para>
59
60<para>この文書は、&FindBugs; バージョン 2.0.3 について説明してます。私たちは、 &FindBugs; に対するフィードバックを心待ちにしています。どうぞ、 <ulink url="http://findbugs.sourceforge.net">&FindBugs; Web ページ</ulink> にアクセスしてください。&FindBugs; についての最新情報、連絡先および &FindBugs; メーリングリストなどのサポート情報を入手することができます。</para>
61
62<sect1>
63<title>必要条件</title>
64<para>&FindBugs; を使用するには、 <ulink url="http://java.sun.com/j2se">Java 2 Standard Edition</ulink>, バージョン 1.5 以降のバージョンと互換性のあるランタイム環境が必要です。&FindBugs; は、プラットフォーム非依存であり、 GNU/Linux 、 Windows 、 MacOS X プラットフォーム上で動作することが知られています。</para>
65
66<para>&FindBugs; を使用するためには、少なくとも 512 MB のメモリが必要です。巨大なプロジェクトを解析するためには、それより多くのメモリが必要とされることがあります。</para>
67</sect1>
68
69</chapter>
70
71<!--
72   **************************************************************************
73   Installing FindBugs
74   **************************************************************************
75-->
76
77<chapter id="installing">
78<title>&FindBugs;&trade; のインストール</title>
79
80<para>この章では、 &FindBugs; のインストール方法を説明します。</para>
81
82<sect1>
83<title>配布物の展開</title>
84
85<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>
86
87<para>gzipped tar 形式配布物の展開方法例:<screen>
88<prompt>$ </prompt><command>gunzip -c findbugs-2.0.3.tar.gz | tar xvf -</command>
89</screen>
90</para>
91
92<para>zip 形式配布物の展開方法例:<screen>
93<prompt>C:\Software&gt;</prompt><command>unzip findbugs-2.0.3.zip</command>
94</screen>
95</para>
96
97<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>
98</sect1>
99
100</chapter>
101
102<!--
103   **************************************************************************
104   Compiling FindBugs from Source
105   **************************************************************************
106-->
107
108<chapter id="building">
109<title>&FindBugs;&trade; のソールからのビルド</title>
110
111<para>この章では、 &FindBugs; をソースコードからビルドする方法を説明します。&FindBugs; を修正することに興味がないのであれば、 <link linkend="running">次の章</link> に進んでください。</para>
112
113<sect1>
114<title>前提条件</title>
115
116<para>ソースから &FindBugs; をコンパイルするためには、以下のものが必要です。<itemizedlist>
117  <listitem>
118    <para><ulink url="http://prdownloads.sourceforge.net/findbugs/findbugs-2.0.3-source.zip?download">&FindBugs; のソース配布物</ulink>
119    </para>
120  </listitem>
121  <listitem>
122    <para>
123      <ulink url="http://java.sun.com/j2se/">JDK 1.5.0 ベータ またはそれ以降</ulink>
124    </para>
125  </listitem>
126  <listitem>
127    <para>
128      <ulink url="http://ant.apache.org/">Apache &Ant;</ulink>, バージョン 1.6.3 またはそれ以降</para>
129  </listitem>
130</itemizedlist>
131</para>
132
133<warning>
134    <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>
135</warning>
136
137<para>体裁の整った &FindBugs; のドキュメントを生成したい場合は、以下のソフトウェアも必要となります:<itemizedlist>
138  <listitem>
139    <para><ulink url="http://docbook.sourceforge.net/projects/xsl/index.html">DocBook XSL スタイルシート</ulink>。&FindBugs; のマニュアルを HTML に変換するのに必要です。</para>
140  </listitem>
141  <listitem>
142    <para><ulink url="http://saxon.sourceforge.net/">&Saxon; XSLT プロセッサー</ulink>。(同様に、 &FindBugs; のマニュアルを HTML に変換するのに必要です。)</para>
143  </listitem>
144<!--
145  <listitem>
146    <para>
147    </para>
148  </listitem>
149-->
150</itemizedlist>
151</para>
152
153</sect1>
154
155<sect1>
156<title>ソース配布物の展開</title>
157<para>ソース配布物をダウンロードした後に、それを作業用ディレクトリーに展開する必要があります。通常は、次のようなコマンドで展開を行います:<screen>
158<prompt>$ </prompt><command>unzip findbugs-2.0.3-source.zip</command>
159</screen>
160
161</para>
162</sect1>
163
164<sect1>
165<title><filename>local.properties</filename> の修正</title>
166<para>FindBugs のドキュメントをビルドするためには、 <filename>local.properties</filename> ファイルを修正する必要があります。このファイルは、 &FindBugs; をビルドする際に <ulink url="http://ant.apache.org/">&Ant;</ulink> <filename>build.xml</filename> ファイルが参照します。FindBugs のドキュメントをビルドしない場合は、このファイルは無視してもかまいません。</para>
167
168<para><filename>local.properties</filename> での定義は、 <filename>build.properties</filename> ファイルでの定義に優先します。<filename>build.properties</filename> は次のような内容です:<programlisting>
169<![CDATA[
170# User Configuration:
171# This section must be modified to reflect your system.
172
173local.software.home     =/export/home/daveho/linux
174
175# Set this to the directory containing the DocBook Modular XSL Stylesheets
176#  from http://docbook.sourceforge.net/projects/xsl/
177
178xsl.stylesheet.home     =${local.software.home}/docbook/docbook-xsl-1.71.1
179
180# Set this to the directory where Saxon (http://saxon.sourceforge.net/)
181# is installed.
182
183saxon.home              =${local.software.home}/java/saxon-6.5.5
184]]>
185</programlisting>
186</para>
187
188<para><varname>xsl.stylesheet.home</varname> プロパティーには、<ulink url="http://docbook.sourceforge.net/projects/xsl/">DocBook Modular XSL スタイルシート</ulink>がインストールしてあるディレクトリーの絶対パスを指定します。&FindBugs; ドキュメントを生成しようと考えている場合にのみ、このプロパティーを指定する必要があります。</para>
189
190<para><varname>saxon.home</varname> プロパティーには、<ulink url="http://saxon.sourceforge.net/">&Saxon; XSLT プロセッサー</ulink>がインストールしてあるディレクトリーの絶対パスを指定します。&FindBugs; ドキュメントを生成しようと考えている場合にのみ、このプロパティーを指定する必要があります。</para>
191
192</sect1>
193
194<sect1>
195<title>&Ant; の実行</title>
196
197<para>ソース配布物の展開、 &Ant; のインストール、<filename>build.properties</filename>(<filename>local.properties</filename>) の修正 (これは任意) およびツール (&Saxon; など)の環境構築ができれば、 &FindBugs; をビルドするための準備は完了です。&Ant; の起動する方法は、単にコマンドを実行するだけです。<screen>
198<prompt>$ </prompt><command>ant <replaceable>target</replaceable></command>
199</screen><replaceable>target</replaceable> には以下のいずれかを指定します: <variablelist> <varlistentry> <term><command>build</command></term>
200    <listitem>
201       <para>このターゲットは、 &FindBugs; のコードをコンパイルします。これは、デフォルトのターゲットです。</para>
202    </listitem>
203  </varlistentry>
204
205  <varlistentry>
206    <term><command>docs</command></term>
207    <listitem>
208       <para>このターゲットは、ドキュメントの整形を行います(また、副作用としていくつかのソースのコンパイルも行います。)</para>
209    </listitem>
210  </varlistentry>
211
212  <varlistentry>
213    <term><command>runjunit</command></term>
214    <listitem>
215        <para>このターゲットは、コンパイルを行い &FindBugs; が持っている JUnit テストを実行します。ユニットテストが失敗した場合は、エラーメッセージが表示されます。</para>
216    </listitem>
217  </varlistentry>
218
219  <varlistentry>
220    <term><command>bindist</command></term>
221    <listitem>
222        <para>&FindBugs; のバイナリ配布物を構築します。このターゲットは、 <filename>.zip</filename> および <filename>.tar.gz</filename> のアーカイブをそれぞれ作成します。</para>
223    </listitem>
224  </varlistentry>
225</variablelist>
226</para>
227
228<para>&Ant; コマンドの実行後、次のような出力が表示されるはずです。 (この前に &Ant; が実行したタスクに関するメッセージもいくらか出力されます。):<screen>
229<computeroutput>
230BUILD SUCCESSFUL
231Total time: 17 seconds
232</computeroutput>
233</screen>
234</para>
235
236</sect1>
237
238<sect1>
239<title>ソースディレクトリーからの &FindBugs;&trade; の実行</title>
240<para><command>build</command> ターゲットの実行が終了すると、バイナリ配布物と同様の状態が作業ディレクトリーに構築されるように &FindBugs; の&Ant; ビルドスクリプトは記述されています。したがって、<xref linkend="running"/> の  &FindBugs; の実行に関する情報はソース配布物の場合にも応用できます。</para>
241</sect1>
242
243</chapter>
244
245
246<!--
247   **************************************************************************
248   Running FindBugs
249   **************************************************************************
250-->
251
252<chapter id="running">
253<title>&FindBugs;&trade; の実行</title>
254
255<para>&FindBugs; には2つのユーザーインタフェースがあります。すなわち、グラフィカルユーザーインタフェース (GUI) および コマンドラインインタフェースです。この章では、それぞれのインタフェースの実行方法について説明します。</para>
256
257    <warning>
258        <para>この章は、現在書き直し中です。書き直しはまだ完了していません。</para>
259    </warning>
260
261<!--
262<sect1>
263<title>Executing the &FindBugs;&trade; GUI</title>
264</sect1>
265-->
266
267<sect1>
268    <title>クイック・スタート</title>
269    <para>Windows システムで  &FindBugs; を起動する場合は、 <filename>&FBHomeWin;\lib\findbugs.jar</filename> ファイルをダブルクリックしてください。 &FindBugs; GUI が起動します。</para>
270
271    <para>Unix 、 Linux または Mac OS X システムの場合は、<filename>&FBHome;/bin/findbugs</filename> スクリプトを実行するか、以下のコマンドを実行します。<screen>
272<command>java -jar &FBHome;/lib/findbugs.jar</command></screen>これで、 &FindBugs; GUI が起動します。</para>
273
274    <para>GUI の使用方法については、 <xref linkend="gui"/> を参照してください。</para>
275</sect1>
276
277<sect1>
278
279    <title>&FindBugs; の起動</title>
280
281    <para>このセクションでは、 &FindBugs; の起動方法を説明します。&FindBugs; を起動するには2つの方法があります。すなわち、直接起動する方法、および、ラップしているスクリプトを使用する方法です。</para>
282
283
284    <sect2 id="directInvocation">
285        <title>&FindBugs; の直接起動</title>
286
287        <para>最初に述べる &FindBugs; の起動方法は、 <filename>&FBHome;/lib/findbugs.jar</filename> を直接実行する方法です。JVM (<command>java</command>) 実行プログラムの <command>-jar</command> コマンドラインスイッチを使用します。(&FindBugs;のバージョンが 1.3.5 より前の場合は、ラップしているスクリプトを使用する必要があります。)</para>
288
289        <para>&FindBugs; を直接起動するための、一般的な構文は以下のようになります。<screen>
290    <command>java <replaceable>[JVM 引数]</replaceable> -jar &FBHome;/lib/findbugs.jar <replaceable>オプション…</replaceable></command>
291</screen>
292        </para>
293
294<!--
295        <para>
296            By default, executing <filename>findbugs.jar</filename> runs the
297            &FindBugs; graphical user interface (GUI).  On windows systems,
298            you can double-click on <filename>findbugs.jar</filename> to launch
299            the GUI.  From a command line, the command
300            <screen>
301java -jar <replaceable>&FBHome;</replaceable>/lib/findbugs.jar</screen>
302            will launch the GUI.
303        </para>
304-->
305
306        <sect3 id="chooseUI">
307            <title> ユーザーインタフェースの選択</title>
308
309        <para>1 番目のコマンドラインオプションは、起動する &FindBugs; ユーザーインタフェースを選択するためのものです。指定可能な値は次の通りです:</para>
310        <itemizedlist>
311            <listitem>
312                <para>
313                <command>-gui</command>: グラフィカルユーザーインタフェース (GUI) を起動します。</para>
314            </listitem>
315
316            <listitem>
317                <para>
318                    <command>-textui</command>: コマンドラインインタフェースを起動します。</para>
319            </listitem>
320
321            <listitem>
322                <para>
323                    <command>-version</command>: &FindBugs; のバージョン番号を表示します。</para>
324            </listitem>
325
326            <listitem>
327                <para>
328                    <command>-help</command>: &FindBugs; コマンドラインインタフェースのヘルプ情報を表示します。</para>
329            </listitem>
330
331            <listitem>
332                <para>
333                    <command>-gui1</command>: 最初に作成された &FindBugs; グラフィカルユーザーインタフェース(すでに廃止されサポートされていない)を起動します。</para>
334            </listitem>
335        </itemizedlist>
336
337        </sect3>
338
339        <sect3 id="jvmArgs">
340            <title>Java 仮想マシン (JVM) 引数</title>
341
342            <para>&FindBugs; を起動する際に有用な Java 仮想マシン 引数をいくつか紹介します。</para>
343
344            <variablelist>
345                <varlistentry>
346                    <term><command>-Xmx<replaceable>NN</replaceable>m</command></term>
347                    <listitem>
348                        <para>Java ヒープサイズの最大値を <replaceable>NN</replaceable> メガバイトに設定します。&FindBugs; は一般的に大容量のメモリサイズを必要とします。大きなプロジェクトでは、 1500 メガバイトを使用することも珍しくありません。</para>
349                    </listitem>
350                </varlistentry>
351
352                <varlistentry>
353                    <term><command>-D<replaceable>name</replaceable>=<replaceable>value</replaceable></command></term>
354                    <listitem>
355                        <para>Java システムプロパティーを設定します。例えば、引数 <command>-Duser.language=ja</command> を使用すると GUI 文言が日本語で表示されます。</para>
356                    </listitem>
357                </varlistentry>
358
359                <!--
360                <varlistentry>
361                    <term></term>
362                    <listitem>
363                        <para>
364                        </para>
365                    </listitem>
366                </varlistentry>
367                -->
368            </variablelist>
369        </sect3>
370
371    </sect2>
372
373    <sect2 id="wrapperScript">
374        <title>ラップしているスクリプトを使用した &FindBugs; の起動</title>
375
376        <para>&FindBugs; を起動するもうひとつの方法は、ラップしているスクリプトを使用する方法です。</para>
377
378<para>Unix 系のシステムにおいては、次のようなコマンドでラップしているスクリプトを起動します :<screen>
379<prompt>$ </prompt><command>&FBHome;/bin/findbugs <replaceable>オプション…</replaceable></command>
380</screen>
381</para>
382
383<para>Windows システムにおいては、ラップしているスクリプトを起動するコマンドは次のようになります。<screen>
384<prompt>C:\My Directory&gt;</prompt><command>&FBHomeWin;\bin\findbugs.bat <replaceable>オプション…</replaceable></command>
385</screen>
386</para>
387
388<para>Unix 系システム および Windows システムのどちらにおいても、ディレクトリー  <filename><replaceable>$FINDBUGS_HOME</replaceable>/bin</filename> を環境変数 <filename>PATH</filename> に追加するだけで、 <command>findbugs</command> コマンドを使用して FindBugs を起動することができます。</para>
389
390    <sect3 id="wrapperOptions">
391        <title>ラップしているスクリプトのコマンドラインオプション</title>
392        <para>&FindBugs; のラップしているスクリプトは、次のようなコマンドラインオプションをサポートしています。これらのコマンドラインオプションは &FindBugs; プログラム 自体が操作するのでは<emphasis>なく</emphasis>、どちらかといえば、ラップしているスクリプトの方が処理を行います。</para>
393    <variablelist>
394  <varlistentry>
395    <term><command>-jvmArgs <replaceable>引数</replaceable></command></term>
396    <listitem>
397       <para>JVM に受け渡される引数を指定します。例えば、次のような JVM プロパティが設定できます:<screen>
398<prompt>$ </prompt><command>findbugs -textui -jvmArgs &quot;-Duser.language=ja&quot; <replaceable>myApp.jar</replaceable></command>
399</screen>
400       </para>
401    </listitem>
402  </varlistentry>
403
404  <varlistentry>
405    <term><command>-javahome <replaceable>ディレクトリー</replaceable></command></term>
406    <listitem>
407      <para>&FindBugs; の実行に使用する JRE (Java ランタイム環境) がインストールされているディレクトリーを指定します。</para>
408    </listitem>
409  </varlistentry>
410
411  <varlistentry>
412    <term><command>-maxHeap <replaceable>サイズ</replaceable></command></term>
413    <listitem>
414      <para>Java ヒープサイズの最大値をメガバイト単位で指定します。デフォルトは、 256 です。巨大なプログラムやライブラリを分析するには、もっと大きなメモリー容量が必要になる可能性があります。</para>
415    </listitem>
416  </varlistentry>
417
418  <varlistentry>
419    <term><command>-debug</command></term>
420    <listitem>
421      <para>ディテクタ実行およびクラス分析のトレース情報が標準出力に出力されます。分析が予期せず失敗した際の、トラブルシューティングに有用です。</para>
422    </listitem>
423  </varlistentry>
424
425  <varlistentry>
426    <term><command>-property</command> <replaceable>name=value</replaceable></term>
427    <listitem>
428      <para>このオプションを使用してシステムプロパティーを設定することができます。 &FindBugs; はシステムプロパティーを使用して分析特性の設定を行います。<xref linkend="analysisprops"/> を参照してください。このオプションを複数指定して、複数のシステムプロパティを設定することが可能です。注:  Windows の多くのバージョンでは、 <replaceable>name=value</replaceable> 文字列を引用符で囲む必要があります。</para>
429    </listitem>
430  </varlistentry>
431
432    </variablelist>
433
434    </sect3>
435
436</sect2>
437
438</sect1>
439
440<sect1 id="commandLineOptions">
441<title>コマンドラインオプション</title>
442
443<!--
444<para>
445
446There are two ways to invoke &FindBugs;.  The first invokes the the Graphical User Interface (GUI):
447
448<screen>
449<prompt>$ </prompt><command>findbugs <replaceable>[standard options]</replaceable> <replaceable>[GUI options]</replaceable></command>
450</screen>
451
452The second invokes the Command Line Interface (Text UI):
453
454<screen>
455<prompt>$ </prompt><command>findbugs -textui <replaceable>[standard options]</replaceable> <replaceable>[Text UI options]</replaceable></command>
456</screen>
457</para>
458-->
459
460<para>このセクションでは、 &FindBugs; がサポートするコマンドラインオプションについて説明します。ここで示すコマンドラインオプションは、 &FindBugs; 直接起動、または、ラップしているスクリプトによる起動で使用できます。</para>
461
462<sect2>
463<title>共通のコマンドラインオプション</title>
464
465<para>ここで示すオプションは、 GUI および コマンドラインインタフェースの両方で使用できます。</para>
466
467<variablelist>
468
469  <varlistentry>
470    <term><command>-effort:min</command></term>
471    <listitem>
472      <para>このオプションを指定すると、精度を上げるために大量のメモリーを消費する分析が無効になります。&FindBugs; の実行時にメモリー不足になったり、分析を完了するまでに異常に長い時間がかかる場合に試してみてください。</para>
473    </listitem>
474  </varlistentry>
475
476
477  <varlistentry>
478    <term><command>-effort:max</command></term>
479    <listitem>
480      <para>精度が高く、より多くのバグを検出する分析を有効にします。ただし、多くのメモリー容量を必要とし、また、完了までの時間が多くかかる可能性があります。</para>
481    </listitem>
482  </varlistentry>
483
484  <varlistentry>
485  <term><command>-project</command> <replaceable>project</replaceable></term>
486  <listitem>
487    <para>分析するプロジェクトを指定します。指定するプロジェクトファイルには、 GUI を使って作成したものを使用してください。ファイルの拡張子は、一般的には <filename>.fb</filename> または <filename>.fbp</filename> です。</para>
488  </listitem>
489  </varlistentry>
490
491  <!--
492  <varlistentry>
493      <term><command></command></term>
494      <listitem>
495          <para>
496
497          </para>
498      </listitem>
499  </varlistentry>
500  -->
501
502</variablelist>
503
504</sect2>
505
506<sect2>
507<title>GUI オプション</title>
508
509<para>ここで示すオプションは、グラフィカルユーザーインタフェースでのみ使用できます。<variablelist> <varlistentry> <term><command>-look:</command><replaceable>plastic|gtk|native</replaceable></term>
510    <listitem>
511       <para>Swing のルック・アンド・フィールを設定します。</para>
512    </listitem>
513  </varlistentry>
514
515</variablelist>
516</para>
517</sect2>
518
519<sect2>
520<title>テキストユーザーインタフェースオプション</title>
521
522<para>ここで示すオプションは、テキストユーザーインタフェースでのみ使用できます。</para>
523
524<variablelist>
525  <varlistentry>
526    <term><command>-sortByClass</command></term>
527    <listitem>
528       <para>報告されるバグ検索結果をクラス名でソートします。</para>
529    </listitem>
530  </varlistentry>
531
532  <varlistentry>
533    <term><command>-include</command> <replaceable>filterFile.xml</replaceable></term>
534    <listitem>
535       <para><replaceable>filterFile.xml</replaceable> で指定したフィルターに一致したバグ検索結果のみ報告されます。<xref linkend="filter"/> を参照してください。</para>
536    </listitem>
537  </varlistentry>
538
539  <varlistentry>
540    <term><command>-exclude</command> <replaceable>filterFile.xml</replaceable></term>
541    <listitem>
542       <para><replaceable>filterFile.xml</replaceable> で指定したフィルターに一致したバグ検索結果は報告されません。<xref linkend="filter"/> を参照してください。</para>
543    </listitem>
544  </varlistentry>
545
546  <varlistentry>
547    <term><command>-onlyAnalyze</command> <replaceable>com.foobar.MyClass,com.foobar.mypkg.*</replaceable></term>
548    <listitem>
549      <para>コンマ区切りで指定したクラスおよびパッケージのみに限定して、バグ検出の分析を行うようにします。フィルターと違って、このオプションを使うと一致しないクラスおよびパッケージに対する分析の実行を回避することができます。大きなプロジェクトにおいて、このオプションを活用すると分析にかかる時間を大きく削減することができる可能性があります。(しかしながら、アプリケーションの全体で実行していないために不正確な結果を出してしまうディテクタがある可能性もあります。) クラスはパッケージも含んだ完全な名前を指定する必要があります。また、パッケージは、 Java の <literal>import</literal> 文でパッケージ下のすべてのクラスをインポートするときと同じ方法で指定します。 (すなわち、パッケージの完全な名前に <literal>.*</literal> を付け加えた形です。)<literal>.*</literal> の代わりに <literal>.-</literal> を指定すると、サブパッケージも含めてすべてが分析されます。</para>
550    </listitem>
551  </varlistentry>
552
553  <varlistentry>
554  <term><command>-low</command></term>
555  <listitem>
556    <para>すべてのバグが報告されます。</para>
557  </listitem>
558  </varlistentry>
559
560  <varlistentry>
561  <term><command>-medium</command></term>
562  <listitem>
563    <para>優先度 (中) および優先度 (高) のバグが報告されます。これは、デフォルトの設定値です。</para>
564  </listitem>
565  </varlistentry>
566
567  <varlistentry>
568  <term><command>-high</command></term>
569  <listitem>
570    <para>優先度 (高) のバグのみが報告されます。</para>
571  </listitem>
572  </varlistentry>
573
574  <varlistentry>
575    <term><command>-relaxed</command></term>
576    <listitem>
577        <para>手抜き報告モードです。このオプションを指定すると、多くのディテクタにおいて 誤検出を回避するためのヒューリスティック機能が抑止されます。</para>
578    </listitem>
579  </varlistentry>
580
581  <varlistentry>
582  <term><command>-xml</command></term>
583  <listitem>
584    <para>バグ報告が XML で作成されます。作成された XML データは 、後で GUI で見ることができます。このオプションは <command>-xml:withMessages</command> と指定することもできます。こうすると 出力 XML には 各バグに関して人間に読むことができるメッセージが含まれるようになります。このオプションで作成された XML ファイルは 報告書に変換するのが簡単です。</para>
585  </listitem>
586  </varlistentry>
587
588  <varlistentry>
589  <term><command>-html</command></term>
590  <listitem>
591    <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>
592
593    <para>ユーザー自身の XSLT スタイルシートを用いて HTML への変換を行いたい場合は、 <command>-html:<replaceable>myStylesheet.xsl</replaceable></command> のように指定してください。ここで、 <replaceable>myStylesheet.xsl</replaceable> はユーザーが使用したいスタイルシートのファイル名です。</para>
594  </listitem>
595  </varlistentry>
596
597  <varlistentry>
598  <term><command>-emacs</command></term>
599  <listitem>
600    <para>バグ報告が Emacs 形式で作成されます。</para>
601  </listitem>
602  </varlistentry>
603
604  <varlistentry>
605  <term><command>-xdocs</command></term>
606  <listitem>
607    <para>バグ報告が xdoc XML 形式で作成されます。Apache Mavenで使用できます。</para>
608  </listitem>
609  </varlistentry>
610
611  <varlistentry>
612    <term><command>-output</command> <replaceable>ファイル名</replaceable></term>
613    <listitem>
614       <para>指定したファイルに出力結果が作成されます。</para>
615    </listitem>
616  </varlistentry>
617
618  <varlistentry>
619    <term><command>-outputFile</command> <replaceable>ファイル名</replaceable></term>
620    <listitem>
621       <para>この引数は、使用すべきではありません。代わりに、 <command>-output</command> を使用してください。</para>
622    </listitem>
623  </varlistentry>
624
625  <varlistentry>
626  <term><command>-nested</command><replaceable>[:true|false]</replaceable></term>
627  <listitem>
628    <para>このオプションは、ファイルやディレクトリーの中で入れ子になった jar および zip ファイルを分析するかどうかを指定します。デフォルトでは、入れ子になった jar および zip ファイルも分析します。入れ子になった jar および zip ファイルの分析するを無効にする場合は、 <command>-nested:false</command> をコマンドライン引数に追加してください。</para>
629  </listitem>
630  </varlistentry>
631
632  <varlistentry>
633  <term><command>-auxclasspath</command> <replaceable>クラスパス</replaceable></term>
634  <listitem>
635    <para>分析時に使用する補助クラスパスを設定します。分析するプログラムで使用するjarファイルやクラスディレクトリーをすべて指定してください。補助クラスパスに指定したクラスは分析の対象にはなりません。</para>
636  </listitem>
637  </varlistentry>
638
639<!--
640  <varlistentry>
641  <term><command></command> <replaceable></replaceable></term>
642  <listitem>
643    <para>
644    </para>
645  </listitem>
646  </varlistentry>
647-->
648
649</variablelist>
650
651</sect2>
652</sect1>
653
654
655</chapter>
656
657<chapter id="gui">
658    <title>&FindBugs; GUI の使用方法</title>
659
660    <para>この章では、&FindBugs; グラフィカルユーザーインタフェース (GUI) の使用方法を説明します。</para>
661
662<sect1>
663<title>プロジェクトの作成</title>
664<para><command>findbugs</command>  コマンドで &FindBugs; を起動してから、メニューで <menuchoice><guimenu>File</guimenu><guimenuitem>New Project</guimenuitem></menuchoice> を選択してください。そうすると、次のようなダイアログが表示されます:<mediaobject>
665<imageobject>
666<imagedata fileref="project-dialog.png"/>
667</imageobject>
668</mediaobject>
669</para>
670
671<para>「Class archives and directories to analyze」テキストフィールドの横にある 「Add」ボタンを押すと、バグを分析する java クラスを含んでいる Java アーカイブファイル (zip, jar, ear, or war file) を選択して指定できます。複数の アーカイブ/ディレクトリーを追加することが可能です。</para>
672
673<para>また、分析を行う Java アーカイブのソースコードを含んだソースディレクトリーを指定することもできます。そうすると、バグの可能性があるソースコードの場所が、&FindBugs; 上でハイライトして表示されます。ソースディレクトリーは、Java パッケージ階層のルートディレクトリーを指定する必要があります。例えば、ユーザのアプリケーションが <varname>org.foobar.myapp</varname> パッケージの中にある場合は、 <filename class="directory">org</filename> ディレクトリーの親ディレクトリーをソースディレクトリーリストに指定する必要があります。</para>
674
675<para>もうひとつ、任意指定の手順があります。それは、補助用の Jar ファイルおよびディレクトリーを 「Auxiliary classpath locations」のエントリーに追加することです。分析するアーカイブ/ディレクトリーにも標準の実行時クラスパスにも含まれていないクラスを、分析するアーカイブ/ディレクトリーが参照している場合は、この項目を設定した方がいいでしょう。クラス階層に関する情報を使用するバグディテクタが、 &FindBugs; にはいくつかあります。したがって、&FindBugs; が分析を行うクラスの完全なクラス階層を参照できれば、より正確な分析結果を取得することができます。</para>
676
677</sect1>
678
679<sect1>
680<title>分析の実行</title>
681<para>アーカイブ、ディレクトリーおよびソースディレクトリーの指定ができれば、「Finish」ボタンを押して Jar ファイルに含まれるクラスに対する分析を実行します。巨大なプロジェクトを古いコンピュータ上で実行すると、かなりの時間(数十分)がかかることに注意してください。大容量メモリである最近のコンピュータなら、大きなプログラムであっても数分程度で分析できます。</para>
682</sect1>
683
684<sect1>
685<title>結果の閲覧</title>
686
687<para>分析が完了すると、次のような画面が表示されます :<mediaobject>
688  <imageobject>
689    <imagedata fileref="example-details.png"/>
690  </imageobject>
691</mediaobject>
692</para>
693
694<para>左上のペインにはバグ階層ツリーが表示されます。これは、分析でみつかったバグの検索結果が階層的に表示されたものです。</para>
695
696<para>上部のペインでバグ検索結果を選択すると、下部の「Details」ペインにバグの詳細説明が表示されます。更に、ソースがみつかれば、右上のソースコードペインにバグの出現箇所に該当するソースコードが表示されます。上図の例で表示されているバグは、ストリームオブジェクトがクローズされていないというものです。ソースコード・ウィンドウにおいて当該ストリームオブジェクトを生成している行がハイライトされています。</para>
697
698<para>バグの検索結果に対してテキストで注釈を入れることができます。階層ツリー図のすぐ下にあるテキストボックスに注釈を入力してください。記録しておきたい情報を何でも自由に入力することができます。バグ結果ファイルの保存および読み込みを行ったときに、注釈も保存されます。</para>
699
700</sect1>
701
702<sect1>
703<title>保存と読み込み</title>
704
705<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>
706
707</sect1>
708
709<!--
710<sect1 id="textui">
711<title>Using the &FindBugs;&trade; Command Line Interface</title>
712
713<para>
714The &FindBugs; Command Line Interface (or Text UI) can be used to
715analyze an application for bugs non-interactively.  Each bug instance will be
716reported on a single line.  All output is written to the standard output file descriptor.
717<xref linkend="filter" /> explains how bug reports may be filtered in order
718to get only the output you're interested in.
719</para>
720
721<para>
722See <xref linkend="commandLineOptions" /> for a description of how to invoke the
723Command Line Interface.
724</para>
725</sect1>
726-->
727
728</chapter>
729
730<!--
731   **************************************************************************
732   Using the FindBugs Ant task
733   **************************************************************************
734-->
735
736<chapter id="anttask">
737<title>&FindBugs;&trade; &Ant; タスクの使用方法</title>
738
739<para>この章では、 &FindBugs; を <ulink url="http://ant.apache.org/">&Ant;</ulink> のビルドスクリプトに組み入れる方法について説明します。 <ulink url="http://ant.apache.org/">&Ant;</ulink> は、ビルドや配備を行うことができる Java でよく使用されるツールです。&FindBugs; &Ant; タスクを使用すると、 ビルドスクリプトを作成して機械的に &FindBugs; による Java コードの分析を実行することができます。</para>
740
741<para>この &Ant; タスクは、 Mike Fagan 氏の多大な貢献によるものです。</para>
742
743<sect1>
744<title>&Ant; タスクのインストール</title>
745
746<para>&Ant; タスクのインストールは、 <filename>&FBHome;/lib/findbugs-ant.jar</filename> を &Ant; インストールディレクトリーの<filename>lib</filename> サブディレクトリーにコピーするだけです。<note>
747<para>使用する &Ant; タスクと &FindBugs; 本体は、同梱されていた同じバージョンのものを使用することを強く推奨します。別のバージョンの &FindBugs; に含まれていた &Ant; タスク Jar ファイルでの動作は保証しません。</para>
748</note>
749</para>
750
751</sect1>
752
753<sect1>
754<title>build.xml の書き方</title>
755
756<para>&FindBugs; を <filename>build.xml</filename> (&Ant; ビルドスクリプト) に組み入れるためにはまず、タスク定義を記述する必要があります。タスク定義は次のように記述します。:<screen>
757  &lt;taskdef name=&quot;findbugs&quot; classname=&quot;edu.umd.cs.findbugs.anttask.FindBugsTask&quot;/&gt;
758</screen>タスク定義は、 <literal>findbugs</literal> 要素を <filename>build.xml</filename> 上に記述したとき、そのタスクの実行に使用されるクラスを指定します。</para>
759
760<para>タスク定義の記述をすれば、<literal>findbugs</literal> タスクを使ってターゲットを定義できます。次に示すのは、 Apache <ulink url="http://jakarta.apache.org/bcel/">BCEL</ulink> ライブラリーを分析する場合を想定した <filename>build.xml</filename> の記述例です。<screen>
761  &lt;property name=&quot;findbugs.home&quot; value=&quot;/export/home/daveho/work/findbugs&quot; /&gt;
762
763  &lt;target name=&quot;findbugs&quot; depends=&quot;jar&quot;&gt;
764    &lt;findbugs home=&quot;${findbugs.home}&quot;
765              output=&quot;xml&quot;
766              outputFile=&quot;bcel-fb.xml&quot; &gt;
767      &lt;auxClasspath path=&quot;${basedir}/lib/Regex.jar&quot; /&gt;
768      &lt;sourcePath path=&quot;${basedir}/src/java&quot; /&gt;
769      &lt;class location=&quot;${basedir}/bin/bcel.jar&quot; /&gt;
770    &lt;/findbugs&gt;
771  &lt;/target&gt;
772</screen><literal>findbugs</literal> 要素には、 <literal>home</literal> 属性が必須です。 &FindBugs; のインストールディレクトリーすなわち &FBHome; の値を設定します。<xref linkend="installing"/> を参照してください。</para>
773
774<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>
775</sect1>
776
777<sect1>
778<title>タスクの実行</title>
779
780<para>コマンドラインから &Ant; を起動する例を次に示します。前述の <literal>findbugs</literal> ターゲットを使用しています。<screen>
781  <prompt>[daveho@noir]$</prompt> <command>ant findbugs</command>
782  Buildfile: build.xml
783
784  init:
785
786  compile:
787
788  examples:
789
790  jar:
791
792  findbugs:
793   [findbugs] Running FindBugs...
794   [findbugs] Bugs were found
795   [findbugs] Output saved to bcel-fb.xml
796
797  BUILD SUCCESSFUL
798  Total time: 35 seconds
799</screen>この事例においては、XML ファイルでバグ検索結果を保存しているので、 &FindBugs; GUI を使って結果を参照することができます。 <xref linkend="running"/> を参照してください。</para>
800
801</sect1>
802
803<sect1>
804<title>パラメーター</title>
805
806<para>このセクションでは、 &FindBugs; タスクを使用する際に、指定することができるパラメーターについて説明します。<variablelist> <varlistentry> <term><literal>class</literal></term>
807    <listitem>
808       <para>分析の対象となるクラス群を指定するためのネストされる要素です。<literal>class</literal> 要素には <literal>location</literal> 属性の指定が必須です。分析対象となるアーカイブファイル (jar, zip, 他)、ディレクトリーまたはクラスファイルの名前を記述します。1 つの <literal>findbugs</literal> 要素に対して、複数の <literal>class</literal> 子要素を指定することができます。</para>
809    </listitem>
810  </varlistentry>
811
812  <varlistentry>
813    <term><literal>auxClasspath</literal></term>
814    <listitem>
815       <para>任意指定のネストされる要素です。分析対象のライブラリーまたはアプリケーションによって使用されているが分析の対象にはしたくないクラスを含んでいるクラスパス (Jar ファイルまたはディレクトリー) を指定します。  &Ant; の Java タスクにある <literal>classpath</literal> 要素 と同じ方法で指定することができます。</para>
816    </listitem>
817  </varlistentry>
818
819  <varlistentry>
820    <term><literal>sourcePath</literal></term>
821    <listitem>
822       <para>任意指定のネストされる要素です。分析対象 Java コードのコンパイル時に使用したソースファイルを含んでいるソースディレクトリーへのパスを指定します。ソースパスを指定することにより、生成される XML のバグ出力結果に完全なソース情報をもたせることができ、後になって GUI で参照することができます。</para>
823    </listitem>
824  </varlistentry>
825
826  <varlistentry>
827    <term><literal>home</literal></term>
828    <listitem>
829       <para>必須属性です。&FindBugs; がインストールされているディレクトリー名を設定します。</para>
830    </listitem>
831  </varlistentry>
832
833  <varlistentry>
834    <term><literal>quietErrors</literal></term>
835    <listitem>
836       <para>任意指定のブール値属性です。true を設定すると、深刻な分析エラー発生やクラスがみつからないといった情報が &FindBugs; 出力に記録されません。デフォルトは、 false です。</para>
837    </listitem>
838  </varlistentry>
839
840  <varlistentry>
841    <term><literal>reportLevel</literal></term>
842    <listitem>
843       <para>任意指定の属性です。報告されるバグの優先度のしきい値を指定します。「low」に設定すると、すべてのバグが報告されます。「medium」 (デフォルト) に設定すると、優先度 (中)および優先度 (高)のバグが報告されます。「high」に設定すると、優先度 (高) のバグのみが報告されます。</para>
844    </listitem>
845  </varlistentry>
846
847  <varlistentry>
848    <term><literal>output</literal></term>
849    <listitem>
850       <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>
851    </listitem>
852  </varlistentry>
853 <varlistentry>
854    <term><literal>stylesheet</literal></term>
855    <listitem>
856       <para>任意指定の属性です。output 属性 に html を指定した場合に、 HTML 出力作成に使用されるスタイルシートを指定します。FindBugs 配布物に含まれているスタイルシートは、 default.xslfancy.xslfancy-hist.xslplain.xsl および summary.xsl です。デフォルト値は default.xsl です。</para>
857    </listitem>
858  </varlistentry>
859
860  <varlistentry>
861    <term><literal>sort</literal></term>
862    <listitem>
863       <para>任意指定の属性です。<literal>output</literal> 属性に「text」を指定した場合に、バグの報告をクラス順にソートするかどうかを <literal>sort</literal> 属性で指定します。デフォルトは、 true です。</para>
864    </listitem>
865  </varlistentry>
866
867  <varlistentry>
868    <term><literal>outputFile</literal></term>
869    <listitem>
870       <para>任意指定の属性です。指定した場合、&FindBugs; の出力はその名前のファイルへと保存されます。省略時、出力は &Ant; によって直接表示されます。</para>
871    </listitem>
872  </varlistentry>
873
874  <varlistentry>
875    <term><literal>debug</literal></term>
876    <listitem>
877       <para>任意指定のブール値属性です。true に設定すると、 &FindBugs; は 診断情報を出力します。どのクラスを分析しているか、どのパグパターンディテクタが実行されているか、という情報が表示されます。デフォルトは、 false です。</para>
878    </listitem>
879  </varlistentry>
880
881  <varlistentry>
882      <term><literal>effort</literal></term>
883      <listitem>
884          <para>分析の活動レベルを設定します。<literal>min</literal> 、<literal>default</literal> または <literal>max</literal> のいずれかの値を設定してください。分析レベルの設定に関する詳細情報は、 <xref linkend="commandLineOptions"/> を参照してください。</para>
885      </listitem>
886  </varlistentry>
887
888  <varlistentry>
889    <term><literal>conserveSpace</literal></term>
890    <listitem>
891       <para>effort=&quot;min&quot; と同義です。</para>
892    </listitem>
893  </varlistentry>
894
895  <varlistentry>
896    <term><literal>workHard</literal></term>
897    <listitem>
898       <para>effort=&quot;max&quot; と同義です。</para>
899    </listitem>
900  </varlistentry>
901
902  <varlistentry>
903    <term><literal>visitors</literal></term>
904    <listitem>
905       <para>任意指定の属性です。どのバグディテクタを実行するかをコンマ区切りのリストで指定します。バグディテクタはパッケージ指定なしのクラス名で指定します。省略時、デフォルトで無効化されているものを除くすべてのディテクタが実行されます。</para>
906    </listitem>
907  </varlistentry>
908
909  <varlistentry>
910    <term><literal>omitVisitors</literal></term>
911    <listitem>
912       <para>任意指定の属性です。<literal>visitors</literal> 属性と似ていますが、こちらは <emphasis>実行されない</emphasis> ディテクタを指定します。</para>
913    </listitem>
914  </varlistentry>
915
916  <varlistentry>
917    <term><literal>excludeFilter</literal></term>
918    <listitem>
919       <para>任意指定の属性です。フィルターファイル名を指定します。報告から除外されるバグを指定します。<xref linkend="filter"/> を参照してください。</para>
920    </listitem>
921  </varlistentry>
922
923  <varlistentry>
924    <term><literal>includeFilter</literal></term>
925    <listitem>
926       <para>任意指定の属性です。フィルターファイル名を指定します。報告されるバグを指定します。<xref linkend="filter"/> を参照してください。</para>
927    </listitem>
928  </varlistentry>
929
930  <varlistentry>
931    <term><literal>projectFile</literal></term>
932    <listitem>
933       <para>任意指定の属性です。プロジェクトファイル名を指定します。プロジェクトファイルは、 &FindBugs; GUI で作成します。分析されるクラス、および、補助クラスパス、ソースディレクトリーが記入されてます。プロジェクトファイルを指定した場合は、 <literal>class</literal> 要素・ <literal>auxClasspath</literal> 属性および <literal>sourcePath</literal> 属性を設定する必要はありません。プロジェクトの作成方法は、 <xref linkend="running"/> を参照してください。</para>
934    </listitem>
935  </varlistentry>
936
937  <varlistentry>
938    <term><literal>jvmargs</literal></term>
939    <listitem>
940       <para>任意指定の属性です。&FindBugs; を実行している Java 仮想マシンに対して受け渡される引数を指定します。巨大なプログラムを分析する場合に、 JVM が使用するメモリ容量を増やす指定をするためにこの引数を利用する必要があるかもしれません。</para>
941    </listitem>
942  </varlistentry>
943
944  <varlistentry>
945    <term><literal>systemProperty</literal></term>
946    <listitem>
947      <para>任意指定のネストされる要素です。指定した場合、Java システムプロパティーを定義します。<literal>name</literal> 属性にはシステムプロパティーの名前を指定します。そして、 <literal>value</literal> 属性にはシステムプロパティの値を指定します。</para>
948    </listitem>
949  </varlistentry>
950
951  <varlistentry>
952    <term><literal>timeout</literal></term>
953    <listitem>
954       <para>任意指定の属性です。&FindBugs; を実行している Java プロセス の実行許容時間をミリ秒単位で指定します。時間を超過するとハングアップしていると判断してプロセスが終了されます。デフォルトは、 600,000 ミリ秒 (10 分) です。巨大なプログラムの場合は、 &FindBugs; が分析を完了するまでに 10 分 以上掛かる可能性があることに注意してください。</para>
955    </listitem>
956  </varlistentry>
957
958  <varlistentry>
959    <term><literal>failOnError</literal></term>
960    <listitem>
961       <para>任意指定のブール値属性です。&FindBugs; の実行中にエラーがあった場合に、ビルドプロセス自体を打ち切って異常終了させるかどうかを指定します。デフォルトは、「false」です。</para>
962    </listitem>
963  </varlistentry>
964
965  <varlistentry>
966    <term><literal>errorProperty</literal></term>
967    <listitem>
968       <para>任意指定の属性です。&FindBugs; の実行中にエラーが発生した場合に、「true」が設定されるプロパティーの名前を指定します。</para>
969    </listitem>
970  </varlistentry>
971
972  <varlistentry>
973      <term><literal>warningsProperty</literal></term>
974      <listitem>
975          <para>任意指定の属性です。&FindBugs; が分析したプログラムにバグ報告が 1 件でもある場合に、「true」が設定されるプロパティーの名前を指定します。</para>
976      </listitem>
977  </varlistentry>
978
979</variablelist>
980
981
982</para>
983
984<!--
985
986-->
987
988</sect1>
989
990</chapter>
991
992<!--
993   **************************************************************************
994   Using the FindBugs Eclipse plugin
995   **************************************************************************
996-->
997
998<chapter id="eclipse">
999<title>&FindBugs;&trade; Eclipse プラグインの使用方法</title>
1000
1001<para>FindBugs Eclipse プラグインを使用することによって、 &FindBugs; を <ulink url="http://www.eclipse.org/">Eclipse</ulink> IDE で使用することができるようになります。このFindBugs Eclipse プラグインは、 Peter Friese 氏の多大な貢献によるものです。Phil Crosby 氏 と Andrei Loskutov 氏は、プラグインの重要な改良に貢献しました。</para>
1002
1003<sect1>
1004<title>必要条件</title>
1005
1006<para>&FindBugs; Eclipse Plugin を使用するためには、 Eclipse 3.3 あるいはそれ以降のバージョン、また、 JRE/JDK 1.5 あるいはそれ以降のバージョンが必要です。</para>
1007
1008</sect1>
1009
1010<sect1>
1011<title>インストール</title>
1012
1013<para>更新サイトが提供されています。更新サイトを利用して、機械的に FindBugs を Eclipse にインストールできます。また自動的に、最新版のアップデートを照会してインストールすることもできます。内容の異なる 3 つの更新サイトが存在します。</para>
1014
1015  <variablelist><title>FindBugs Eclipse 更新サイト一覧</title>
1016    <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse/">http://findbugs.cs.umd.edu/eclipse/</ulink></term>
1017
1018    <listitem>
1019      <para>FindBugs の公式リリース物を提供します。</para>
1020    </listitem>
1021    </varlistentry>
1022
1023    <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse-candidate/">http://findbugs.cs.umd.edu/eclips-candidate/</ulink></term>
1024
1025      <listitem>
1026        <para>FindBugsの公式リリース物に加えて、公式リリース候補版を提供します。</para>
1027      </listitem>
1028    </varlistentry>
1029
1030    <varlistentry><term><ulink url="http://findbugs.cs.umd.edu/eclipse-daily/">http://findbugs.cs.umd.edu/eclipse-daily/</ulink></term>
1031
1032      <listitem>
1033        <para>FindBugsの日次ビルド物を提供します。コンパイルができること以上のテストは行われていません。</para>
1034      </listitem>
1035    </varlistentry>
1036    </variablelist>
1037
1038<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>
1039
1040<para>プラグインの展開ができたら、 Eclipse を起動して <menuchoice> <guimenu>Help</guimenu> <guimenuitem>About Eclipse Platform</guimenuitem> <guimenuitem>Plug-in Details</guimenuitem> </menuchoice> を選択してください。「FindBugs Project」から提供された「FindBugs Plug-in」というプラグインがあることを確認してください。</para>
1041</sect1>
1042
1043<sect1>
1044<title>プラグインの使用方法</title>
1045
1046<para>実行するには、 Java プロジェクト上で右クリックして「Find Bugs」を選択します。&FindBugs; が実行されて、バグパターンの実例の可能性があると識別されたコード箇所に問題マーカーがつきます。 (ソース画面および Eclipse 問題ビューに表示されます。)</para>
1047
1048<para>Java プロジェクトのプロパティーダイアログを開いて「Findbugs」プロパティーページを選択することで、 &FindBugs; の動作をカスタマイズすることができます。選択できる項目には次のようなものがあります :</para>
1049
1050<itemizedlist>
1051  <listitem>
1052    <para>「Run FindBugs Automatically」チェックボックスの設定。チェックすると、プロジェクト内の Java クラスが修正されるたびに FindBugs が実行されます。</para>
1053  </listitem>
1054
1055  <listitem>
1056    <para>優先度とバグカテゴリーの選択。これらのオプションは、どの警告を表示するかを選択します。例えば、優先度で 「Medium」 を選択すると、優先度 (中) および優先度 (高) の警告のみが表示されます。同様に、「Style」チェックボックスのチェックマークを外すと、Style カテゴリーに属する警告は表示されません。</para>
1057  </listitem>
1058
1059  <listitem>
1060    <para>ディテクタの選択。表からプロジェクトで有効にしたいディテクタを選択することができます。</para>
1061  </listitem>
1062</itemizedlist>
1063
1064</sect1>
1065
1066<sect1>
1067<title>トラブルシューティング</title>
1068
1069<para>&FindBugs; Eclipse プラグインは、まだ実験段階です。このセクションでは、プラグインに関する一般的な問題と (判明していれば) それらの問題の解決方法を記述します。</para>
1070
1071<itemizedlist>
1072  <listitem>
1073    <para>&FindBugs; 問題マーカーが (ソース画面および問題ビューに) 表示されない場合は、問題ビューのフィルター設定を変更してください。詳細情報は <ulink url="http://findbugs.sourceforge.net/FAQ.html#q7">http://findbugs.sourceforge.net/FAQ.html#q7</ulink> を参照してください。</para>
1074  </listitem>
1075
1076</itemizedlist>
1077
1078</sect1>
1079
1080
1081</chapter>
1082
1083
1084<!--
1085   **************************************************************************
1086   Filter files
1087   **************************************************************************
1088-->
1089
1090<chapter id="filter">
1091<title>フィルターファイル</title>
1092
1093<para>フィルターファイルを使用することで、特定のクラスやメソッドをバグ報告に含めたりバグ報告から除外したりすることができます。この章では、フィルターファイルの使用方法を説明します。<note>
1094<title>計画されている機能</title>
1095<para>フィルターは現在、コマンドラインインタフェースでのみサポートされています。最終的には、フィルターのサポートは GUI にも追加される予定です。</para>
1096</note>
1097</para>
1098
1099
1100<sect1>
1101<title>フィルターファイルの概要</title>
1102
1103<para>概念的に言えば、フィルターはバグ検索結果をある基準と照合します。フィルターを定義することで、 特別な取り扱いをするバグ検索結果を選択することができます。例えば、あるバグ検索結果をバグ報告に含めたり、バグ報告から除外したりすることができます。</para>
1104
1105<para>フィルターファイルは、 <ulink url="http://www.w3.org/XML/">XML</ulink> 文書です。最上位要素が <literal>FindBugsFilter</literal> 要素 であり、その子要素として <literal>Match</literal> 要素を複数個定義します。それぞれの <literal>Match</literal> 要素は、生成されたバグ検索結果に適用される述部にあたります。通常、フィルターはバグ検索結果を除外するために使用します。次に、例を示します:<screen>
1106<prompt>$ </prompt><command>findbugs -textui -exclude <replaceable>myExcludeFilter.xml</replaceable> <replaceable>myApp.jar</replaceable></command>
1107</screen>また一方で、的をしぼった報告を得るためにバグ報告結果を選択するためにフィルターを使用することも考えられます :<screen>
1108<prompt>$ </prompt><command>findbugs -textui -include <replaceable>myIncludeFilter.xml</replaceable> <replaceable>myApp.jar</replaceable></command>
1109</screen>
1110</para>
1111
1112<para>
1113<literal>Match</literal> 要素は子要素を持ちます。それらの子要素は論理積で述部になります。つまり、述部が真であるためには、すべての子要素が真である必要があります。</para>
1114
1115</sect1>
1116
1117<sect1>
1118<title>マッチング条件の種類</title>
1119
1120<variablelist>
1121 <varlistentry>
1122   <term><literal>&lt;Bug&gt;</literal></term>
1123   <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>
1124 </varlistentry>
1125
1126 <varlistentry>
1127    <term><literal>&lt;Priority&gt;</literal></term>
1128    <listitem>
1129        <para>この要素は、特定の優先度をもつ警告を照合します。<literal>value</literal> 属性には、整数値を指定します : 1 は優先度(高)、また、 2  は優先度(中) 、 3 は優先度(低) を示します。</para>
1130    </listitem>
1131 </varlistentry>
1132
1133
1134 <varlistentry>
1135   <term><literal>&lt;Package&gt;</literal></term>
1136    <listitem>
1137        <para>この要素は、 <literal>name</literal> 属性で指定した特定のパッケージ内にあるクラスに関連した警告を照合します。入れ子のパッケージは含まれません (Java import 文に従っています) 。しかしながら、正規表現を使うと複数パッケージにマッチさせることは簡単にできます。</para>
1138    </listitem>
1139  </varlistentry>
1140
1141 <varlistentry>
1142   <term><literal>&lt;Class&gt;</literal></term>
1143    <listitem>
1144        <para>この要素は、特定のクラスに関連した警告を照合します。<literal>name</literal> 属性を使用して、照合するクラス名をクラス名そのものか、または、正規表現で指定します。</para>
1145
1146        <para>下位互換性を持たせたい場合は、この要素の代わりに <literal>Match</literal> 要素を使用してください。クラス名そのものの指定は <literal>class</literal> 属性を、クラス名を正規表現で指定する場合は <literal>classregex</literal> 属性をそれぞれ使用してください</para>
1147
1148        <para>もし <literal>Match</literal> 要素に <literal>Class</literal> 要素が無かったり、 <literal>class</literal> / <literal>classregex</literal> 属性が無かったりした場合は、すべてのクラスに適用されます。その場合、想定外に多くのバグ検索結果が一致してしまうことがあり得ます。その場合は、適当なメソッドやフィールドで絞り込んでください。</para>
1149    </listitem>
1150 </varlistentry>
1151
1152 <varlistentry>
1153   <term><literal>&lt;Method&gt;</literal></term>
1154
1155   <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>
1156 </varlistentry>
1157
1158 <varlistentry>
1159   <term><literal>&lt;Field&gt;</literal></term>
1160
1161   <listitem><para>この要素は、フィールドを指定します。<literal>name</literal> 属性を使用して、照合するフィールド名をフィールド名そのものか、または、正規表現で指定します。また、フィールドのシグニチャーに照らしたフィルタリングをすることができます。 <literal>type</literal> 属性を使用して、フィールドの型を完全修飾名で指定してください。名前とシグニチャーに基づく条件を規定するために、その2つの属性を両方とも指定することができます。</para></listitem>
1162 </varlistentry>
1163
1164   <varlistentry>
1165   <term><literal>&lt;Local&gt;</literal></term>
1166
1167   <listitem><para>この要素は、ローカル変数を指定します。<literal>name</literal> 属性を使用して、照合するローカル変数名をローカル変数名そのものか、または、正規表現で指定します。ローカル変数とは、メソッド内で定義した変数です。</para></listitem>
1168 </varlistentry>
1169
1170 <varlistentry>
1171   <term><literal>&lt;Or&gt;</literal></term>
1172    <listitem><para>この要素は、論理和として <literal>Match</literal> 条項を結合します。すなわち、2つの <literal>Method</literal> 要素を <literal>Or</literal> 条項に入れることで、どちらか一方のメソッドでマッチさせることができます。</para></listitem>
1173 </varlistentry>
1174</variablelist>
1175
1176</sect1>
1177
1178<sect1>
1179<title>Java 要素名マッチング</title>
1180
1181<para><literal>Class</literal> 、 <literal>Method</literal> または <literal>Field</literal> の <literal>name</literal> 属性が文字 ~ で始まっている場合は、属性値の残りの部分を Java の正規表現として解釈します。そうして、当該 Java 要素の名前に対しての照合が行われます。</para>
1182
1183<para>パターンの照合は要素の名前全体に対して行われることに注意してください。そのため、部分一致照合を行いたい場合はパターン文字列の前後に .* を付加して使用する必要があります。</para>
1184
1185<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>
1186</sect1>
1187
1188<sect1>
1189<title>留意事項</title>
1190
1191<para>
1192<literal>Match</literal> 条項は、バグ検索結果に実際に含まれている情報にのみ一致します。すべてのバグ検索結果はクラスを持っています。したがって、一般的に言って、バグを除外するためにはクラスを用いて行うとうまくいくことが多いです。</para>
1193
1194<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>
1195   &lt;Match&gt;
1196      &lt;Class name=&quot;com.foobar.A&quot; /&gt;
1197      &lt;Bug code=&quot;IC&quot; /&gt;
1198   &lt;/Match&gt;
1199
1200   &lt;Match&gt;
1201      &lt;Class name=&quot;com.foobar.B&quot; /&gt;
1202      &lt;Bug code=&quot;IC&quot; /&gt;
1203   &lt;/Match&gt;
1204</programlisting>明示的に両方のクラスで照合することによって、循環しているどちらのクラスがバグ検索結果の 1 番目になっているかに関係なく一致させることができます。(もちろんこの方法は、処理循環が &quot;com.foobar.A&quot; 、 &quot;com.foobar.B&quot; に加えて3番目のクラスも含んでいる場合は図らずも失敗してしまう恐れがあります。)</para>
1205
1206<para>多くの種類のバグ報告は、自身が出現したメソッドを報告します。それらのバグ検索結果に対しては、 <literal>Method</literal> 条項を <literal>Match</literal> 要素に加えると期待通りの動作をするでしょう。</para>
1207
1208</sect1>
1209
1210<sect1>
1211<title>例</title>
1212
1213<para>1. 特定のクラスに対するすべてのバグ報告に一致させます。<programlisting>
1214<![CDATA[
1215     <Match>
1216       <Class name="com.foobar.MyClass" />
1217     </Match>
1218]]>
1219</programlisting>
1220
1221</para>
1222
1223<para>2. バグ略称を指定して、特定のクラスに対する特定の検査項目に一致させます。<programlisting>
1224<![CDATA[
1225     <Match>
1226       <Class name="com.foobar.MyClass"/ >
1227       <Bug code="DE,UrF,SIC" />
1228     </Match>
1229]]>
1230</programlisting>
1231</para>
1232
1233<para>3. バグ略称を指定して、すべてのクラスに対する特定の検査項目に一致させます。<programlisting>
1234<![CDATA[
1235     <Match>
1236       <Bug code="DE,UrF,SIC" />
1237     </Match>
1238]]>
1239</programlisting>
1240</para>
1241
1242<para>4. バグカテゴリーを指定して、すべてのクラスに対する特定の検査項目に一致させます。<programlisting>
1243<![CDATA[
1244     <Match>
1245       <Bug category="PERFORMANCE" />
1246     </Match>
1247]]>
1248</programlisting>
1249</para>
1250
1251<para>5. バグ略称を指定して、特定のクラスの指定されたメソッドに対する特定のバグ種別に一致させます。<programlisting>
1252<![CDATA[
1253     <Match>
1254       <Class name="com.foobar.MyClass" />
1255       <Or>
1256         <Method name="frob" params="int,java.lang.String" returns="void" />
1257         <Method name="blat" params="" returns="boolean" />
1258       </Or>
1259       <Bug code="DC" />
1260     </Match>
1261]]>
1262</programlisting>
1263</para>
1264
1265<para>6. 特定のメソッドに対する特定のバグパターンに一致させます。<programlisting>
1266<![CDATA[
1267    <!-- open stream に関する誤検出があるメソッド。-->
1268    <Match>
1269      <Class name="com.foobar.MyClass" />
1270      <Method name="writeDataToFile" />
1271      <Bug pattern="OS_OPEN_STREAM" />
1272    </Match>
1273]]>
1274</programlisting>
1275</para>
1276
1277<para>7. 特定のメソッドに対する特定の優先度を付与された特定のバグパターンに一致させます。<programlisting>
1278<![CDATA[
1279    <!-- dead local store (優先度 (中)) に関する誤検出があるメソッド。-->
1280    <Match>
1281      <Class name="com.foobar.MyClass" />
1282      <Method name="someMethod" />
1283      <Bug pattern="DLS_DEAD_LOCAL_STORE" />
1284      <Priority value="2" />
1285    </Match>
1286]]>
1287</programlisting>
1288</para>
1289
1290<para>8. AspectJ コンパイラーによって引き起こされるマイナーバグに一致させます (AspectJ の開発者でもない限り、それらのバグに関心を持つことはないと考えます)。<programlisting>
1291<![CDATA[
1292    <Match>
1293      <Class name="~.*\$AjcClosure\d+" />
1294      <Bug pattern="DLS_DEAD_LOCAL_STORE" />
1295      <Method name="run" />
1296    </Match>
1297    <Match>
1298      <Bug pattern="UUF_UNUSED_FIELD" />
1299      <Field name="~ajc\$.*" />
1300    </Match>
1301]]>
1302</programlisting>
1303</para>
1304
1305<para>9. 基盤コードの特定の部分に対するバグに一致させます<programlisting>
1306<![CDATA[
1307    <!-- すべてのパッケージにある Messages クラスに対する unused fields 警告に一致。 -->
1308    <Match>
1309      <Class name="~.*\.Messages" />
1310      <Bug code="UUF" />
1311    </Match>
1312    <!-- すべての internal パッケージ内の mutable statics 警告に一致。 -->
1313    <Match>
1314      <Package name="~.*\.internal" />
1315      <Bug code="MS" />
1316    </Match>
1317    <!-- ui パッケージ階層内の anonymoous inner classes 警告に一致。 -->
1318    <Match>
1319      <Package name="~com\.foobar\.fooproject\.ui.*" />
1320      <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" />
1321    </Match>
1322]]>
1323</programlisting>
1324</para>
1325
1326<para>10. 特定のシグニチャーを持つフィールドまたはメソッドのバグに一致させます。<programlisting>
1327<![CDATA[
1328    <!-- すべてのクラスの main(String[]) メソッドに対する System.exit(...) usage 警告に一致。 -->
1329    <Match>
1330      <Method returns="void" name="main" params="java.lang.String[]" />
1331      <Method pattern="DM_EXIT" />
1332    </Match>
1333    <!-- すべてのクラスの com.foobar.DebugInfo 型のフィールドに対する UuF 警告に一致。 -->
1334    <Match>
1335      <Field type="com.foobar.DebugInfo" />
1336      <Bug code="UuF" />
1337    </Match>
1338]]>
1339</programlisting>
1340
1341</para>
1342
1343</sect1>
1344
1345<sect1>
1346<title>完全な例</title>
1347
1348<programlisting>
1349<![CDATA[
1350<FindBugsFilter>
1351     <Match>
1352       <Class name="com.foobar.ClassNotToBeAnalyzed" />
1353     </Match>
1354
1355     <Match>
1356       <Class name="com.foobar.ClassWithSomeBugsMatched" />
1357       <Bug code="DE,UrF,SIC" />
1358     </Match>
1359
1360     <!-- XYZ 違反に一致。-->
1361     <Match>
1362       <Bug code="XYZ" />
1363     </Match>
1364
1365     <!-- "AnotherClass" の特定のメソッドの doublecheck 違反に一致。-->
1366     <Match>
1367       <Class name="com.foobar.AnotherClass" />
1368       <Or>
1369         <Method name="nonOverloadedMethod" />
1370         <Method name="frob" params="int,java.lang.String" returns="void" />
1371         <Method name="blat" params="" returns="boolean" />
1372       </Or>
1373       <Bug code="DC" />
1374     </Match>
1375
1376     <!-- dead local store (優先度 (中)) に関する誤検出があるメソッド。-->
1377     <Match>
1378       <Class name="com.foobar.MyClass" />
1379       <Method name="someMethod" />
1380       <Bug pattern="DLS_DEAD_LOCAL_STORE" />
1381       <Priority value="2" />
1382     </Match>
1383</FindBugsFilter>
1384]]>
1385</programlisting>
1386
1387</sect1>
1388
1389
1390</chapter>
1391
1392
1393<!--
1394   **************************************************************************
1395   Analysis properties
1396   **************************************************************************
1397-->
1398
1399<chapter id="analysisprops">
1400<title>分析プロパティー</title>
1401
1402<para>&FindBugs; は分析する場合にいくつかの観点を持っています。そして、観点をカスタマイズして実行することができます。システムプロパティーを使って、それらのオプションを設定します。この章では、分析オプションの設定方法を説明します。</para>
1403
1404<para>分析オプションの主な目的は、 2 つあります。1 番目は、 &FindBugs; に対して分析されるアプリケーションのメソッドの意味を伝えることです。そうすることで &FindBugs; がより正確な結果を出すことができ、誤検出を減らすことができます。2 番目に、分析を行うに当たりその精度を設定できるようにすることです。分析の精度を落とすことで、メモリ使用量と分析時間を減らすことができます。ただし、本当のバグを見逃したり、誤検出の数が増えるという代償があります。</para>
1405
1406<para>コマンドラインオプション <command>-property</command> を使って、分析オプションを設定することができます。次に、例を示します:<screen>
1407<prompt>$ </prompt><command>findbugs -textui -property &quot;cfg.noprune=true&quot; <replaceable>myApp.jar</replaceable></command>
1408</screen>
1409</para>
1410
1411<para>設定することができる分析オプションの一覧を <xref linkend="analysisproptable"/> に示します。</para>
1412
1413<table id="analysisproptable">
1414<title>設定可能な分析プロパティー</title>
1415<tgroup cols="3" align="left">
1416  <thead>
1417    <row>
1418      <entry>プロパティー名</entry>
1419      <entry>設定値</entry>
1420      <entry>目的</entry>
1421    </row>
1422  </thead>
1423  <tbody>
1424<!--
1425    <row>
1426      <entry>cfg.noprune</entry>
1427      <entry>true or false</entry>
1428      <entry>If true, infeasible exception edges are not pruned from
1429      the control flow graphs of analyzed methods.  This option
1430      increases the speed of the analysis (by about 20%-30%),
1431      but causes some detectors to produce more false warnings.</entry>
1432    </row>
1433-->
1434    <row>
1435      <entry>findbugs.assertionmethods</entry>
1436      <entry>コンマ区切りの完全修飾メソッド名リスト : 例、 &quot;com.foo.MyClass.checkAssertion&quot;</entry>
1437      <entry>このプロパティーには、プログラムが正しいことをチェックするために使われるメソッドを指定します。これらのメソッドを指定することで、 チェックメソッドで確認した値に対する null 参照アクセスディテクタの誤検出を回避できます。</entry>
1438    </row>
1439    <row>
1440      <entry>findbugs.de.comment</entry>
1441      <entry>true または false</entry>
1442      <entry>true に設定すると、 DroppedException (無視された例外) ディテクタは空の catch ブロック にコメントが無いか探します。そして、コメントがみつかった場合には警告が報告されません。</entry>
1443    </row>
1444    <row>
1445      <entry>findbugs.maskedfields.locals</entry>
1446      <entry>true または false</entry>
1447      <entry>true に設定すると、フィールドを隠蔽しているローカル変数に対して優先度(低)の警告が発行されます。デフォルトは、 false です。</entry>
1448    </row>
1449    <row>
1450      <entry>findbugs.nullderef.assumensp</entry>
1451      <entry>true または false</entry>
1452      <entry>使用されません。 (意図 : true に設定すると、null 参照アクセスディテクタはメソッドからの戻り値、または、メソッドに受け渡される引数を null であると仮定します。デフォルトは、 false です。このプロパティーを有効にすると、大量の誤検出が生成されるであろうことに注意してください。)</entry>
1453    </row>
1454    <row>
1455      <entry>findbugs.refcomp.reportAll</entry>
1456      <entry>true または false</entry>
1457      <entry>true に設定すると、  == および != 演算子を使っている疑わしい参照比較がすべて報告されます。 false に設定すると、同様の警告は 1 メソッドにつき 1 つしか発行されません。デフォルトは、 false です。</entry>
1458    </row>
1459    <row>
1460      <entry>findbugs.sf.comment</entry>
1461      <entry>true または false</entry>
1462      <entry>true に設定すると、 SwitchFallthrough ディテクタはソースコードに「fall」または「nobreak」という単語を含んだコメントを記載していない caseラベル に限り警告を報告します。(この機能が正しく動作するためには、正確なソースパスが必要です。) これにより、意図的ではない switch 文の fallthrough を発見し易くなります。</entry>
1463    </row>
1464<!-- see others at src/doc/manual/sysprops.html
1465    <row>
1466      <entry></entry>
1467      <entry></entry>
1468      <entry></entry>
1469    </row>
1470-->
1471  </tbody>
1472</tgroup>
1473</table>
1474
1475</chapter>
1476
1477<!--
1478    **************************************************************************
1479   Annotations
1480   ***************************************************************************
1481-->
1482
1483<chapter id="annotations">
1484<title>アノテーション</title>
1485
1486<para>&FindBugs; はいくつかのアノテーションをサポートしています。開発者の意図を明確にすることで、 FindBugs はより的確に警告を発行することができます。アノテーションを使用するためには Java 5 が必要であり、 annotations.jar および jsr305.jar ファイルをコンパイル時のクラスパスに含める必要があります。</para>
1487
1488<variablelist>
1489  <varlistentry>
1490    <term><command>edu.umd.cs.findbugs.annotations.CheckForNull</command></term>
1491    <listitem>
1492<command>[Target]</command> Field, Method, Parameter
1493    </listitem>
1494    <listitem>
1495      <para>アノテーションをつけた要素は、 null である可能性があります。したがって、当該要素を使用する際は null チェックをするべきです。このアノテーションをメソッドに適用すると、メソッドの戻り値に適用されます。</para>
1496    </listitem>
1497  </varlistentry>
1498
1499  <varlistentry>
1500    <term><command>edu.umd.cs.findbugs.annotations.CheckReturnValue</command></term>
1501    <listitem>
1502      <command>[Target]</command> Method, Constructor
1503    </listitem>
1504    <listitem>
1505      <variablelist>
1506        <varlistentry>
1507          <term><command>[Parameter]</command></term>
1508          <listitem>
1509            <para>
1510              <command>priority:</command> 警告の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1511          </listitem>
1512          <listitem>
1513            <para>
1514              <command>explanation:</command>戻り値をチェックしなけばならない理由をテキストで説明します。デフォルト値 :&quot;&quot;。</para>
1515          </listitem>
1516        </varlistentry>
1517      </variablelist>
1518    </listitem>
1519    <listitem>
1520      <para>このアノテーションを使用して、呼出し後に戻り値をチェックすべきメソッドを表すことができます。</para>
1521    </listitem>
1522  </varlistentry>
1523
1524  <varlistentry>
1525    <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotation</command></term>
1526    <listitem>
1527      <command>[Target]</command> Type, Package
1528    </listitem>
1529    <listitem>
1530      <variablelist>
1531        <varlistentry>
1532          <term><command>[Parameter]</command></term>
1533          <listitem>
1534            <para>
1535              <command>value:</command>アノテーションクラスのclassオブジェクト。複数のクラスを指定することができます。</para>
1536          </listitem>
1537          <listitem>
1538            <para>
1539              <command>priority:</command>省略時の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1540          </listitem>
1541        </varlistentry>
1542      </variablelist>
1543    </listitem>
1544    <listitem>
1545      <para>
1546Indicates that all members of the class or package should be annotated with the default
1547value of the supplied annotation classes. This would be used for behavior annotations
1548such as @NonNull, @CheckForNull, or @CheckReturnValue. In particular, you can use
1549@DefaultAnnotation(NonNull.class) on a class or package, and then use @Nullable only
1550on those parameters, methods or fields that you want to allow to be null.
1551      </para>
1552    </listitem>
1553  </varlistentry>
1554
1555  <varlistentry>
1556    <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForFields</command></term>
1557    <listitem>
1558      <command>[Target]</command> Type, Package
1559    </listitem>
1560    <listitem>
1561      <variablelist>
1562        <varlistentry>
1563          <term><command>[Parameter]</command></term>
1564          <listitem>
1565            <para>
1566              <command>value:</command>アノテーションクラスのclassオブジェクト。複数のクラスを指定することができます。</para>
1567          </listitem>
1568          <listitem>
1569            <para>
1570              <command>priority:</command>省略時の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1571          </listitem>
1572        </varlistentry>
1573      </variablelist>
1574    </listitem>
1575    <listitem>
1576      <para>
1577This is same as the DefaultAnnotation except it only applys to fields.
1578      </para>
1579    </listitem>
1580  </varlistentry>
1581
1582  <varlistentry>
1583    <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForMethods</command></term>
1584    <listitem>
1585      <command>[Target]</command> Type, Package
1586    </listitem>
1587    <listitem>
1588      <variablelist>
1589        <varlistentry>
1590          <term><command>[Parameter]</command></term>
1591          <listitem>
1592            <para>
1593              <command>value:</command>アノテーションクラスのclassオブジェクト。複数のクラスを指定することができます。</para>
1594          </listitem>
1595          <listitem>
1596            <para>
1597              <command>priority:</command>省略時の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1598          </listitem>
1599        </varlistentry>
1600      </variablelist>
1601    </listitem>
1602    <listitem>
1603      <para>
1604This is same as the DefaultAnnotation except it only applys to methods.
1605      </para>
1606    </listitem>
1607  </varlistentry>
1608
1609  <varlistentry>
1610    <term><command>edu.umd.cs.findbugs.annotations.DefaultAnnotationForParameters</command></term>
1611    <listitem>
1612      <command>[Target]</command> Type, Package
1613    </listitem>
1614    <listitem>
1615      <variablelist>
1616        <varlistentry>
1617          <term><command>[Parameter]</command></term>
1618          <listitem>
1619            <para>
1620              <command>value:</command>アノテーションクラスのclassオブジェクト。複数のクラスを指定することができます。</para>
1621          </listitem>
1622          <listitem>
1623            <para>
1624              <command>priority:</command>省略時の優先度を指定します (HIGH, MEDIUM, LOW, IGNORE) 。デフォルト値 :MEDIUM。</para>
1625          </listitem>
1626        </varlistentry>
1627      </variablelist>
1628    </listitem>
1629    <listitem>
1630      <para>
1631This is same as the DefaultAnnotation except it only applys to method parameters.
1632      </para>
1633    </listitem>
1634  </varlistentry>
1635
1636  <varlistentry>
1637    <term><command>edu.umd.cs.findbugs.annotations.NonNull</command></term>
1638    <listitem>
1639      <command>[Target]</command> Field, Method, Parameter
1640    </listitem>
1641    <listitem>
1642      <para>アノテーションをつけた要素は、 null であってはいけません。アノテーションをつけたフィールドは、構築完了後 null であってはいけません。アノテーションをつけたメソッドは、 null ではない値を戻り値としなければなりません。</para>
1643    </listitem>
1644  </varlistentry>
1645
1646  <varlistentry>
1647    <term><command>edu.umd.cs.findbugs.annotations.Nullable</command></term>
1648    <listitem>
1649      <command>[Target]</command> Field, Method, Parameter
1650    </listitem>
1651    <listitem>
1652      <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>
1653      <para>
1654In pratice this annotation is useful only for overriding an overarching NonNull
1655annotation.
1656      </para>
1657    </listitem>
1658  </varlistentry>
1659
1660  <varlistentry>
1661    <term><command>edu.umd.cs.findbugs.annotations.OverrideMustInvoke</command></term>
1662    <listitem>
1663      <command>[Target]</command> Method
1664    </listitem>
1665    <listitem>
1666      <variablelist>
1667        <varlistentry>
1668          <term><command>[Parameter]</command></term>
1669          <listitem>
1670            <para>
1671              <command>value:</command>Specify when the super invocation should be
1672              performed (FIRST, ANYTIME, LAST). Default value:ANYTIME.
1673            </para>
1674          </listitem>
1675        </varlistentry>
1676      </variablelist>
1677    </listitem>
1678    <listitem>
1679      <para>
1680Used to annotate a method that, if overridden, must (or should) be invoke super
1681in the overriding method. Examples of such methods include finalize() and clone().
1682The argument to the method indicates when the super invocation should occur:
1683at any time, at the beginning of the overriding method, or at the end of the overriding method.
1684(This anotation is not implmemented in FindBugs as of September 8, 2006).
1685      </para>
1686    </listitem>
1687  </varlistentry>
1688
1689  <varlistentry>
1690    <term><command>edu.umd.cs.findbugs.annotations.PossiblyNull</command></term>
1691    <listitem>
1692      <para>
1693This annotation is deprecated. Use CheckForNull instead.
1694      </para>
1695    </listitem>
1696  </varlistentry>
1697
1698  <varlistentry>
1699    <term><command>edu.umd.cs.findbugs.annotations.SuppressWarnings</command></term>
1700    <listitem>
1701      <command>[Target]</command> Type, Field, Method, Parameter, Constructor, Package
1702    </listitem>
1703    <listitem>
1704      <variablelist>
1705        <varlistentry>
1706          <term><command>[Parameter]</command></term>
1707          <listitem>
1708            <para>
1709              <command>value:</command>The name of the warning. More than one name can be specified.
1710            </para>
1711          </listitem>
1712          <listitem>
1713            <para>
1714              <command>justification:</command>Reason why the warning should be ignored. デフォルト値 :&quot;&quot;。</para>
1715          </listitem>
1716        </varlistentry>
1717      </variablelist>
1718    </listitem>
1719    <listitem>
1720      <para>
1721The set of warnings that are to be suppressed by the compiler in the annotated element.
1722Duplicate names are permitted.  The second and successive occurrences of a name are ignored.
1723The presence of unrecognized warning names is <emphasis>not</emphasis> an error: Compilers
1724must ignore any warning names they do not recognize. They are, however, free to emit a
1725warning if an annotation contains an unrecognized warning name. Compiler vendors should
1726document the warning names they support in conjunction with this annotation type. They
1727are encouraged to cooperate to ensure that the same names work across multiple compilers.
1728      </para>
1729    </listitem>
1730  </varlistentry>
1731
1732  <varlistentry>
1733    <term><command>edu.umd.cs.findbugs.annotations.UnknownNullness</command></term>
1734    <listitem>
1735      <command>[Target]</command> Field, Method, Parameter
1736    </listitem>
1737    <listitem>
1738      <para>
1739Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
1740      </para>
1741    </listitem>
1742  </varlistentry>
1743
1744  <varlistentry>
1745    <term><command>edu.umd.cs.findbugs.annotations.UnknownNullness</command></term>
1746    <listitem>
1747      <command>[Target]</command> Field, Method, Parameter
1748    </listitem>
1749    <listitem>
1750      <para>
1751Used to indicate that the nullness of the target is unknown, or my vary in unknown ways in subclasses.
1752      </para>
1753    </listitem>
1754  </varlistentry>
1755</variablelist>
1756
1757<para>また、 &FindBugs; 次に示すアノテーションもサポートしています。 :<itemizedlist>
1758  <listitem>net.jcip.annotations.GuardedBy</listitem>
1759  <listitem>net.jcip.annotations.Immutable</listitem>
1760  <listitem>net.jcip.annotations.NotThreadSafe</listitem>
1761  <listitem>net.jcip.annotations.ThreadSafe</listitem>
1762</itemizedlist>
1763</para>
1764<para><ulink url="http://jcip.net/">Java Concurrency in Practice</ulink> の <ulink url="http://jcip.net/annotations/doc/index.html"> API ドキュメント</ulink> を参照してください。</para>
1765</chapter>
1766
1767<!--
1768   **************************************************************************
1769   Using rejarForAnalysis
1770   **************************************************************************
1771-->
1772
1773<chapter id="rejarForAnalysis">
1774<title>rejarForAnalysis の使用方法</title>
1775
1776<para>プロジェクトに多くの jar ファイル があったり、 jar ファイルが多くのディレクトリに点在したりする場合は、 <command>rejarForAnalysis </command> スクリプトを使用すると FindBugs の実行が比較的簡単になります。このスクリプトは、数多い jar ファイルを集めて 1 つの大きな jar ファイルに結合します。そうすると、分析時にFindBugs に jar ファイルを設定することが比較的簡単になります。このスクリプトは、 unix システムの 'find' コマンドと組み合わせるととりわけ有用になります ; 次に例を示します。 <command>find . -name '*.jar' | xargs rejarForAnalysis </command>.</para>
1777
1778<para>また、 <command>rejarForAnalysis</command> スクリプトは巨大なプロジェクトを複数の jar ファイルに分割することに使用できます。プロジェクトのクラスファイルは、複数の jar ファイルに均等に配分されます。これは、プロジェクト全体に対して FindBugs を実行すると時間とメモリ消費が著しい場合に有用です。プロジェクト全体に対して FindBugs を実行する代わりに、 <command> rejarForAnalysis</command> ですべてのクラスを含む大きな jar ファイルを構築します。続いて、 <command>rejarForAnalysis</command> を再び実行して複数の jar ファイルに分割します。そして、各々の jar ファイルに対して順に FindBugs を実行します。その際、 <command>-auxclasspath</command> に最初に 1 つにまとめた jar ファイルを指定してください。</para>
1779
1780<para><command>rejarForAnalysis</command> スクリプトに指定することができるオプションを以下に示します :</para>
1781
1782<variablelist>
1783  <varlistentry>
1784    <term><command>-maxAge</command> <replaceable>日数</replaceable></term>
1785    <listitem>
1786       <para>最後に更新された日からの経過時間を日単位で指定します (指定した日数より古い jar ファイルは無視されます)。</para>
1787    </listitem>
1788  </varlistentry>
1789  <varlistentry>
1790    <term><command>-inputFileList</command> <replaceable>ファイル名</replaceable></term>
1791    <listitem>
1792       <para>jar ファイル名を記載したテキストファイルを指定します。</para>
1793    </listitem>
1794  </varlistentry>
1795  <varlistentry>
1796    <term><command>-maxClasses</command> <replaceable>クラス数</replaceable></term>
1797    <listitem>
1798       <para>analysis*.jar ファイル 1 ファイルに対するクラスの最大数を指定します。</para>
1799    </listitem>
1800  </varlistentry>
1801  <varlistentry>
1802    <term><command>-prefix</command> <replaceable>プレフィックス</replaceable></term>
1803    <listitem>
1804       <para>分析するクラス名のプレフィックスを指定します  (例、 edu.umd.cs.) 。</para>
1805    </listitem>
1806  </varlistentry>
1807</variablelist>
1808</chapter>
1809
1810<!--
1811   **************************************************************************
1812   Data mining
1813   **************************************************************************
1814-->
1815
1816<chapter id="datamining">
1817    <title>&FindBugs;&trade; によるデータ・マイニング</title>
1818
1819<para>バグデータベースへの高機能の問い合わせ機能、および、調査対象のコードの複数のバージョンにわたる警告の追跡記録機能を、 FindBugs は内蔵しています。これらを使って次のようなことができます。すなわち、いつバグが最初持ち込まれたかを捜し出すこと、最終リリース以後持ち込まれた警告の分析を行うこと、または、無限再起ループの数を時間軸でグラフにすることです。</para>
1820
1821<para>これらの技術は、 FindBugs が警告の保存に使う XML 書式を使用します。これらの XML ファイルは、通常、特定の 1 分析に対する警告が入れられています。しかしそれらには、一連のソフトウェアのビルドやバージョンに対する分析結果を格納することもできます。</para>
1822
1823<para>すべての FindBugs XML バグデータベースには、バージョン名とタイム・スタンプ が入れられています。FindBugs は分析が行われるファイルの更新時刻からタイム・スタンプを計算します (例えば、タイム・スタンプはクラスファイルの生成時刻になるようになっています。分析が行われた時刻ではありません) 。各々のバグデータベースには、バージョン名も入れられています。バージョン名とタイム・スタンプは、 <command>setBugDatabaseInfo</command> (<xref linkend="setBugDatabaseInfo"/>) コマンドを使用して手動で設定することもできます。</para>
1824
1825<para>複数バージョンを格納するバグデータベースにおいては、分析されるコードの各バージョンごとにシーケンス番号が割り当てられます。これらのシーケンス番号は単に 0 から始まる連続する整数値です (例えば、 4 つのコードバージョンを格納するバグデータベースには、バージョン 0~3 が入れられます) 。バグデータベースにはまた、各バージョンの名前とタイム・スタンプがそれぞれ記録されます。<command>filterBugs</command> コマンドを使用すると、シーケンス番号、バージョン名またはタイム・スタンプからバージョンを参照することができます。</para>
1826
1827<para>1 バージョンを格納するバグデータベースの集合から、 1 個の複数バージョンバグデータベースを作成することができます。また、複数バージョンバグデータベースに対して、それ以後に作成された 1 バージョンのバグデータベースを結合することができます。</para>
1828
1829<para>これらのコマンドのいくつかは、 ant タスクとして実行することができます。コマンドの実行方法および属性・引数の詳細は、以下を参照してください。以下のすべての例においては、 <literal>findbugs.lib</literal> <literal>refid</literal> が正しく設定されていることを前提としています。設定方法の一例を次に示します :</para>
1830
1831<programlisting>
1832<![CDATA[
1833   <!-- findbugs タスク定義 -->
1834   <property name="findbugs.home" value="/your/path/to/findbugs" />
1835   <path id="findbugs.lib">
1836      <fileset dir="${findbugs.home}/lib">
1837         <include name="findbugs-ant.jar"/>
1838      </fileset>
1839   </path>
1840]]>
1841</programlisting>
1842
1843    <sect1 id="commands">
1844        <title>コマンド</title>
1845
1846        <para>FindBugs データ・マイニング ツールはすべてコマンドラインから実行することができます。また、いくつかのより有用なコマンドは、 ant ビルドファイルから実行することができます。</para>
1847
1848<para>コマンドラインツールについて簡単に説明します :</para>
1849
1850        <variablelist>
1851            <varlistentry>
1852                <term><command><link linkend="unionBugs">unionBugs</link></command></term>
1853                <listitem>
1854                    <para>別のクラスに対する別個の分析結果を結合します。</para>
1855                </listitem>
1856            </varlistentry>
1857            <varlistentry>
1858                <term><command><link linkend="computeBugHistory">computeBugHistory</link></command></term>
1859                <listitem>
1860                    <para>複数バージョンから得られた複数のバグ警告を、マージして 1 個の複数バージョンバグデータベースにします。これを使って、既存の複数バージョンバグデータベースに更にバージョンを追加したり、 1 バージョンを格納するバグデータベースの集合から 1 個の複数バージョンバグデータベースを作成したり、できます。</para>
1861                </listitem>
1862            </varlistentry>
1863            <varlistentry>
1864                <term><command><link linkend="setBugDatabaseInfo">setBugDatabaseInfo</link></command></term>
1865                <listitem>
1866                    <para>リビジョン名やタイム・スタンプなどの情報を XML データベースに設定します。</para>
1867                </listitem>
1868            </varlistentry>
1869            <varlistentry>
1870                <term><command><link linkend="listBugDatabaseInfo">listBugDatabaseInfo</link></command></term>
1871                <listitem>
1872                    <para>XML データベースにあるリビジョン名やタイム・スタンプなどの情報を一覧表示します。</para>
1873                </listitem>
1874            </varlistentry>
1875            <varlistentry>
1876                <term><command><link linkend="filterBugs">filterBugs</link></command></term>
1877                <listitem>
1878                    <para>バグデータベースの部分集合を選択します。</para>
1879                </listitem>
1880            </varlistentry>
1881            <varlistentry>
1882                <term><command><link linkend="mineBugHistory">mineBugHistory</link></command></term>
1883                <listitem>
1884                    <para>複数バージョンバグデータベースの各バージョン毎の警告数を一覧にした表を作成します。</para>
1885                </listitem>
1886            </varlistentry>
1887            <varlistentry>
1888                <term><command><link linkend="defectDensity">defectDensity</link></command></term>
1889                <listitem>
1890                    <para>プロジェクト全体およびクラス毎・パッケージ毎の不良密度 (1000 NCSS 毎の警告数) に関する情報を一覧表示します。</para>
1891                </listitem>
1892            </varlistentry>
1893            <varlistentry>
1894                <term><command><link linkend="convertXmlToText">convertXmlToText</link></command></term>
1895                <listitem>
1896                    <para>XML 形式のバグ警告を、 1 行 1 バグのテキスト形式、または、HTML形式に変換します。</para>
1897                </listitem>
1898            </varlistentry>
1899        </variablelist>
1900
1901
1902        <sect2 id="unionBugs">
1903            <title>unionBugs</title>
1904
1905        <para>分析するのにアプリケーションの jar ファイルを分割している場合、このコマンドを使用することで、別個に生成された XML バグ警告ファイルをすべての警告を含んでいる 1 つの ファイルにすることができます。</para>
1906
1907            <para>同じファイルの異なるバージョンを分析した結果を結合する場合は、このコマンドを<emphasis>使用しないでください</emphasis>。代わりに <command>computeBugHistory</command> を使用してください。</para>
1908
1909            <para>XML ファイルは、コマンドラインで指定してください。結果は、標準出力に送られます。</para>
1910        </sect2>
1911
1912        <sect2 id="computeBugHistory">
1913            <title>computeBugHistory</title>
1914
1915<para>このコマンドを使用することで、分析するソフトウェアの異なるビルドまたはバージョンの情報を含むバグデータベースを生成することができます入力として提供したファイルの 1 番目のファイルから履歴が取得されます。後に続くファイルは 1 バージョンのバグデータベースであるようにしてください (もし、履歴を持っていたとしても無視されます) 。</para>
1916<para>デフォルトでは、結果は標準出力に送られます。</para>
1917
1918<para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>computeBugHistory</command> を taskdef で定義します :</para>
1919
1920<programlisting>
1921<![CDATA[
1922<taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask">
1923    <classpath refid="findbugs.lib" />
1924</taskdef>
1925]]>
1926</programlisting>
1927
1928<para>この ant タスクに指定できる属性を、下表に一覧で示します。入力ファイルを指定するには、 <literal>&lt;datafile&gt;</literal> 要素を入れ子にして入れてください。次に、例を示します:</para>
1929
1930<programlisting>
1931<![CDATA[
1932<computeBugHistory home="${findbugs.home}" ...>
1933    <datafile name="analyze1.xml"/>
1934    <datafile name="analyze2.xml"/>
1935</computeBugHistory>
1936]]>
1937</programlisting>
1938
1939        <table id="computeBugHistoryTable">
1940            <title>computeBugHistory コマンドのオプション一覧</title>
1941            <tgroup cols="3" align="left">
1942                  <thead>
1943                    <row>
1944                          <entry>コマンドラインオプション</entry>
1945                          <entry>Ant 属性</entry>
1946                          <entry>目的</entry>
1947                    </row>
1948                      </thead>
1949                  <tbody>
1950<row><entry>-output &lt;file&gt;</entry>           <entry>output=&quot;&lt;file&gt;&quot;</entry>           <entry>出力結果を保存するファイル名を指定します。 (同時に入力ファイルにもなりえます)</entry></row>
1951<row><entry>-overrideRevisionNames[:truth]</entry> <entry>overrideRevisionNames=&quot;[true|false]&quot;</entry><entry>ファイル名から算出されるそれぞれのバージョン名を指定変更します。</entry></row>
1952<row><entry>-noPackageMoves[:truth]</entry>        <entry>noPackageMoves=&quot;[true|false]&quot;</entry><entry>パッケージを移動したクラスがある場合、当該クラスの警告は別の存在として扱われます。</entry></row>
1953<row><entry>-preciseMatch[:truth]</entry>          <entry>preciseMatch=&quot;[true|false]&quot;</entry><entry>バグパターンが正確に一致することを要求します。</entry></row>
1954<row><entry>-precisePriorityMatch[:truth]</entry>  <entry>precisePriorityMatch=&quot;[true|false]&quot;</entry><entry>優先度が正確に一致した場合のみ警告が同一であると判断されます。</entry></row>
1955<row><entry>-quiet[:truth]</entry>                 <entry>quiet=&quot;[true|false]&quot;</entry><entry>エラーが発生しない限り、標準出力には何も表示されません。</entry></row>
1956<row><entry>-withMessages[:truth]</entry>          <entry>withMessages=&quot;[true|false]&quot;</entry><entry>出力 XML に人間が読むことができるバグメッセージが含まれます。</entry></row>
1957                </tbody>
1958            </tgroup>
1959        </table>
1960
1961        </sect2>
1962        <sect2 id="filterBugs">
1963            <title>filterBugs</title>
1964<para>このコマンドを使用することで、 FindBugs XML 警告ファイルから一部分を選び出して新規 FindBugs 警告ファイルに選択された部分を書き込むことができます。</para>
1965<para>このコマンドには、オプション群に続いて 0 個から 2 個の findbugs xml バグファイルを指定することができます。</para>
1966<para>ファイル名をひとつも指定しない場合は、標準入力から読んで標準出力に出力されます。ファイル名を 1 個 指定した場合は、指定したファイルから読んで標準出力に出力されます。ファイル名を 2 個 指定した場合は、 1 番目に指定したファイルから読んで 2 番目に指定したファイルに出力されます。</para>
1967
1968<para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>filterBugs</command> を taskdef で定義します :</para>
1969
1970<programlisting>
1971<![CDATA[
1972<taskdef name="filterBugs" classname="edu.umd.cs.findbugs.anttask.FilterBugsTask">
1973    <classpath refid="findbugs.lib" />
1974</taskdef>
1975]]>
1976</programlisting>
1977
1978<para>この ant タスクに指定できる属性を、下表に一覧で示します。入力ファイルを指定するには、 <literal>input</literal>  属性を使用するか、 <literal>&lt;datafile&gt;</literal> 要素を入れ子にして入れてください。次に、例を示します:</para>
1979
1980<programlisting>
1981<![CDATA[
1982<filterBugs home="${findbugs.home}" ...>
1983    <datafile name="analyze.xml"/>
1984</filterBugs>
1985]]>
1986</programlisting>
1987
1988        <table id="filterOptionsTable">
1989            <title>filterBugs コマンドのオプション一覧</title>
1990            <tgroup cols="3" align="left">
1991                  <thead>
1992                    <row>
1993                          <entry>コマンドラインオプション</entry>
1994                          <entry>Ant 属性</entry>
1995                          <entry>目的</entry>
1996                    </row>
1997                      </thead>
1998                  <tbody>
1999<row><entry/>                            <entry>input=&quot;&lt;file&gt;&quot;</entry>             <entry>入力ファイルを指定します。</entry></row>
2000<row><entry/>                            <entry>output=&quot;&lt;file&gt;&quot;</entry>            <entry>出力ファイルを指定します。</entry></row>
2001<row><entry>-not</entry>                        <entry>not=&quot;[true|false]&quot;</entry>               <entry>フィルターのスイッチを反転します。</entry></row>
2002<row><entry>-withSource[:truth]</entry>         <entry>withSource=&quot;[true|false]&quot;</entry>        <entry>ソースが入手可能な警告のみ出力されます。</entry></row>
2003<row><entry>-exclude &lt;filter file&gt;</entry><entry>exclude=&quot;&lt;filter file&gt;&quot;</entry>    <entry>フィルターに一致するバグが除外されます。</entry></row>
2004<row><entry>-include &lt;filter file&gt;</entry><entry>include=&quot;&lt;filter file&gt;&quot;</entry>    <entry>フィルターに一致するバグのみを含まれます。</entry></row>
2005<row><entry>-annotation &lt;text&gt;</entry>    <entry>annotation=&quot;&lt;text&gt;&quot;</entry>        <entry>手で入力した注釈に指定した文言を含む警告のみ出力されます。</entry></row>
2006<row><entry>-after &lt;when&gt;</entry>         <entry>after=&quot;&lt;when&gt;&quot;</entry>             <entry>指定したバージョンより後に初めて出現した警告のみ出力されます。</entry></row>
2007<row><entry>-before &lt;when&gt;</entry>        <entry>before=&quot;&lt;when&gt;&quot;</entry>            <entry>指定したバージョンより前に初めて出現した警告のみ出力されます。</entry></row>
2008<row><entry>-first &lt;when&gt;</entry>         <entry>first=&quot;&lt;when&gt;&quot;</entry>             <entry>指定したバージョンに初めて出現した警告のみ出力されます。</entry></row>
2009<row><entry>-last &lt;when&gt;</entry>          <entry>last=&quot;&lt;when&gt;&quot;</entry>              <entry>指定したバージョンが出現した最後である警告のみ出力されます。</entry></row>
2010<row><entry>-fixed &lt;when&gt;</entry>         <entry>fixed=&quot;&lt;when&gt;&quot;</entry>             <entry>指定したバージョンの前回のバージョンが出現した最後である警告のみ出力されます。 (<option>-last</option> に優先します)。</entry></row>
2011<row><entry>-present &lt;when&gt;</entry>       <entry>present=&quot;&lt;when&gt;&quot;</entry>           <entry>指定したバージョンに存在する警告のみ出力されます。</entry></row>
2012<row><entry>-absent &lt;when&gt;</entry>        <entry>absent=&quot;&lt;when&gt;&quot;</entry>            <entry>指定したバージョンに存在しない警告のみ出力されます。</entry></row>
2013<row><entry>-active[:truth]</entry>             <entry>active=&quot;[true|false]&quot;</entry>            <entry>最終通番に存在する警告のみ出力されます。</entry></row>
2014<row><entry>-introducedByChange[:truth]</entry> <entry>introducedByChange=&quot;[true|false]&quot;</entry><entry>存在するクラスの変更によってもたらされた警告のみ出力されます。</entry></row>
2015<row><entry>-removedByChange[:truth]</entry>    <entry>removedByChange=&quot;[true|false]&quot;</entry>   <entry>存在するクラスの変更によって除去された警告のみ出力されます。</entry></row>
2016<row><entry>-newCode[:truth]</entry>            <entry>newCode=&quot;[true|false]&quot;</entry>           <entry>新クラスの追加によってもたらされた警告のみ出力されます。</entry></row>
2017<row><entry>-removedCode[:truth]</entry>        <entry>removedCode=&quot;[true|false]&quot;</entry>       <entry>クラスの削除によって除去された警告のみ出力されます。</entry></row>
2018<row><entry>-priority &lt;level&gt;</entry>     <entry>priority=&quot;&lt;level&gt;&quot;</entry>         <entry>指定した優先度以上の優先度をもつ警告のみ出力されます。</entry></row>
2019<row><entry>-class &lt;pattern&gt;</entry>      <entry>class=&quot;&lt;class&gt;&quot;</entry>            <entry>指定したパターンに一致する主クラスをもつ警告のみ出力されます。</entry></row>
2020<row><entry>-bugPattern &lt;pattern&gt;</entry> <entry>bugPattern=&quot;&lt;pattern&gt;&quot;</entry>     <entry>指定したパターンに一致するバグ種別をもつ警告のみ出力されます。</entry></row>
2021<row><entry>-category &lt;category&gt;</entry>  <entry>category=&quot;&lt;category&gt;&quot;</entry>      <entry>指定した文字列で始まるカテゴリーの警告のみ出力されます。</entry></row>
2022<row><entry>-designation &lt;designation&gt;</entry> <entry>designation=&quot;&lt;designation&gt;&quot;</entry> <entry>指定したバグ分類指定をもつ警告のみ出力されます。 (例、 -designation SHOULD_FIX)</entry></row>
2023<row><entry>-withMessages[:truth] </entry>      <entry>withMessages=&quot;[true|false]&quot;</entry>      <entry>テキストメッセージを含んだ XML が生成されます。</entry></row>
2024                </tbody>
2025            </tgroup>
2026        </table>
2027
2028        </sect2>
2029
2030        <sect2 id="mineBugHistory">
2031            <title>mineBugHistory</title>
2032<para>このコマンドを使用することで、複数バージョンバグデータベースの各バージョン毎の警告数を一覧にした表を作成することができます。</para>
2033
2034
2035<para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>mineBugHistory</command> を taskdef で定義します :</para>
2036
2037<programlisting>
2038<![CDATA[
2039<taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask">
2040    <classpath refid="findbugs.lib" />
2041</taskdef>
2042]]>
2043</programlisting>
2044
2045<para>この ant タスクに指定できる属性を、下表に一覧で示します。入力ファイルを指定するには、 <literal>input</literal>  属性を使用するか、 <literal>&lt;datafile&gt;</literal> 要素を入れ子にして入れてください。次に、例を示します:</para>
2046
2047<programlisting>
2048<![CDATA[
2049<mineBugHistory home="${findbugs.home}" ...>
2050    <datafile name="analyze.xml"/>
2051</mineBugHistory>
2052]]>
2053</programlisting>
2054
2055        <table id="mineBugHistoryOptionsTable">
2056            <title>mineBugHistory コマンドのオプション一覧</title>
2057            <tgroup cols="3" align="left">
2058                  <thead>
2059                    <row>
2060                          <entry>コマンドラインオプション</entry>
2061                          <entry>Ant 属性</entry>
2062                          <entry>目的</entry>
2063                    </row>
2064                  </thead>
2065                  <tbody>
2066<row><entry/>               <entry>input=&quot;&lt;file&gt;&quot;</entry>             <entry>入力ファイルを指定します。</entry></row>
2067<row><entry/>               <entry>output=&quot;&lt;file&gt;&quot;</entry>            <entry>出力ファイルを指定します。</entry></row>
2068<row><entry>-formatDates</entry>   <entry>formatDates=&quot;[true|false]&quot;</entry>       <entry>データがテキスト形式で描画されます。</entry></row>
2069<row><entry>-noTabs</entry>        <entry>noTabs=&quot;[true|false]&quot;</entry>            <entry>タブの代わりに複数スペースでカラムが区切られます (下記参照)。</entry></row>
2070<row><entry>-summary</entry>       <entry>summary=&quot;[true|false]&quot;</entry>           <entry>最新 10 件の変更の要約が出力されます。</entry></row>
2071                </tbody>
2072            </tgroup>
2073        </table>
2074
2075        <para><option>-noTabs</option> 出力を使うことで、固定幅フォントのシェルで読み易くなります。数値カラムは右寄せされるので、スペースがカラム値の前に挿入されます。また、このオプションを使用した場合、 <option>-formatDates</option> を指定したときに要約の日付を描画するのに空白が埋め込まれなくなります。</para>
2076
2077        <para>出力される表は、 (<option>-noTabs</option> が無ければ) タブ区切りで次に示すカラムから成ります :</para>
2078
2079        <table id="mineBugHistoryColumns">
2080            <title>mineBugHistory 出力のカラム一覧</title>
2081            <tgroup cols="2" align="left">
2082                  <thead>
2083                    <row>
2084                          <entry>表題</entry>
2085                          <entry>目的</entry>
2086                    </row>
2087                      </thead>
2088                  <tbody>
2089                      <row><entry>seq</entry><entry>シーケンス番号 (0 始まりの連続した整数値)</entry></row>
2090                      <row><entry>version</entry><entry>バージョン名</entry></row>
2091                      <row><entry>time</entry><entry>リリースされた日時</entry></row>
2092                      <row><entry>classes</entry><entry>分析されたクラス数</entry></row>
2093                      <row><entry>NCSS</entry><entry>コメント文を除いた命令数 (Non Commenting Source Statements)</entry></row>
2094                      <row><entry>added</entry><entry>前回のバージョンに存在したクラスにおける新規警告数</entry></row>
2095                      <row><entry>newCode</entry><entry>前回のバージョンに存在しなかったクラスにおける新規警告数</entry></row>
2096                      <row><entry>fixed</entry><entry>現在のバージョンに存在するクラスにおける除去された警告数</entry></row>
2097                      <row><entry>removed</entry><entry>現在のバージョンに存在しないクラスの前回のバージョンにおける警告数</entry></row>
2098                      <row><entry>retained</entry><entry>現在のバージョンと前回のバージョンの両方に存在する警告の数</entry></row>
2099                      <row><entry>dead</entry><entry>以前のバージョンに存在したが現在のバージョンにも直前のバージョンにも存在しない警告の数</entry></row>
2100                      <row><entry>active</entry><entry>現在のバージョンに存在する警告総数</entry></row>
2101                </tbody>
2102                </tgroup>
2103        </table>
2104        </sect2>
2105
2106        <sect2 id="defectDensity">
2107            <title>defectDensity</title>
2108<para>このコマンドを使用することで、プロジェクト全体およびクラス毎・パッケージ毎の不良密度 (1000 NCSS 毎の警告数) に関する情報を一覧表示できます。標準入力から読み込む場合はファイル指定なしで、そうでなければ、コマンドラインでファイルを指定して、このコマンドを実行します。</para>
2109<para>出力される表は、次に示すカラムから成ります。また、プロジェクト全体情報の行、および、4 個以上の警告を含んでいる各パッケージ情報または各クラス情報の行も出力されます。</para>
2110        <table id="defectDensityColumns">
2111            <title>defectDensity 出力のカラム一覧</title>
2112            <tgroup cols="2" align="left">
2113                  <thead>
2114                    <row>
2115                          <entry>表題</entry>
2116                          <entry>目的</entry>
2117                    </row>
2118                      </thead>
2119                  <tbody>
2120                      <row><entry>kind</entry><entry>プロジェクト (project)、パッケージ (package) またはクラス (class)</entry></row>
2121                      <row><entry>name</entry><entry>プロジェクト、パッケージまたはクラスの名前</entry></row>
2122                      <row><entry>density</entry><entry> 1000 NCSS 毎の警告数</entry></row>
2123                      <row><entry>bugs</entry><entry>警告数</entry></row>
2124                      <row><entry>NCSS</entry><entry>コメント文を除いた命令数 (Non Commenting Source Statements) </entry></row>
2125                </tbody>
2126                </tgroup>
2127            </table>
2128        </sect2>
2129
2130        <sect2 id="convertXmlToText">
2131            <title>convertXmlToText</title>
2132
2133            <para>このコマンドを使用することで、XML 形式のバグ警告を、 1 行 1 バグのテキスト形式、または、HTML形式に変換することができます。</para>
2134
2135<para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>convertXmlToText</command> を taskdef で定義します :</para>
2136
2137<programlisting>
2138<![CDATA[
2139<taskdef name="convertXmlToText" classname="edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask">
2140    <classpath refid="findbugs.lib" />
2141</taskdef>
2142]]>
2143</programlisting>
2144
2145<para>この ant タスクに指定できる属性を、下表に一覧で示します。</para>
2146
2147            <table id="convertXmlToTextTable">
2148            <title>convertXmlToText コマンドのオプション一覧</title>
2149            <tgroup cols="3" align="left">
2150                  <thead>
2151                    <row>
2152                          <entry>コマンドラインオプション</entry>
2153                          <entry>Ant 属性</entry>
2154                          <entry>目的</entry>
2155                    </row>
2156                      </thead>
2157                  <tbody>
2158<row><entry/>                   <entry>input=&quot;&lt;filename&gt;&quot;</entry>         <entry>入力ファイルを指定します。</entry></row>
2159<row><entry/>                   <entry>output=&quot;&lt;filename&gt;&quot;</entry>        <entry>出力ファイルを指定します。</entry></row>
2160<row><entry>-longBugCodes</entry>      <entry>longBugCodes=&quot;[true|false]&quot;</entry>      <entry>2 文字のバグ略称の代わりに、省略なしのバグパターンコードを使用します。</entry></row>
2161<row><entry/>                   <entry>format=&quot;text&quot;</entry>                    <entry>プレーンテキストの出力が作成されます。1 行につき 1 つのバグが出力されます。コマンドライン時のデフォルトです。</entry></row>
2162<row><entry>-html[:stylesheet]</entry> <entry>format=&quot;html:&lt;stylesheet&gt;&quot;</entry> <entry>指定されたスタイルシートを使用して出力が作成されます (下記参照) 。省略した場合は、 default.xsl が使用されます。</entry></row>
2163                </tbody>
2164            </tgroup>
2165            </table>
2166
2167            <para>-html/format オプションには、plain.xsldefault.xslfancy.xslfancy-hist.xsl または ユーザ自身が作成した XSL スタイルシートのいずれかを指定することができます。オプション名をよそに、 html 以外の形式を出力するスタイルシートを指定することもできます。FindBugs に含まれているスタイルシート(上述)以外のスタイルシートを使用する場合は、オプション -html/format で当該スタイルシートへのパスまたは URL を指定してください。</para>
2168        </sect2>
2169
2170        <sect2 id="setBugDatabaseInfo">
2171            <title>setBugDatabaseInfo</title>
2172
2173            <para>このコマンドを使用することで、指定したバグ警告にメタ情報を設定することができます。このコマンドには次に示すオプションがあります:</para>
2174
2175<para>この機能は、 ant からも使用することができます。まず次に示すように、ビルドファイルに <command>setBugDatabaseInfo</command> を taskdef で定義します :</para>
2176
2177<programlisting>
2178<![CDATA[
2179<taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask">
2180    <classpath refid="findbugs.lib" />
2181</taskdef>
2182]]>
2183</programlisting>
2184
2185<para>この ant タスクに指定できる属性を、下表に一覧で示します。入力ファイルを指定するには、 <literal>input</literal>  属性を使用するか、 <literal>&lt;datafile&gt;</literal> 要素を入れ子にして入れてください。次に、例を示します:</para>
2186
2187<programlisting>
2188<![CDATA[
2189<setBugDatabaseInfo home="${findbugs.home}" ...>
2190    <datafile name="analyze.xml"/>
2191</setBugDatabaseInfo>
2192]]>
2193</programlisting>
2194
2195        <table id="setBugDatabaseInfoOptions">
2196            <title>setBugDatabaseInfo オプション一覧</title>
2197            <tgroup cols="3" align="left">
2198                  <thead>
2199                    <row>
2200                          <entry>コマンドラインオプション</entry>
2201                          <entry>Ant 属性</entry>
2202                          <entry>目的</entry>
2203                    </row>
2204                  </thead>
2205                  <tbody>
2206                      <row><entry/>                              <entry>input=&quot;&lt;file&gt;&quot;</entry>           <entry>入力ファイルを指定します。</entry></row>
2207                      <row><entry/>                              <entry>output=&quot;&lt;file&gt;&quot;</entry>          <entry>出力ファイルを指定します。</entry></row>
2208                      <row><entry>-name &lt;name&gt;</entry>            <entry>name=&quot;&lt;name&gt;&quot;</entry>            <entry>最新リビジョンの名前を設定します。</entry></row>
2209                      <row><entry>-timestamp &lt;when&gt;</entry>       <entry>timestamp=&quot;&lt;when&gt;&quot;</entry>       <entry>最新リビジョンのタイム・スタンプを設定します。</entry></row>
2210                      <row><entry>-source &lt;directory&gt;</entry>     <entry>source=&quot;&lt;directory&gt;&quot;</entry>     <entry>ソースを検索するディレクトリーを追加指定します。</entry></row>
2211                      <row><entry>-findSource &lt;directory&gt;</entry> <entry>findSource=&quot;&lt;directory&gt;&quot;</entry> <entry>指定したディレクトリー内を検索して関連するソースの場所を追加します。</entry></row>
2212                      <row><entry>-suppress &lt;filter file&gt;</entry> <entry>suppress=&quot;&lt;filter file&gt;&quot;</entry> <entry>指定したファイルに一致する警告を抑止します (以前に指定した抑止設定は置き換えられます)。</entry></row>
2213                      <row><entry>-withMessages</entry>                 <entry>withMessages=&quot;[true|false]&quot;</entry>    <entry>XMLにテキストメッセージを追加します。</entry></row>
2214                      <row><entry>-resetSource</entry>                  <entry>resetSource=&quot;[true|false]&quot;</entry>     <entry>ソース検索パスをすべて削除します。</entry></row>
2215                 </tbody>
2216                </tgroup>
2217            </table>
2218        </sect2>
2219
2220        <sect2 id="listBugDatabaseInfo">
2221            <title>listBugDatabaseInfo</title>
2222
2223            <para>このコマンドの実行においては、コマンドラインで 0 個以上の xml バグデータベースファイル名を指定します。ファイル名を1つも指定しなければ、標準出力から読み込みを行いテーブルのヘッダーは生成されません。</para>
2224
2225<para>このコマンドには 1 つだけオプションがあります : <option>-formatDates</option> を指定するとテキスト形式でデータが描画されます。</para>
2226
2227<para>出力される表は、各バグデータベースごとに行を持ち、次に示すカラムから成ります :</para>
2228        <table id="listBugDatabaseInfoColumns">
2229            <title>listBugDatabaseInfo カラム一覧</title>
2230            <tgroup cols="2" align="left">
2231                  <thead>
2232                    <row>
2233                          <entry>カラム</entry>
2234                          <entry>目的</entry>
2235                    </row>
2236                  </thead>
2237                  <tbody>
2238                      <row><entry>version</entry><entry>バージョン名</entry></row>
2239                      <row><entry>time</entry><entry>リリースされた日時</entry></row>
2240                      <row><entry>classes</entry><entry>分析されたクラス数</entry></row>
2241                      <row><entry>NCSS</entry><entry>コメント文を除いた命令数 (Non Commenting Source Statements)</entry></row>
2242                      <row><entry>total</entry><entry>全警告数</entry></row>
2243                      <row><entry>high</entry><entry>優先度(高)の警告の総数</entry></row>
2244                      <row><entry>medium</entry><entry>優先度(中)の警告の総数</entry></row>
2245                      <row><entry>low</entry><entry>優先度(低)の警告の総数</entry></row>
2246                      <row><entry>filename</entry><entry>データベースのファイル名</entry></row>
2247<!--
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                      <row><entry></entry><entry></entry></row>
2254-->
2255                 </tbody>
2256                </tgroup>
2257            </table>
2258
2259        </sect2>
2260
2261    </sect1>
2262
2263    <sect1 id="examples">
2264        <title>例</title>
2265<sect2 id="unixscriptsexamples">
2266   <title>提供されたシェル・スクリプトを使用しての履歴マイニング</title>
2267<para>以下はすべて、 jdk1.6.0-b12, jdk1.6.0-b13, ..., jdk1.6.0-b60 のディレクトリに対してコマンドを実行しています。</para>
2268
2269<para>以下のコマンドを実行してみます :</para>
2270<screen>
2271computeBugHistory jdk1.6.0-b* | filterBugs -bugPattern IL_ | mineBugHistory -formatDates
2272</screen>
2273<para>すると、次のような出力が行われます :</para>
2274
2275<screen>
2276seq	version	time	classes	NCSS	added	newCode	fixed	removed	retained	dead	active
22770	jdk1.6.0-b12	&quot;Thu Nov 11 09:07:20 EST 2004&quot;	13128	811569	0	4	0	0	0	0	4
22781	jdk1.6.0-b13	&quot;Thu Nov 18 06:02:06 EST 2004&quot;	13128	811570	0	0	0	0	4	0	4
22792	jdk1.6.0-b14	&quot;Thu Dec 02 06:12:26 EST 2004&quot;	13145	811786	0	0	2	0	2	0	2
22803	jdk1.6.0-b15	&quot;Thu Dec 09 06:07:04 EST 2004&quot;	13174	811693	0	0	1	0	1	2	1
22814	jdk1.6.0-b16	&quot;Thu Dec 16 06:21:28 EST 2004&quot;	13175	811715	0	0	0	0	1	3	1
22825	jdk1.6.0-b17	&quot;Thu Dec 23 06:27:22 EST 2004&quot;	13176	811974	0	0	0	0	1	3	1
22836	jdk1.6.0-b19	&quot;Thu Jan 13 06:41:16 EST 2005&quot;	13176	812011	0	0	0	0	1	3	1
22847	jdk1.6.0-b21	&quot;Thu Jan 27 05:57:52 EST 2005&quot;	13177	812173	0	0	0	0	1	3	1
22858	jdk1.6.0-b23	&quot;Thu Feb 10 05:44:36 EST 2005&quot;	13179	812188	0	0	0	0	1	3	1
22869	jdk1.6.0-b26	&quot;Thu Mar 03 06:04:02 EST 2005&quot;	13199	811770	0	0	0	0	1	3	1
228710	jdk1.6.0-b27	&quot;Thu Mar 10 04:48:38 EST 2005&quot;	13189	812440	0	0	0	0	1	3	1
228811	jdk1.6.0-b28	&quot;Thu Mar 17 02:54:22 EST 2005&quot;	13185	812056	0	0	0	0	1	3	1
228912	jdk1.6.0-b29	&quot;Thu Mar 24 03:09:20 EST 2005&quot;	13117	809468	0	0	0	0	1	3	1
229013	jdk1.6.0-b30	&quot;Thu Mar 31 02:53:32 EST 2005&quot;	13118	809501	0	0	0	0	1	3	1
229114	jdk1.6.0-b31	&quot;Thu Apr 07 03:00:14 EDT 2005&quot;	13117	809572	0	0	0	0	1	3	1
229215	jdk1.6.0-b32	&quot;Thu Apr 14 02:56:56 EDT 2005&quot;	13169	811096	0	0	0	0	1	3	1
229316	jdk1.6.0-b33	&quot;Thu Apr 21 02:46:22 EDT 2005&quot;	13187	811942	0	0	0	0	1	3	1
229417	jdk1.6.0-b34	&quot;Thu Apr 28 02:49:00 EDT 2005&quot;	13195	813488	0	1	0	0	1	3	2
229518	jdk1.6.0-b35	&quot;Thu May 05 02:49:04 EDT 2005&quot;	13457	829837	0	0	0	0	2	3	2
229619	jdk1.6.0-b36	&quot;Thu May 12 02:59:46 EDT 2005&quot;	13462	831278	0	0	0	0	2	3	2
229720	jdk1.6.0-b37	&quot;Thu May 19 02:55:08 EDT 2005&quot;	13464	831971	0	0	0	0	2	3	2
229821	jdk1.6.0-b38	&quot;Thu May 26 03:08:16 EDT 2005&quot;	13564	836565	0	0	0	0	2	3	2
229922	jdk1.6.0-b39	&quot;Fri Jun 03 03:10:48 EDT 2005&quot;	13856	849992	0	1	0	0	2	3	3
230023	jdk1.6.0-b40	&quot;Thu Jun 09 03:30:28 EDT 2005&quot;	15972	959619	0	2	0	0	3	3	5
230124	jdk1.6.0-b41	&quot;Thu Jun 16 03:19:22 EDT 2005&quot;	15972	959619	0	0	0	0	5	3	5
230225	jdk1.6.0-b42	&quot;Fri Jun 24 03:38:54 EDT 2005&quot;	15966	958581	0	0	0	0	5	3	5
230326	jdk1.6.0-b43	&quot;Thu Jul 14 03:09:34 EDT 2005&quot;	16041	960544	0	0	0	0	5	3	5
230427	jdk1.6.0-b44	&quot;Thu Jul 21 03:05:54 EDT 2005&quot;	16041	960547	0	0	0	0	5	3	5
230528	jdk1.6.0-b45	&quot;Thu Jul 28 03:26:10 EDT 2005&quot;	16037	960606	0	0	1	0	4	3	4
230629	jdk1.6.0-b46	&quot;Thu Aug 04 03:02:48 EDT 2005&quot;	15936	951355	0	0	0	0	4	4	4
230730	jdk1.6.0-b47	&quot;Thu Aug 11 03:18:56 EDT 2005&quot;	15964	952387	0	0	1	0	3	4	3
230831	jdk1.6.0-b48	&quot;Thu Aug 18 08:10:40 EDT 2005&quot;	15970	953421	0	0	0	0	3	5	3
230932	jdk1.6.0-b49	&quot;Thu Aug 25 03:24:38 EDT 2005&quot;	16048	958940	0	0	0	0	3	5	3
231033	jdk1.6.0-b50	&quot;Thu Sep 01 01:52:40 EDT 2005&quot;	16287	974937	1	0	0	0	3	5	4
231134	jdk1.6.0-b51	&quot;Thu Sep 08 01:55:36 EDT 2005&quot;	16362	979377	0	0	0	0	4	5	4
231235	jdk1.6.0-b52	&quot;Thu Sep 15 02:04:08 EDT 2005&quot;	16477	979399	0	0	0	0	4	5	4
231336	jdk1.6.0-b53	&quot;Thu Sep 22 02:00:28 EDT 2005&quot;	16019	957900	0	0	1	0	3	5	3
231437	jdk1.6.0-b54	&quot;Thu Sep 29 01:54:34 EDT 2005&quot;	16019	957900	0	0	0	0	3	6	3
231538	jdk1.6.0-b55	&quot;Thu Oct 06 01:54:14 EDT 2005&quot;	16051	959014	0	0	0	0	3	6	3
231639	jdk1.6.0-b56	&quot;Thu Oct 13 01:54:12 EDT 2005&quot;	16211	970835	0	0	0	0	3	6	3
231740	jdk1.6.0-b57	&quot;Thu Oct 20 01:55:26 EDT 2005&quot;	16279	971627	0	0	0	0	3	6	3
231841	jdk1.6.0-b58	&quot;Thu Oct 27 01:56:30 EDT 2005&quot;	16283	971945	0	0	0	0	3	6	3
231942	jdk1.6.0-b59	&quot;Thu Nov 03 01:56:58 EST 2005&quot;	16232	972193	0	0	0	0	3	6	3
232043	jdk1.6.0-b60	&quot;Thu Nov 10 01:54:18 EST 2005&quot;	16235	972346	0	0	0	0	3	6	3
2321</screen>
2322
2323<para>次に示すコマンドを実行すると、db.xml 中間ファイルを生成することなく直接同じ情報を作成できます。</para>
2324
2325<screen>
2326computeBugHistory  jdk1.6.0-b*/jre/lib/rt.xml | filterBugs -bugPattern IL_ db.xml | mineBugHistory -formatDates
2327</screen>
2328
2329<para>この情報を使って、 Sun JDK1.6.0 の各ビルドにおいて FindBugs によって発見された無限再起ループの数を表すグラフを表示します。青色の領域は、当該ビルドにおける無限再起ループの数を表しています。その上に描かれている赤色の領域は、以前のバージョンには存在したが当該バージョンでは除去された無限再起ループの数を表しています。 (したがって、赤色の領域と青色の領域を足し合わせた高さは決して減少しないことが保証されています。そして、新たに無限再起ループのバグが持ち込まれた時点で増加します) 。赤色の領域の高さは、当該バージョンにおいて修正または削除されたバグ数の合計で算出されます。バージョン 13 および 14 において見られる減少は、 FindBugs を使用して見つかった JDK のバグの報告を Sun が受け取ったことによるものです。</para>
2330<mediaobject>
2331<imageobject>
2332<imagedata fileref="infiniteRecursiveLoops.png"/>
2333</imageobject>
2334</mediaobject>
2335
2336<para>db.xml ファイルは、 jdk1.6.0 のすべてのビルドに対する検索結果を保持しています。したがって、次に示すコマンドを実行することで、優先度(高)または優先度(低)の正確性に関する警告の履歴が表示されます :</para>
2337
2338<screen>
2339filterBugs -priority M -category C db.xml | mineBugHistory -formatDates
2340</screen>
2341
2342<para>作成される表の例 :</para>
2343
2344<screen>
2345seq	version	time	classes	NCSS	added	newCode	fixed	removed	retained	dead	active
23460	jdk1.6.0-b12	&quot;Thu Nov 11 09:07:20 EST 2004&quot;	13128	811569	0	1075	0	0	0	0	1075
23471	jdk1.6.0-b13	&quot;Thu Nov 18 06:02:06 EST 2004&quot;	13128	811570	0	0	0	0	1075	0	1075
23482	jdk1.6.0-b14	&quot;Thu Dec 02 06:12:26 EST 2004&quot;	13145	811786	3	0	6	0	1069	0	1072
23493	jdk1.6.0-b15	&quot;Thu Dec 09 06:07:04 EST 2004&quot;	13174	811693	2	1	3	0	1069	6	1072
23504	jdk1.6.0-b16	&quot;Thu Dec 16 06:21:28 EST 2004&quot;	13175	811715	0	0	1	0	1071	9	1071
23515	jdk1.6.0-b17	&quot;Thu Dec 23 06:27:22 EST 2004&quot;	13176	811974	0	0	1	0	1070	10	1070
23526	jdk1.6.0-b19	&quot;Thu Jan 13 06:41:16 EST 2005&quot;	13176	812011	0	0	0	0	1070	11	1070
23537	jdk1.6.0-b21	&quot;Thu Jan 27 05:57:52 EST 2005&quot;	13177	812173	0	0	1	0	1069	11	1069
23548	jdk1.6.0-b23	&quot;Thu Feb 10 05:44:36 EST 2005&quot;	13179	812188	0	0	0	0	1069	12	1069
23559	jdk1.6.0-b26	&quot;Thu Mar 03 06:04:02 EST 2005&quot;	13199	811770	0	0	2	1	1066	12	1066
235610	jdk1.6.0-b27	&quot;Thu Mar 10 04:48:38 EST 2005&quot;	13189	812440	1	0	1	1	1064	15	1065
235711	jdk1.6.0-b28	&quot;Thu Mar 17 02:54:22 EST 2005&quot;	13185	812056	0	0	0	0	1065	17	1065
235812	jdk1.6.0-b29	&quot;Thu Mar 24 03:09:20 EST 2005&quot;	13117	809468	3	0	8	26	1031	17	1034
235913	jdk1.6.0-b30	&quot;Thu Mar 31 02:53:32 EST 2005&quot;	13118	809501	0	0	0	0	1034	51	1034
236014	jdk1.6.0-b31	&quot;Thu Apr 07 03:00:14 EDT 2005&quot;	13117	809572	0	0	0	0	1034	51	1034
236115	jdk1.6.0-b32	&quot;Thu Apr 14 02:56:56 EDT 2005&quot;	13169	811096	1	1	0	1	1033	51	1035
236216	jdk1.6.0-b33	&quot;Thu Apr 21 02:46:22 EDT 2005&quot;	13187	811942	3	0	2	1	1032	52	1035
236317	jdk1.6.0-b34	&quot;Thu Apr 28 02:49:00 EDT 2005&quot;	13195	813488	0	1	0	0	1035	55	1036
236418	jdk1.6.0-b35	&quot;Thu May 05 02:49:04 EDT 2005&quot;	13457	829837	0	36	2	0	1034	55	1070
236519	jdk1.6.0-b36	&quot;Thu May 12 02:59:46 EDT 2005&quot;	13462	831278	0	0	0	0	1070	57	1070
236620	jdk1.6.0-b37	&quot;Thu May 19 02:55:08 EDT 2005&quot;	13464	831971	0	1	1	0	1069	57	1070
236721	jdk1.6.0-b38	&quot;Thu May 26 03:08:16 EDT 2005&quot;	13564	836565	1	7	2	6	1062	58	1070
236822	jdk1.6.0-b39	&quot;Fri Jun 03 03:10:48 EDT 2005&quot;	13856	849992	6	39	5	0	1065	66	1110
236923	jdk1.6.0-b40	&quot;Thu Jun 09 03:30:28 EDT 2005&quot;	15972	959619	7	147	11	0	1099	71	1253
237024	jdk1.6.0-b41	&quot;Thu Jun 16 03:19:22 EDT 2005&quot;	15972	959619	0	0	0	0	1253	82	1253
237125	jdk1.6.0-b42	&quot;Fri Jun 24 03:38:54 EDT 2005&quot;	15966	958581	3	0	1	2	1250	82	1253
237226	jdk1.6.0-b43	&quot;Thu Jul 14 03:09:34 EDT 2005&quot;	16041	960544	5	11	15	8	1230	85	1246
237327	jdk1.6.0-b44	&quot;Thu Jul 21 03:05:54 EDT 2005&quot;	16041	960547	0	0	0	0	1246	108	1246
237428	jdk1.6.0-b45	&quot;Thu Jul 28 03:26:10 EDT 2005&quot;	16037	960606	19	0	2	0	1244	108	1263
237529	jdk1.6.0-b46	&quot;Thu Aug 04 03:02:48 EDT 2005&quot;	15936	951355	13	1	1	32	1230	110	1244
237630	jdk1.6.0-b47	&quot;Thu Aug 11 03:18:56 EDT 2005&quot;	15964	952387	163	8	7	20	1217	143	1388
237731	jdk1.6.0-b48	&quot;Thu Aug 18 08:10:40 EDT 2005&quot;	15970	953421	0	0	0	0	1388	170	1388
237832	jdk1.6.0-b49	&quot;Thu Aug 25 03:24:38 EDT 2005&quot;	16048	958940	1	11	1	0	1387	170	1399
237933	jdk1.6.0-b50	&quot;Thu Sep 01 01:52:40 EDT 2005&quot;	16287	974937	19	27	16	7	1376	171	1422
238034	jdk1.6.0-b51	&quot;Thu Sep 08 01:55:36 EDT 2005&quot;	16362	979377	1	15	3	0	1419	194	1435
238135	jdk1.6.0-b52	&quot;Thu Sep 15 02:04:08 EDT 2005&quot;	16477	979399	0	0	1	1	1433	197	1433
238236	jdk1.6.0-b53	&quot;Thu Sep 22 02:00:28 EDT 2005&quot;	16019	957900	13	12	16	20	1397	199	1422
238337	jdk1.6.0-b54	&quot;Thu Sep 29 01:54:34 EDT 2005&quot;	16019	957900	0	0	0	0	1422	235	1422
238438	jdk1.6.0-b55	&quot;Thu Oct 06 01:54:14 EDT 2005&quot;	16051	959014	1	4	7	0	1415	235	1420
238539	jdk1.6.0-b56	&quot;Thu Oct 13 01:54:12 EDT 2005&quot;	16211	970835	6	8	37	0	1383	242	1397
238640	jdk1.6.0-b57	&quot;Thu Oct 20 01:55:26 EDT 2005&quot;	16279	971627	0	0	0	0	1397	279	1397
238741	jdk1.6.0-b58	&quot;Thu Oct 27 01:56:30 EDT 2005&quot;	16283	971945	0	1	1	0	1396	279	1397
238842	jdk1.6.0-b59	&quot;Thu Nov 03 01:56:58 EST 2005&quot;	16232	972193	6	0	5	0	1392	280	1398
238943	jdk1.6.0-b60	&quot;Thu Nov 10 01:54:18 EST 2005&quot;	16235	972346	0	0	0	0	1398	285	1398
239044	jdk1.6.0-b61	&quot;Thu Nov 17 01:58:42 EST 2005&quot;	16202	971134	2	0	4	0	1394	285	1396
2391</screen>
2392</sect2>
2393
2394<sect2 id="incrementalhistory">
2395    <title>増分履歴メンテナンス</title>
2396
2397<para>仮に、 db.xml がビルド b12 - b60 に対する findbugs 実行結果を保持している場合、次に示すコマンドを実行することで、 db.xml に b61 に対する実行結果を追加することができます :</para>
2398<screen>
2399computeBugHistory -output db.xml db.xml jdk1.6.0-b61/jre/lib/rt.xml
2400</screen>
2401</sect2>
2402
2403            </sect1>
2404
2405         <sect1 id="antexample">
2406            <title>Ant の例</title>
2407<para>findbugs の実行とその後のデータ・マイニングツールの活用の両方を実行している ant スクリプトの完全な例を以下に示します :</para>
2408<screen>
2409<![CDATA[
2410<project name="analyze_asm_util" default="findbugs">
2411   <!-- findbugs タスク定義 -->
2412   <property name="findbugs.home" value="/Users/ben/Documents/workspace/findbugs/findbugs" />
2413   <property name="jvmargs" value="-server -Xss1m -Xmx800m -Duser.language=en -Duser.region=EN -Dfindbugs.home=${findbugs.home}" />
2414
2415    <path id="findbugs.lib">
2416      <fileset dir="${findbugs.home}/lib">
2417         <include name="findbugs-ant.jar"/>
2418      </fileset>
2419   </path>
2420
2421   <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
2422      <classpath refid="findbugs.lib" />
2423   </taskdef>
2424
2425   <taskdef name="computeBugHistory" classname="edu.umd.cs.findbugs.anttask.ComputeBugHistoryTask">
2426      <classpath refid="findbugs.lib" />
2427   </taskdef>
2428
2429   <taskdef name="setBugDatabaseInfo" classname="edu.umd.cs.findbugs.anttask.SetBugDatabaseInfoTask">
2430      <classpath refid="findbugs.lib" />
2431   </taskdef>
2432
2433   <taskdef name="mineBugHistory" classname="edu.umd.cs.findbugs.anttask.MineBugHistoryTask">
2434      <classpath refid="findbugs.lib" />
2435   </taskdef>
2436
2437   <!-- findbugs タスク定義 -->
2438   <target name="findbugs">
2439      <antcall target="analyze" />
2440      <antcall target="mine" />
2441   </target>
2442
2443   <!-- 分析を行うタスク-->
2444   <target name="analyze">
2445      <!-- asm-util に対して findbugs を実行する -->
2446      <findbugs home="${findbugs.home}"
2447                output="xml:withMessages"
2448                timeout="90000000"
2449                reportLevel="experimental"
2450                workHard="true"
2451                effort="max"
2452                adjustExperimental="true"
2453                jvmargs="${jvmargs}"
2454                failOnError="true"
2455                outputFile="out.xml"
2456                projectName="Findbugs"
2457                debug="false">
2458         <class location="asm-util-3.0.jar" />
2459      </findbugs>
2460   </target>
2461
2462   <target name="mine">
2463
2464      <!-- 最新の分析結果に情報を設定する -->
2465      <setBugDatabaseInfo home="${findbugs.home}"
2466                            withMessages="true"
2467                            name="asm-util-3.0.jar"
2468                            input="out.xml"
2469                            output="out-rel.xml"/>
2470
2471      <!-- 履歴ファイル (out-hist.xml) が既に存在するかどうかを確認する -->
2472      <condition property="mining.historyfile.available">
2473         <available file="out-hist.xml"/>
2474      </condition>
2475      <condition property="mining.historyfile.notavailable">
2476         <not>
2477            <available file="out-hist.xml"/>
2478         </not>
2479      </condition>
2480
2481      <!-- このターゲットは、履歴ファイルが存在しないとき (初回) だけ実行されます -->
2482      <antcall target="history-init">
2483        <param name="data.file" value="out-rel.xml" />
2484        <param name="hist.file" value="out-hist.xml" />
2485      </antcall>
2486      <!-- 上記以外の場合に実行されます -->
2487      <antcall target="history">
2488        <param name="data.file"         value="out-rel.xml" />
2489        <param name="hist.file"         value="out-hist.xml" />
2490        <param name="hist.summary.file" value="out-hist.txt" />
2491      </antcall>
2492   </target>
2493
2494   <!-- 履歴ファイルを初期化します -->
2495   <target name="history-init" if="mining.historyfile.notavailable">
2496      <copy file="${data.file}" tofile="${hist.file}" />
2497   </target>
2498
2499   <!-- バグ履歴を算出します -->
2500   <target name="history" if="mining.historyfile.available">
2501      <!-- ${data.file} を ${hist.file} にマージします -->
2502      <computeBugHistory home="${findbugs.home}"
2503                           withMessages="true"
2504                           output="${hist.file}">
2505            <dataFile name="${hist.file}"/>
2506            <dataFile name="${data.file}"/>
2507      </computeBugHistory>
2508
2509      <!-- 履歴を算出して ${hist.summary.file} に出力します -->
2510      <mineBugHistory home="${findbugs.home}"
2511                        formatDates="true"
2512                      noTabs="true"
2513                        input="${hist.file}"
2514                        output="${hist.summary.file}"/>
2515   </target>
2516
2517</project>
2518]]>
2519</screen>
2520         </sect1>
2521</chapter>
2522
2523
2524<!--
2525   **************************************************************************
2526   License
2527   **************************************************************************
2528-->
2529
2530<chapter id="license">
2531<title>ライセンス</title>
2532
2533<para>名称「FindBugs」および FindBugs のロゴは、メリーランド大学の登録商標です。FindBugs はフリーソフトウェアであり、 <ulink url="http://www.gnu.org/licenses/lgpl.html">Lesser GNU Public License</ulink> の条件で配布されています。使用承諾書を入手したい場合は、 &FindBugs; 配布物に含まれる <filename>LICENSE.txt</filename> ファイルを参照してください。</para>
2534
2535<para>最新バージョンの FindBugs および そのソースコードは <ulink url="http://findbugs.sourceforge.net">FindBugs web ページ</ulink> で入手できます。</para>
2536
2537</chapter>
2538
2539
2540<!--
2541   **************************************************************************
2542   Acknowledgments
2543   **************************************************************************
2544-->
2545<chapter id="acknowledgments">
2546<title>謝辞</title>
2547
2548<sect1>
2549<title>貢献者</title>
2550
2551<para>&FindBugs; was originally written by Bill Pugh (<email>pugh@cs.umd.edu</email>).
2552David Hovemeyer (<email>daveho@cs.umd.edu</email>) implemented some of the
2553detectors, added the Swing GUI, and is a co-maintainer.</para>
2554
2555<para>Mike Fagan (<email>mfagan@tde.com</email>) contributed the &Ant; build script,
2556the &Ant; task, and several enhancements and bug fixes to the GUI.</para>
2557
2558<para>Germano Leichsenring contributed Japanese translations of the bug
2559summaries.</para>
2560
2561<para>David Li contributed the Emacs bug report format.</para>
2562
2563<para>Peter D. Stout contributed recursive detection of Class-Path
2564attributes in analyzed Jar files, German translations of
2565text used in the Swing GUI, and other fixes.</para>
2566
2567<para>Peter Friese wrote the &FindBugs; Eclipse plugin.</para>
2568
2569<para>Rohan Lloyd contributed several Mac OS X enhancements,
2570bug detector improvements,
2571and maintains the Fink package for &FindBugs;.</para>
2572
2573<para>Hiroshi Okugawa translated the &FindBugs; manual and
2574more of the bug summaries into Japanese.</para>
2575
2576<para>Phil Crosby enhanced the Eclipse plugin to add a view
2577to display the bug details.</para>
2578
2579<para>Dave Brosius fixed a number of bugs, added user preferences
2580to the Swing GUI, improved several bug detectors, and
2581contributed the string concatenation detector.</para>
2582
2583<para>Thomas Klaeger contributed a number of bug fixes and
2584bug detector improvements.</para>
2585
2586<para>Andrei Loskutov made a number of improvements to the
2587Eclipse plugin.</para>
2588
2589<para>Brian Goetz contributed a major refactoring of the
2590visitor classes to improve readability and understandability.</para>
2591
2592<para> Pete Angstadt fixed several problems in the Swing GUI.</para>
2593
2594<para>Francis Lalonde provided a task resource file for the
2595FindBugs Ant task.</para>
2596
2597<para>Garvin LeClaire contributed support for output in
2598Xdocs format, for use by Maven.</para>
2599
2600<para>Holger Stenzhorn contributed improved German translations of items
2601in the Swing GUI.</para>
2602
2603<para>Juha Knuutila contributed Finnish translations of items
2604in the Swing GUI.</para>
2605
2606<para>Tanel Lebedev contributed Estonian translations of items
2607in the Swing GUI.</para>
2608
2609<para>Hanai Shisei (ruimo) contributed full Japanese translations of
2610bug messages, and text used in the Swing GUI.</para>
2611
2612<para>David Cotton contributed Fresh translations for bug
2613messages and for the Swing GUI.</para>
2614
2615<para>Michael Tamm contributed support for the &quot;errorProperty&quot; attribute
2616in the Ant task.</para>
2617
2618<para>Thomas Kuehne improved the German translation of the Swing GUI.</para>
2619
2620<para>Len Trigg improved source file support for the Emacs output mode.</para>
2621
2622<para>Greg Bentz provided a fix for the hashcode/equals detector.</para>
2623
2624<para>K. Hashimoto contributed internationalization fixes and several other
2625    bug fixes.</para>
2626
2627<para>
2628    Glenn Boysko contributed support for ignoring specified local
2629    variables in the dead local store detector.
2630</para>
2631
2632<para>
2633    Jay Dunning contributed a detector to find equality comparisons
2634    of floating-point values, and overhauled the analysis summary
2635    report and its representation in the saved XML format.
2636</para>
2637
2638<para>
2639    Olivier Parent contributed updated French translations for bug descriptions and
2640    Swing GUI.
2641</para>
2642
2643<para>
2644    Chris Nappin contributed the <filename>plain.xsl</filename>
2645    stylesheet.
2646</para>
2647
2648<para>
2649    Etienne Giraudy contributed the <filename>fancy.xsl</filename> and  <filename>fancy-hist.xsl</filename>
2650    stylesheets, and made improvements to the <command>-xml:withMessages</command>
2651    option.
2652</para>
2653
2654<para>
2655    Takashi Okamoto fixed bugs in the project preferences dialog
2656    in the Eclipse plugin, and contributed to its internationalization and localization.
2657</para>
2658
2659<para>Thomas Einwaller fixed bugs in the project preferences dialog in the Eclipse plugin.</para>
2660
2661<para>Jeff Knox contributed support for the warningsProperty attribute
2662in the Ant task.</para>
2663
2664<para>Peter Hendriks extended the Eclipse plugin preferences,
2665and fixed a bug related to renaming the Eclipse plugin ID.</para>
2666
2667<para>Mark McKay contributed an Ant task to launch the findbugs frame.</para>
2668
2669<para>Dieter von Holten (dvholten) contributed
2670some German improvements to findbugs_de.properties.</para>
2671
2672
2673<para>If you have contributed to &FindBugs;, but aren't mentioned above,
2674please send email to <email>findbugs@cs.umd.edu</email> (and also accept
2675our humble apologies).</para>
2676
2677</sect1>
2678
2679<sect1>
2680<title>使用しているソフトウェア</title>
2681
2682<para>&FindBugs; は、いくつかのオープンソースソフトウェアパッケージを使用しています。これらがなければ、 &FindBugs; の開発は、より一層困難なものになったことでしょう。</para>
2683
2684<sect2>
2685<title>BCEL</title>
2686<para>&FindBugs; includes software developed by the Apache Software Foundation
2687(<ulink url="http://www.apache.org/">http://www.apache.org/</ulink>).
2688Specifically, it uses the <ulink url="http://jakarta.apache.org/bcel/">Byte Code
2689Engineering Library</ulink>.</para>
2690</sect2>
2691
2692<sect2>
2693<title>ASM</title>
2694<para>&FindBugs; uses the <ulink url="http://asm.objectweb.org/">ASM</ulink>
2695bytecode framework, which is distributed under the following license:</para>
2696
2697<blockquote>
2698<para>
2699Copyright (c) 2000-2005 INRIA, France Telecom
2700All rights reserved.
2701</para>
2702
2703<para>
2704Redistribution and use in source and binary forms, with or without
2705modification, are permitted provided that the following conditions
2706are met:
2707</para>
2708
2709<orderedlist numeration="arabic">
2710   <listitem><para>
2711   Redistributions of source code must retain the above copyright
2712   notice, this list of conditions and the following disclaimer.
2713  </para></listitem>
2714   <listitem><para>
2715   Redistributions in binary form must reproduce the above copyright
2716   notice, this list of conditions and the following disclaimer in the
2717   documentation and/or other materials provided with the distribution.
2718  </para></listitem>
2719   <listitem><para>
2720   Neither the name of the copyright holders nor the names of its
2721   contributors may be used to endorse or promote products derived from
2722   this software without specific prior written permission.
2723  </para></listitem>
2724</orderedlist>
2725
2726<para>
2727THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
2728AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2729IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2730ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2731LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2732CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2733SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2734INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2735CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2736ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2737THE POSSIBILITY OF SUCH DAMAGE.
2738</para>
2739</blockquote>
2740</sect2>
2741
2742<sect2>
2743<title>DOM4J</title>
2744<para>&FindBugs; uses <ulink url="http://dom4j.org">DOM4J</ulink>, which is
2745distributed under the following license:</para>
2746
2747<blockquote>
2748<para>
2749Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
2750</para>
2751
2752<para>
2753Redistribution and use of this software and associated documentation
2754(&quot;Software&quot;), with or without modification, are permitted provided that
2755the following conditions are met:
2756</para>
2757
2758<orderedlist numeration="arabic">
2759   <listitem><para>
2760   Redistributions of source code must retain copyright statements and
2761   notices. Redistributions must also contain a copy of this document.
2762  </para></listitem>
2763   <listitem><para>
2764   Redistributions in binary form must reproduce the above copyright
2765   notice, this list of conditions and the following disclaimer in the
2766   documentation and/or other materials provided with the distribution.
2767  </para></listitem>
2768   <listitem><para>
2769   The name &quot;DOM4J&quot; must not be used to endorse or promote products
2770   derived from this Software without prior written permission
2771   of MetaStuff, Ltd. For written permission, please contact
2772   <email>dom4j-info@metastuff.com</email>.
2773  </para></listitem>
2774   <listitem><para>
2775   Products derived from this Software may not be called &quot;DOM4J&quot; nor may
2776   &quot;DOM4J&quot; appear in their names without prior written permission of
2777   MetaStuff, Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
2778  </para></listitem>
2779   <listitem><para>
2780   Due credit should be given to the DOM4J Project (<ulink url="http://dom4j.org/">http://dom4j.org/</ulink>).
2781  </para></listitem>
2782</orderedlist>
2783
2784<para>
2785THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS''
2786AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
2787THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2788PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS
2789CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2790EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2791PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
2792PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
2793LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2794NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2795SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2796</para>
2797</blockquote>
2798
2799</sect2>
2800
2801</sect1>
2802
2803</chapter>
2804
2805
2806</book>
2807