1<?xml version="1.0"?> 2<!-- 3 Licensed to the Apache Software Foundation (ASF) under one or more 4 contributor license agreements. See the NOTICE file distributed with 5 this work for additional information regarding copyright ownership. 6 The ASF licenses this file to You under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with 8 the License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 See the License for the specific language governing permissions and 16 limitations under the License. 17--> 18 19<!-- 20 This file contains some false positive bugs detected by findbugs. Their 21 false positive nature has been analyzed individually and they have been 22 put here to instruct findbugs it must ignore them. 23--> 24<FindBugsFilter 25 xmlns="https://github.com/spotbugs/filter/3.0.0" 26 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 27 xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd"> 28 29 <!-- TODO Can any of these be done without breaking binary compatibility? --> 30 <Match> 31 <Class name="~.*" /> 32 <Or> 33 <Bug pattern="EI_EXPOSE_REP" /> 34 <Bug pattern="EI_EXPOSE_REP2" /> 35 <Bug pattern="MS_EXPOSE_REP" /> 36 </Or> 37 </Match> 38 39 <!-- TODO Can any of these be done without breaking binary compatibility? --> 40 <Match> 41 <Class name="org.apache.commons.lang3.reflect.FieldUtils" /> 42 <Bug pattern="REFLF_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_FIELD" /> 43 </Match> 44 45 <!-- https://github.com/spotbugs/spotbugs/issues/1504 --> 46 <Match> 47 <Class name="org.apache.commons.lang3.ArrayUtils" /> 48 <Method name="shuffle" /> 49 <Bug pattern="DMI_RANDOM_USED_ONLY_ONCE" /> 50 </Match> 51 52 <!-- https://github.com/spotbugs/spotbugs/issues/1504 --> 53 <Match> 54 <Class name="org.apache.commons.lang3.RandomStringUtils" /> 55 <Method name="random" /> 56 <Bug pattern="DMI_RANDOM_USED_ONLY_ONCE" /> 57 </Match> 58 59 <Match> 60 <Class name="org.apache.commons.lang3.ArrayUtils" /> 61 <Method name="addFirst" /> 62 <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" /> 63 </Match> 64 65 <!-- Reason: Optimization to use == --> 66 <Match> 67 <Class name="org.apache.commons.lang3.BooleanUtils" /> 68 <Or> 69 <Method name="toBoolean" /> 70 <Method name="toBooleanObject" /> 71 </Or> 72 <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" /> 73 </Match> 74 <Match> 75 <Class name="org.apache.commons.lang3.BooleanUtils" /> 76 <Method name="toBoolean" /> 77 <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN" /> 78 </Match> 79 80 <!-- Reason: Behavior documented in javadoc --> 81 <Match> 82 <Class name="org.apache.commons.lang3.BooleanUtils" /> 83 <Or> 84 <Method name="negate" /> 85 <Method name="toBooleanObject" /> 86 </Or> 87 <Bug pattern="NP_BOOLEAN_RETURN_NULL" /> 88 </Match> 89 90 <!-- Reason: base class cannot be changed and field is properly checked against null so behavior is OK --> 91 <Match> 92 <Class name="org.apache.commons.lang3.text.ExtendedMessageFormat" /> 93 <Method name="applyPattern" /> 94 <Bug pattern="UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR" /> 95 </Match> 96 97 <!-- Reason: Optimization to use == --> 98 <Match> 99 <Class name="org.apache.commons.lang3.StringUtils" /> 100 <Or> 101 <Method name="indexOfDifference"/> 102 <Method name="compare" params="java.lang.String,java.lang.String,boolean"/> 103 <Method name="compareIgnoreCase" params="java.lang.String,java.lang.String,boolean"/> 104 </Or> 105 <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" /> 106 </Match> 107 108 <!-- Reason: Very much intended to do a fall through on the switch --> 109 <Match> 110 <Class name="org.apache.commons.lang3.math.NumberUtils" /> 111 <Method name="createNumber"/> 112 <Bug pattern="SF_SWITCH_FALLTHROUGH" /> 113 </Match> 114 115 <!-- Reason: Very much intended to do a fall through on the switch --> 116 <Match> 117 <Class name="org.apache.commons.lang3.time.DateUtils" /> 118 <Method name="getFragment"/> 119 <Bug pattern="SF_SWITCH_FALLTHROUGH" /> 120 </Match> 121 122 <!-- Reason: toProperString is lazily loaded --> 123 <Match> 124 <Class name="org.apache.commons.lang3.math.Fraction" /> 125 <Field name="toProperString" /> 126 <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" /> 127 </Match> 128 129 <!-- Reason: It does call super.clone(), but via a subsequent method --> 130 <Match> 131 <Class name="org.apache.commons.lang3.text.StrTokenizer" /> 132 <Method name="clone"/> 133 <Bug pattern="CN_IDIOM_NO_SUPER_CALL" /> 134 </Match> 135 136 <!-- Reason: FindBugs 2.0.2 used in maven-findbugs-plugin 2.5.2 seems to have problems with detection of default cases 137 in switch statements. All the excluded methods have switch statements that contain a default case. --> 138 <Match> 139 <Class name="org.apache.commons.lang3.math.NumberUtils"/> 140 <Method name="createNumber" /> 141 <Bug pattern="SF_SWITCH_NO_DEFAULT" /> 142 </Match> 143 <!-- Reason: FindBugs does not correctly recognize default branches in switch statements without break statements. 144 See, e.g., the report at https://sourceforge.net/p/findbugs/bugs/1298 --> 145 <Match> 146 <Class name="org.apache.commons.lang3.time.FastDateParser"/> 147 <Or> 148 <Method name="getStrategy" /> 149 <Method name="simpleQuote" params="java.lang.StringBuilder, java.lang.String"/> 150 </Or> 151 <Bug pattern="SF_SWITCH_NO_DEFAULT" /> 152 </Match> 153 154 <!-- Reason: FindBugs cannot correctly recognize default branches in switch statements without break statements. 155 See, e.g., the report at https://sourceforge.net/p/findbugs/bugs/1298 --> 156 <Match> 157 <Class name="org.apache.commons.lang3.time.FastDatePrinter"/> 158 <Method name="appendFullDigits" params="java.lang.Appendable, int, int"/> 159 <Bug pattern="SF_SWITCH_NO_DEFAULT" /> 160 </Match> 161 162 <!-- Reason: The fallthrough on the switch statement is intentional --> 163 <Match> 164 <Class name="org.apache.commons.lang3.time.FastDatePrinter"/> 165 <Method name="appendFullDigits" params="java.lang.Appendable, int, int"/> 166 <Bug pattern="SF_SWITCH_FALLTHROUGH" /> 167 </Match> 168 169 <!-- Reason: Internal class that is used only as a key for an internal FormatCache. For this reason we can 170 be sure, that equals will never be called with null or types other than MultipartKey. 171 --> 172 <Match> 173 <Class name="org.apache.commons.lang3.time.FormatCache$MultipartKey" /> 174 <Method name="equals" /> 175 <Bug pattern="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS" /> 176 </Match> 177 <Match> 178 <Class name="org.apache.commons.lang3.time.FormatCache$MultipartKey" /> 179 <Method name="equals" /> 180 <Bug pattern="NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT" /> 181 </Match> 182 183 <!-- Reason: toString() can return null! --> 184 <Match> 185 <Class name="org.apache.commons.lang3.compare.ObjectToStringComparator" /> 186 <Method name="compare" /> 187 <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" /> 188 </Match> 189 190 <!-- Reason: requireNonNull is supposed to take a nullable parameter, 191 whatever Spotbugs thinks of it. --> 192 <Match> 193 <Class name="org.apache.commons.lang3.function.Objects" /> 194 <Method name="requireNonNull" /> 195 <Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" /> 196 </Match> 197</FindBugsFilter> 198