[Fb-contrib-commit] fb-contrib/etc findbugs.xml,1.28,1.29 messages.xml,1.27,1.28
Brought to you by:
dbrosius
|
From: Dave B. <dbr...@us...> - 2005-11-01 05:41:21
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3408/etc Modified Files: findbugs.xml messages.xml Log Message: new NCMU detector - intial checkin Index: messages.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/messages.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- messages.xml 29 Oct 2005 19:39:14 -0000 1.27 +++ messages.xml 1 Nov 2005 05:41:14 -0000 1.28 @@ -201,6 +201,30 @@ </Details> </Detector> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse"> + <Details> + <![CDATA[ + <p> Looks for method calls to collection classes where the method is not defined by the Collections + interface, and an equivalent method exists in the interface. Examples include:<br> + <table border="1"> + <tr><th>Old Method</th><th>New Method</th></tr> + <tr><td>Hashtable.contains</td><td>Map.containsValue</td></tr> + <tr><td>Hashtable.elements</td><td>Map.elements</td></tr> + <tr><td>Hashtable.keys</td><td>Map.keySet</td></tr> + <tr><td>Vector.addElement</td><td>List.add</td></tr> + <tr><td>Vector.elementAt</td><td>List.get</td></tr> + <tr><td>Vector.insertElementAt</td><td>List.add</td></tr> + <tr><td>Vector.removeAllElements</td><td>List.clear</td></tr> + <tr><td>Vector.removeElement</td><td>List.remove</td></tr> + <tr><td>Vector.removeElementAt</td><td>List.remove</td></tr> + <tr><td>Vector.setElementAt</td><td>List.set</td></tr> + </table> + </p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> + <!-- BugPattern --> <BugPattern type="ISB_INEFFICIENT_STRING_BUFFERING"> @@ -399,6 +423,18 @@ </Details> </BugPattern> + <BugPattern type="NCMU_NON_COLLECTION_METHOD_USE"> + <ShortDescription>method uses old non collections interface methods</ShortDescription> + <LongDescription>method {1} uses old non collections interface methods</LongDescription> + <Details> + <![CDATA[ + <p>This method makes calls to collection classes where the method is not defined by the Collections + interface, and an equivalent method exists in the interface. By using the new methods, + you can define this object by the Collections interface and allow better decoupling.</p> + ]]> + </Details> + </BugPattern> + <!-- BugCode --> <BugCode abbrev="ISB">Inefficient String Buffering</BugCode> @@ -417,5 +453,6 @@ <BugCode abbrev="ACEM">Abstract Class Empty Methods</BugCode> <BugCode abbrev="MAC">Manual Array Copy</BugCode> <BugCode abbrev="FPL">Floating Point Loops</BugCode> + <BugCode abbrev="NCMU">Non Collection Method Use</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.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- findbugs.xml 30 Oct 2005 00:11:27 -0000 1.28 +++ findbugs.xml 1 Nov 2005 05:41:14 -0000 1.29 @@ -79,6 +79,10 @@ reports="FPL_FLOATING_POINT_LOOPS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse" + speed="fast" + reports="NCMU_NON_COLLECTION_METHOD_USE" /> + <!-- BugPattern --> <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" /> @@ -97,5 +101,6 @@ <BugPattern abbrev="ACEM" type="ACEM_ABSTRACT_CLASS_EMPTY_METHODS" category="STYLE" /> <BugPattern abbrev="MAC" type="MAC_MANUAL_ARRAY_COPY" category="PERFORMANCE" /> <BugPattern abbrev="FPL" type="FPL_FLOATING_POINT_LOOPS" category="CORRECTNESS" /> + <BugPattern abbrev="NCMU" type="NCMU_NON_COLLECTION_METHOD_USE" category="STYLE" experimental="true" /> </FindbugsPlugin> \ No newline at end of file |