https://github.com/apache/commons-lang
Revision cbeb45b243897dd974978ac339c40c2915b638d1 authored by Benedikt Ritter on 14 March 2015, 12:27:19 UTC, committed by Benedikt Ritter on 14 March 2015, 12:27:19 UTC
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1666673 13f79535-47bb-0310-9956-ffa450edef68
1 parent 3328387
Raw File
Tip revision: cbeb45b243897dd974978ac339c40c2915b638d1 authored by Benedikt Ritter on 14 March 2015, 12:27:19 UTC
Kudos to the people how care about Commons Lang
Tip revision: cbeb45b
findbugs-exclude-filter.xml
<?xml version="1.0"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<!--
  This file contains some false positive bugs detected by findbugs. Their
  false positive nature has been analyzed individually and they have been
  put here to instruct findbugs it must ignore them.
-->
<FindBugsFilter>

  <!-- Reason: Optimization to use == -->
  <Match>
    <Class name="org.apache.commons.lang3.BooleanUtils" />
    <Or>
      <Method name="toBoolean" />
      <Method name="toBooleanObject" />
    </Or>
    <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" />
  </Match>
  <Match>
    <Class name="org.apache.commons.lang3.BooleanUtils" />
    <Method name="toBoolean" />
    <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN" />
  </Match>

  <!-- Reason: Behavior documented in javadoc -->
  <Match>
    <Class name="org.apache.commons.lang3.BooleanUtils" />
    <Or>
      <Method name="negate" />
      <Method name="toBooleanObject" />
    </Or>
    <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
  </Match>

  <!-- Reason: base class cannot be changed and field is properly checked against null so behavior is OK -->
  <Match>
    <Class name="org.apache.commons.lang3.text.ExtendedMessageFormat" />
    <Method name="applyPattern" />
    <Bug pattern="UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR" />
  </Match>

  <!-- Reason: Optimization to use == -->
  <Match>
    <Class name="org.apache.commons.lang3.StringUtils" />
    <Method name="indexOfDifference"/>
    <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" />
  </Match>

  <!-- Reason: Very much intended to do a fall through on the switch -->
  <Match>
    <Class name="org.apache.commons.lang3.math.NumberUtils" />
    <Method name="createNumber"/>
    <Bug pattern="SF_SWITCH_FALLTHROUGH" />
  </Match>

  <!-- Reason: Very much intended to do a fall through on the switch -->
  <Match>
    <Class name="org.apache.commons.lang3.time.DateUtils" />
    <Method name="getFragment"/>
    <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.lang3.math.DoubleRange" />
    <Field name="hashCode" />
    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
  </Match>
  <Match>
    <Class name="org.apache.commons.lang3.math.FloatRange" />
    <Field name="hashCode" />
    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
  </Match>
  <Match>
    <Class name="org.apache.commons.lang3.math.IntRange" />
    <Field name="hashCode" />
    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
  </Match>
  <Match>
    <Class name="org.apache.commons.lang3.math.LongRange" />
    <Field name="hashCode" />
    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
  </Match>
  <Match>
    <Class name="org.apache.commons.lang3.math.NumberRange" />
    <Field name="hashCode" />
    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
  </Match>

  <!-- Reason: toProperString is lazily loaded -->
  <Match>
    <Class name="org.apache.commons.lang3.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.lang3.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>

  <!-- Reason: FindBugs 2.0.2 used in maven-findbugs-plugin 2.5.2 seems to have problems with detection of default cases
   in switch statements. All the excluded methods have switch statements that conatin a default case. -->
  <Match>
    <Class name="org.apache.commons.lang3.math.NumberUtils"/>
    <Method name="createNumber" />
    <Bug pattern="SF_SWITCH_NO_DEFAULT" />
  </Match>
  <Match>
    <Class name="org.apache.commons.lang3.text.ExtendedMessageFormat"/>
    <Method name="insertFormats" />
    <Bug pattern="SF_SWITCH_NO_DEFAULT" />
  </Match>
  <Match>
    <Class name="org.apache.commons.lang3.time.FastDateParser"/>
    <Method name="getStrategy" />
    <Bug pattern="SF_SWITCH_NO_DEFAULT" />
  </Match>

</FindBugsFilter>
back to top