[Fb-contrib-commit] SF.net SVN: fb-contrib: [900] trunk/fb-contrib/etc
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2007-09-15 04:31:26
|
Revision: 900
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=900&view=rev
Author: dbrosius
Date: 2007-09-14 21:31:29 -0700 (Fri, 14 Sep 2007)
Log Message:
-----------
initial checkin - MRC detector
Modified Paths:
--------------
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2007-09-15 04:30:57 UTC (rev 899)
+++ trunk/fb-contrib/etc/findbugs.xml 2007-09-15 04:31:29 UTC (rev 900)
@@ -283,6 +283,10 @@
speed="fast"
reports="UAA_USE_ADD_ALL" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.MethodReturnsConstant"
+ speed="fast"
+ reports="MRC_METHOD_RETURNS_CONSTANT" />
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
@@ -372,4 +376,5 @@
<BugPattern abbrev="USS" type="USS_USE_STRING_SPLIT" category="STYLE" />
<BugPattern abbrev="SJVU" type="SJVU_SUSPICIOUS_JDK_VERSION_USE" category="CORRECTNESS" experimental="true" />
<BugPattern abbrev="UAA" type="UAA_USE_ADD_ALL" category="STYLE" experimental="true" />
+ <BugPattern abbrev="MRC" type="MRC_METHOD_RETURNS_CONSTANT" category="STYLE" experimental="true" />
</FindbugsPlugin>
\ No newline at end of file
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2007-09-15 04:30:57 UTC (rev 899)
+++ trunk/fb-contrib/etc/messages.xml 2007-09-15 04:31:29 UTC (rev 900)
@@ -767,6 +767,17 @@
</Details>
</Detector>
+ <Detector class="com.mebigfatguy.fbcontrib.detect.MethodReturnsConstant">
+ <Details>
+ <![CDATA[
+ <p>looks for private methods that only return one constant value. Since there is no
+ chance for derived classes overriding this behavior, the return of a constant value
+ seems dubious.</p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
+
<!-- BugPattern -->
<BugPattern type="ISB_INEFFICIENT_STRING_BUFFERING">
@@ -1922,6 +1933,19 @@
</Details>
</BugPattern>
+ <BugPattern type="MRC_METHOD_RETURNS_CONSTANT">
+ <ShortDescription>private method only returns one constant value</ShortDescription>
+ <LongDescription>private method {1} only returns one constant value</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This private method only returns one constant value. As this method is private,
+ it's behavior can't be overridden, and thus the return of a constant value seems dubious.
+ Either the method should be changed to return no value, or perhaps another return value
+ was expected to be returned in another code path in this method.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
<!-- BugCode -->
<BugCode abbrev="ISB">Inefficient String Buffering</BugCode>
@@ -1987,4 +2011,5 @@
<BugCode abbrev="USS">Use String Split</BugCode>
<BugCode abbrev="SJVU">Suspicious JDK Version Use</BugCode>
<BugCode abbrev="UAA">Use Add All</BugCode>
+ <BugCode abbrev="MRC">Method Returns Constant</BugCode>
</MessageCollection>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|