Hooking up findbugs exclude file and updating the exception cases

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@775427 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2009-05-16 08:16:29 +00:00
parent 226801cebc
commit cbc1dc8c5a
2 changed files with 58 additions and 6 deletions

View File

@ -23,28 +23,79 @@
--> -->
<FindBugsFilter> <FindBugsFilter>
<!-- Reason: Optimization to use == -->
<Match> <Match>
<Class name="org.apache.commons.lang.BooleanUtils" /> <Class name="org.apache.commons.lang.BooleanUtils" />
<Method name="toBoolean" /> <Method name="toBoolean" />
<Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" /> <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" />
</Match> </Match>
<!-- Reason: Optimization to use == -->
<Match> <Match>
<Class name="org.apache.commons.lang.StringUtils" /> <Class name="org.apache.commons.lang.StringUtils" />
<Method name="indexOfDifference"/> <Method name="indexOfDifference"/>
<Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" /> <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" />
</Match> </Match>
<!-- Reason: Very much intended to do a fall through on the switch -->
<Match> <Match>
<Class name="org.apache.commons.lang.BooleanUtils" /> <Class name="org.apache.commons.lang.math.NumberUtils" />
<Method name="negate"/> <Method name="createNumber"/>
<Bug pattern="NP_BOOLEAN_RETURN_NULL" /> <Bug pattern="SF_SWITCH_FALLTHROUGH" />
</Match> </Match>
<!-- Reason: Very much intended to do a fall through on the switch -->
<Match> <Match>
<Class name="org.apache.commons.lang.BooleanUtils" /> <Class name="org.apache.commons.lang.time.DateUtils" />
<Method name="toBooleanObject"/> <Method name="getFragment"/>
<Bug pattern="NP_BOOLEAN_RETURN_NULL" /> <Bug pattern="SF_SWITCH_FALLTHROUGH" />
</Match>
<!-- Reason: hashCode is lazily loaded in Range classes -->
<!-- TODO: Work out why regex didn't work here -->
<Match>
<Class name="org.apache.commons.lang.math.DoubleRange" />
<Field name="hashCode" />
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
</Match>
<Match>
<Class name="org.apache.commons.lang.math.FloatRange" />
<Field name="hashCode" />
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
</Match>
<Match>
<Class name="org.apache.commons.lang.math.IntRange" />
<Field name="hashCode" />
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
</Match>
<Match>
<Class name="org.apache.commons.lang.math.LongRange" />
<Field name="hashCode" />
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
</Match>
<Match>
<Class name="org.apache.commons.lang.math.NumberRange" />
<Field name="hashCode" />
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
</Match>
<!-- Reason: toProperString is lazily loaded -->
<Match>
<Class name="org.apache.commons.lang.math.Fraction" />
<Field name="toProperString" />
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
</Match>
<!-- Reason: It does call super.clone(), but via a subsequent method -->
<Match>
<Class name="org.apache.commons.lang.text.StrTokenizer" />
<Method name="clone"/>
<Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
</Match>
<!-- Reason: Testing shows that new Integer(...) etc is quicker than Integer.valueOf -->
<Match>
<Bug pattern="DM_NUMBER_CTOR" />
</Match> </Match>
</FindBugsFilter> </FindBugsFilter>

View File

@ -461,6 +461,7 @@
<configuration> <configuration>
<threshold>Normal</threshold> <threshold>Normal</threshold>
<effort>Default</effort> <effort>Default</effort>
<excludeFilterFile>findbugs-exclude-filter.xml</excludeFilterFile>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>