?? filter.html
字號:
<Bug code="DE,UrF,SIC" /> </Match></pre><p></p><p> 3. Match certain tests from all classes by specifying their abbreviations.</p><pre class="programlisting"> <Match> <Bug code="DE,UrF,SIC" /> </Match></pre><p></p><p> 4. Match certain tests from all classes by specifying their category.</p><pre class="programlisting"> <Match> <Bug category="PERFORMANCE" /> </Match></pre><p></p><p> 5. Match bug types from specified methods of a class by their abbreviations.</p><pre class="programlisting"> <Match> <Class name="com.foobar.MyClass" /> <Or> <Method name="frob" params="int,java.lang.String" returns="void" /> <Method name="blat" params="" returns="boolean" /> </Or> <Bug code="DC" /> </Match></pre><p></p><p> 6. Match a particular bug pattern in a particular method. </p><pre class="programlisting"> <!-- A method with an open stream false positive. --> <Match> <Class name="com.foobar.MyClass" /> <Method name="writeDataToFile" /> <Bug pattern="OS_OPEN_STREAM" /> </Match></pre><p></p><p> 7. Match a particular bug pattern with a given priority in a particular method. </p><pre class="programlisting"> <!-- A method with a dead local store false positive (medium priority). --> <Match> <Class name="com.foobar.MyClass" /> <Method name="someMethod" /> <Bug pattern="DLS_DEAD_LOCAL_STORE" /> <Priority value="2" /> </Match></pre><p></p><p> 8. Match minor bugs introduced by AspectJ compiler (you are probably not interested in these unless you are an AspectJ developer). </p><pre class="programlisting"> <Match> <Class name="~.*\$AjcClosure\d+" /> <Bug pattern="DLS_DEAD_LOCAL_STORE" /> <Method name="run" /> </Match> <Match> <Bug pattern="UUF_UNUSED_FIELD" /> <Field name="~ajc\$.*" /> </Match></pre><p></p><p> 9. Match bugs in specific parts of the code base </p><pre class="programlisting"> <!-- match unused fields warnings in Messages classes in all packages --> <Match> <Class name="~.*\.Messages" /> <Bug code="UUF" /> </Match> <!-- match mutable statics warnings in all internal packages --> <Match> <Package name="~.*\.internal" /> <Bug code="MS" /> </Match> <!-- match anonymoous inner classes warnings in ui package hierarchy --> <Match> <Package name="~com\.foobar\.fooproject\.ui.*" /> <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" /> </Match></pre><p></p><p> 10. Match bugs on fieds or methods with specific signatures</p><pre class="programlisting"> <!-- match System.exit(...) usage warnings in void main(String[]) methods in all classes --> <Match> <Method returns="void" name="main" params="java.lang.String[]" /> <Method pattern="DM_EXIT" /> </Match> <!-- match UuF warnings on fields of type com.foobar.DebugInfo on all classes --> <Match> <Field type="com.foobar.DebugInfo" /> <Bug code="UuF" /> </Match></pre><p> </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2095"></a>6. Complete Example</h2></div></div></div><pre class="programlisting"><FindBugsFilter> <Match> <Class name="com.foobar.ClassNotToBeAnalyzed" /> </Match> <Match> <Class name="com.foobar.ClassWithSomeBugsMatched" /> <Bug code="DE,UrF,SIC" /> </Match> <!-- Match all XYZ violations. --> <Match> <Bug code="XYZ" /> </Match> <!-- Match all doublecheck violations in these methods of "AnotherClass". --> <Match> <Class name="com.foobar.AnotherClass" /> <Or> <Method name="nonOverloadedMethod" /> <Method name="frob" params="int,java.lang.String" returns="void" /> <Method name="blat" params="" returns="boolean" /> </Or> <Bug code="DC" /> </Match> <!-- A method with a dead local store false positive (medium priority). --> <Match> <Class name="com.foobar.MyClass" /> <Method name="someMethod" /> <Bug pattern="DLS_DEAD_LOCAL_STORE" /> <Priority value="2" /> </Match></FindBugsFilter></pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="eclipse.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="analysisprops.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. Using the <span class="application">FindBugs</span>™ Eclipse plugin </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. Analysis Properties</td></tr></table></div></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -