?? gui.html
字號:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Chapter 5. Using the FindBugs GUI</title><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="FindBugs™ Manual"><link rel="up" href="index.html" title="FindBugs™ Manual"><link rel="prev" href="running.html" title="Chapter 4. Running FindBugs™"><link rel="next" href="anttask.html" title="Chapter 6. Using the FindBugs™ Ant task"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Using the <span class="application">FindBugs</span> GUI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="running.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="anttask.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="gui"></a>Chapter 5. Using the <span class="application">FindBugs</span> GUI</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="gui.html#d0e1087">1. Creating a Project</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1129">2. Running the Analysis</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1134">3. Browsing Results</a></span></dt><dt><span class="sect1"><a href="gui.html#d0e1149">4. Saving and Opening</a></span></dt></dl></div><p> This chapter describes how to use the <span class="application">FindBugs</span> graphical user interface (GUI). </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1087"></a>1. Creating a Project</h2></div></div></div><p>After you have started <span class="application">FindBugs</span> using the <span><strong class="command">findbugs</strong></span> command,choose the <span class="guimenu">File</span> → <span class="guimenuitem">New Project</span>menu item. You will see a dialog which looks like this:</p><div class="mediaobject"><img src="project-dialog.png"></div><p></p><p>Use the "Add" button next to the "Class archives and directories to analyze" text field to select a Java archivefile (zip, jar, ear, or war file) or directory containing java classes to analyze for bugs. You may add multiplearchives/directories.</p><p>You can also add the source directories which containthe source code for the Java archives you are analyzing. This will enable<span class="application">FindBugs</span> to highlight the source code which contains a possible error.The source directories you add should be the roots of the Javapackage hierarchy. For example, if your application is contained in the<code class="varname">org.foobar.myapp</code> package, you should add theparent directory of the <code class="filename">org</code> directoryto the source directory list for the project.</p><p>Another optional step is to add additional Jar files or directories as"Auxiliary classpath locations" entries. You should do this if the archives and directories you are analyzinghave references to other classes which are not included in the analyzedarchives/directories and are not in the standard runtime classpath. Some of the bugpattern detectors in <span class="application">FindBugs</span> make use of class hierarchy information,so you will get more accurate results if the entire class hierarchy isavailable which <span class="application">FindBugs</span> performs its analysis.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1129"></a>2. Running the Analysis</h2></div></div></div><p>Once you have added all of the archives, directories, and source directories,click the "Finish" button to analyze the classes contained in theJar files. Note that for a very large program on an older computer,this may take quite a while (tens of minutes). A recent computer withample memory will typically be able to analyze a large program in only afew minutes.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1134"></a>3. Browsing Results</h2></div></div></div><p>When the analysis completes, you will see a screen like the following:</p><div class="mediaobject"><img src="example-details.png"></div><p></p><p>The upper left-hand pane of the window shows the bug tree; this is a hierarchicalrepresentation of all of the potential bugs detected in the analyzedJar files.</p><p>When you select a particular bug instance in the top pane, you willsee a description of the bug in the "Details" tab of the bottom pane.In addition, the source code pane on the upper-right will show theprogram source code where the potential bug occurs, if source is available.In the above example, the bug is a stream object that is not closed. Thesource code window highlights the line where the stream object is created.</p><p>You may add a textual annotations to bug instances. To do so, type theminto the text box just below the hierarchical view. You can type anyinformation which you would like to record. When you load and save bugresults files, the annotations are preserved.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1149"></a>4. Saving and Opening</h2></div></div></div><p>You may use the <span class="guimenu">File</span> → <span class="guimenuitem">Save as...</span>menu option to save your work. To save your work, including the jarfile lists you specified and all bug results, choose"FindBugs analysis results (.xml)" from the drop-down list in the"Save as..." dialog. There are also options for saving just the jarfile lists ("FindBugs project file (.fbp)") or just the results("FindBugs analysis file (.fba)").A saved file may be loaded with the<span class="guimenu">File</span> → <span class="guimenuitem">Open...</span>menu option.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="running.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="anttask.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. Running <span class="application">FindBugs</span>™ </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 6. Using the <span class="application">FindBugs</span>™ <span class="application">Ant</span> task</td></tr></table></div></body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -