[Fb-contrib-commit] fb-contrib/etc findbugs.xml,1.43,1.44 messages.xml,1.36,1.37
Brought to you by:
dbrosius
|
From: Dave B. <dbr...@us...> - 2005-12-17 08:27:09
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14091/etc Modified Files: findbugs.xml messages.xml Log Message: initial checkin - new ABC detector Index: messages.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/messages.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- messages.xml 8 Dec 2005 03:46:59 -0000 1.36 +++ messages.xml 17 Dec 2005 08:27:00 -0000 1.37 @@ -325,6 +325,19 @@ </Details> </Detector> + <Detector class="com.mebigfatguy.fbcontrib.detect.ArrayBasedCollections"> + <Details> + <![CDATA[ + <p>Looks for methods that use arrays for items in the keyset of a map, or as + an element of a set, or in a list when using the contains method. Since arrays + do not, and cannot define an equals method, reference equality is used for these + collections, which is probably not desired. If it is, consider using the IdentityHashMap + class when using Maps in this case, to better document your intentions.</p> + </p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> <!-- BugPattern --> <BugPattern type="ISB_INEFFICIENT_STRING_BUFFERING"> @@ -625,6 +638,19 @@ </Details> </BugPattern> + <BugPattern type="ABC_ARRAY_BASED_COLLECTIONS"> + <ShortDescription>method uses array as basis of collection</ShortDescription> + <LongDescription>method {1} uses array as basis of collection</LongDescription> + <Details> + <![CDATA[ + <p>This method passes an array as the key to a Map, element in a Set, or item in a List when + the contains method is used on the List. Since arrays do not, and cannot override the equals + method, collection inclusion is based on the reference's address, which is probably not desired. + </p> + ]]> + </Details> + </BugPattern> + <!-- BugCode --> <BugCode abbrev="ISB">Inefficient String Buffering</BugCode> @@ -651,4 +677,5 @@ <BugCode abbrev="NAB">Needless Autoboxing</BugCode> <BugCode abbrev="USBR">Unnecessary Store Before Return</BugCode> <BugCode abbrev="COM">Copied Overridden Method</BugCode> + <BugCode abbrev="ABC">Array Based Collection</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.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- findbugs.xml 8 Dec 2005 03:46:59 -0000 1.43 +++ findbugs.xml 17 Dec 2005 08:27:00 -0000 1.44 @@ -109,6 +109,10 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.CopiedOverriddenMethod" speed="moderate" reports="COM_COPIED_OVERRIDDEN_METHOD" /> + + <Detector class="com.mebigfatguy.fbcontrib.detect.ArrayBasedCollections" + speed="fast" + reports="ABC_ARRAY_BASED_COLLECTIONS" /> <!-- BugPattern --> @@ -132,8 +136,9 @@ <BugPattern abbrev="CAO" type="CAO_CONFUSING_AUTOBOXED_OVERLOADING" category="CORRECTNESS" /> <BugPattern abbrev="AFBR" type="AFBR_ABNORMAL_FINALLY_BLOCK_RETURN" category="CORRECTNESS" /> <BugPattern abbrev="SMII" type="SMII_STATIC_METHOD_INSTANCE_INVOCATION" category="STYLE" /> - <BugPattern abbrev="STS" type="STS_SPURIOUS_THREAD_STATES" category="MT_CORRECTNESS" experimental="true" /> - <BugPattern abbrev="NAB" type="NAB_NEEDLESS_AUTOBOXING" category="PERFORMANCE" experimental="true" /> - <BugPattern abbrev="USBR" type="USBR_UNNECESSARY_STORE_BEFORE_RETURN" category="STYLE" experimental="true" /> - <BugPattern abbrev="COM" type="COM_COPIED_OVERRIDDEN_METHOD" category="STYLE" experimental="true" /> + <BugPattern abbrev="STS" type="STS_SPURIOUS_THREAD_STATES" category="MT_CORRECTNESS" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_AUTOBOXING" category="PERFORMANCE" /> + <BugPattern abbrev="USBR" type="USBR_UNNECESSARY_STORE_BEFORE_RETURN" category="STYLE" /> + <BugPattern abbrev="COM" type="COM_COPIED_OVERRIDDEN_METHOD" category="STYLE" /> + <BugPattern abbrev="ABC" type="ABC_ARRAY_BASED_COLLECTIONS" category="CORRECTNESS" experimental="true" /> </FindbugsPlugin> \ No newline at end of file |