Update of /cvsroot/fb-contrib/fb-contrib/etc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20310/etc
Modified Files:
findbugs.xml messages.xml
Log Message:
intial checkin - NIR detector
Index: messages.xml
===================================================================
RCS file: /cvsroot/fb-contrib/fb-contrib/etc/messages.xml,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- messages.xml 2 Feb 2006 06:18:02 -0000 1.52
+++ messages.xml 4 Feb 2006 02:23:50 -0000 1.53
@@ -431,6 +431,17 @@
</Details>
</Detector>
+ <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessInstanceRetrieval">
+ <Details>
+ <![CDATA[
+ <p>Looks for methods that call a method to retrieve a reference to an object,
+ to use to load a constant. It is simpler and more performant to access the
+ static variable directly from the class itself.</p>
+ <p>It is a fast Detector</p>
+ ]]>
+ </Details>
+ </Detector>
+
<!-- BugPattern -->
<BugPattern type="ISB_INEFFICIENT_STRING_BUFFERING">
@@ -848,12 +859,19 @@
]]>
</Details>
</BugPattern>
-
- Looks for methods that implement awt or swing listeners and perform time
- consuming operations. Doing these operations in the gui thread will cause the
- interface to appear sluggish and non-responsive to the user. It is better to
- use a separate thread to do the time consuming work so that the user
- has a better experience.
+
+ <BugPattern type="NIR_NEEDLESS_INSTANCE_RETRIEVAL">
+ <ShortDescription>method retrieves instance to load static member</ShortDescription>
+ <LongDescription>method {1} retrieves instance to load static member</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method calls a method to load a reference to an object, and then only
+ uses it to load a static member of that instance's class. It is simpler and
+ better performant to just load the static field from the class itself.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
<!-- BugCode -->
<BugCode abbrev="ISB">Inefficient String Buffering</BugCode>
@@ -889,4 +907,5 @@
<BugCode abbrev="SCR">Sloppy Class Reflection</BugCode>
<BugCode abbrev="AWCBR">Array Wrapped Call By Reference</BugCode>
<BugCode abbrev="SG">Sluggish Gui</BugCode>
+ <BugCode abbrev="NIR">Needless Instance Retrieval</BugCode>
</MessageCollection>
\ No newline at end of file
Index: findbugs.xml
===================================================================
RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- findbugs.xml 2 Feb 2006 06:18:02 -0000 1.58
+++ findbugs.xml 4 Feb 2006 02:23:50 -0000 1.59
@@ -145,6 +145,10 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SluggishGui"
speed="fast"
reports="SG_SLUGGISH_GUI" />
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessInstanceRetrieval"
+ speed="fast"
+ reports="NIR_NEEDLESS_INSTANCE_RETRIEVAL" />
<!-- BugPattern -->
@@ -181,4 +185,5 @@
<BugPattern abbrev="SCR" type="SCR_SLOPPY_CLASS_REFLECTION" category="STYLE" experimental="true" />
<BugPattern abbrev="AWCBR" type="AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE" category="STYLE" experimental="true" />
<BugPattern abbrev="SG" type="SG_SLUGGISH_GUI" category="PERFORMANCE" experimental="true" />
+ <BugPattern abbrev="NIR" type="NIR_NEEDLESS_INSTANCE_RETRIEVAL" category="PERFORMANCE" experimental="true" />
</FindbugsPlugin>
\ No newline at end of file
|