⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filter.html

📁 JSP页面代码排错
💻 HTML
📖 第 1 页 / 共 2 页
字号:
       &lt;Bug code="DE,UrF,SIC" /&gt;     &lt;/Match&gt;</pre><p></p><p>  3. Match certain tests from all classes by specifying their abbreviations.</p><pre class="programlisting">     &lt;Match&gt;       &lt;Bug code="DE,UrF,SIC" /&gt;     &lt;/Match&gt;</pre><p></p><p>  4. Match certain tests from all classes by specifying their category.</p><pre class="programlisting">     &lt;Match&gt;       &lt;Bug category="PERFORMANCE" /&gt;     &lt;/Match&gt;</pre><p></p><p>  5. Match bug types from specified methods of a class by their abbreviations.</p><pre class="programlisting">     &lt;Match&gt;       &lt;Class name="com.foobar.MyClass" /&gt;       &lt;Or&gt;         &lt;Method name="frob" params="int,java.lang.String" returns="void" /&gt;         &lt;Method name="blat" params="" returns="boolean" /&gt;       &lt;/Or&gt;       &lt;Bug code="DC" /&gt;     &lt;/Match&gt;</pre><p></p><p>	6. Match a particular bug pattern in a particular method.	</p><pre class="programlisting">    &lt;!-- A method with an open stream false positive. --&gt;    &lt;Match&gt;      &lt;Class name="com.foobar.MyClass" /&gt;      &lt;Method name="writeDataToFile" /&gt;      &lt;Bug pattern="OS_OPEN_STREAM" /&gt;    &lt;/Match&gt;</pre><p></p><p>	7. Match a particular bug pattern with a given priority in a particular method.	</p><pre class="programlisting">    &lt;!-- A method with a dead local store false positive (medium priority). --&gt;    &lt;Match&gt;      &lt;Class name="com.foobar.MyClass" /&gt;      &lt;Method name="someMethod" /&gt;      &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;      &lt;Priority value="2" /&gt;    &lt;/Match&gt;</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">    &lt;Match&gt;       &lt;Class name="~.*\$AjcClosure\d+" /&gt;      &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;      &lt;Method name="run" /&gt;    &lt;/Match&gt;    &lt;Match&gt;      &lt;Bug pattern="UUF_UNUSED_FIELD" /&gt;      &lt;Field name="~ajc\$.*" /&gt;    &lt;/Match&gt;</pre><p></p><p>	9. Match bugs in specific parts of the code base	</p><pre class="programlisting">    &lt;!-- match unused fields warnings in Messages classes in all packages --&gt;    &lt;Match&gt;       &lt;Class name="~.*\.Messages" /&gt;      &lt;Bug code="UUF" /&gt;    &lt;/Match&gt;    &lt;!-- match mutable statics warnings in all internal packages --&gt;    &lt;Match&gt;      &lt;Package name="~.*\.internal" /&gt;      &lt;Bug code="MS" /&gt;    &lt;/Match&gt;    &lt;!-- match anonymoous inner classes warnings in ui package hierarchy --&gt;    &lt;Match&gt;      &lt;Package name="~com\.foobar\.fooproject\.ui.*" /&gt;      &lt;Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" /&gt;    &lt;/Match&gt;</pre><p></p><p>	10. Match bugs on fieds or methods with specific signatures</p><pre class="programlisting">	&lt;!-- match System.exit(...) usage warnings in void main(String[]) methods in all classes --&gt;	&lt;Match&gt;	  &lt;Method returns="void" name="main" params="java.lang.String[]" /&gt;	  &lt;Method pattern="DM_EXIT" /&gt;	&lt;/Match&gt;	&lt;!-- match UuF warnings on fields of type com.foobar.DebugInfo on all classes --&gt;	&lt;Match&gt;	  &lt;Field type="com.foobar.DebugInfo" /&gt;	  &lt;Bug code="UuF" /&gt;	&lt;/Match&gt;</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.&nbsp;Complete Example</h2></div></div></div><pre class="programlisting">&lt;FindBugsFilter&gt;     &lt;Match&gt;       &lt;Class name="com.foobar.ClassNotToBeAnalyzed" /&gt;     &lt;/Match&gt;     &lt;Match&gt;       &lt;Class name="com.foobar.ClassWithSomeBugsMatched" /&gt;       &lt;Bug code="DE,UrF,SIC" /&gt;     &lt;/Match&gt;     &lt;!-- Match all XYZ violations. --&gt;     &lt;Match&gt;       &lt;Bug code="XYZ" /&gt;     &lt;/Match&gt;     &lt;!-- Match all doublecheck violations in these methods of "AnotherClass". --&gt;     &lt;Match&gt;       &lt;Class name="com.foobar.AnotherClass" /&gt;       &lt;Or&gt;         &lt;Method name="nonOverloadedMethod" /&gt;         &lt;Method name="frob" params="int,java.lang.String" returns="void" /&gt;         &lt;Method name="blat" params="" returns="boolean" /&gt;       &lt;/Or&gt;       &lt;Bug code="DC" /&gt;     &lt;/Match&gt;     &lt;!-- A method with a dead local store false positive (medium priority). --&gt;     &lt;Match&gt;       &lt;Class name="com.foobar.MyClass" /&gt;       &lt;Method name="someMethod" /&gt;       &lt;Bug pattern="DLS_DEAD_LOCAL_STORE" /&gt;       &lt;Priority value="2" /&gt;     &lt;/Match&gt;&lt;/FindBugsFilter&gt;</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>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="analysisprops.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;7.&nbsp;Using the <span class="application">FindBugs</span>&#8482; Eclipse plugin&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;9.&nbsp;Analysis Properties</td></tr></table></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -