2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
19 <!-- Nested packages are not included by the Package filter, so we need a regexp... -->
21 <Class name="~.*\.generated\..*"/>
25 <Package name="~org\.apache\.hadoop\.hbase\.tmpl\..*"/>
29 <Class name="org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost"/>
31 <Method name="preExists"/>
32 <Method name="preCheckAndPut"/>
33 <Method name="preCheckAndDelete"/>
34 <Method name="preScannerNext"/>
36 <Bug pattern="NP_BOOLEAN_RETURN_NULL"/>
39 <!-- This is read by a thread from hadoop and findbugs never finds it -->
42 <Class name="org.apache.hadoop.hbase.metrics.BaseSourceImpl"/>
46 <Class name="org.apache.hadoop.hbase.regionserver.StoreFile$Writer"/>
47 <Bug pattern="NP_NULL_PARAM_DEREF"/>
51 <Class name="org.apache.hadoop.hbase.regionserver.wal.SequenceFileLogReader"/>
53 <Method name="addFileInfoToException"/>
55 <Bug pattern="REC_CATCH_EXCEPTION"/>
60 <Class name="org.apache.hadoop.hbase.KeyValue"/>
62 <Method name="createEmptyByteArray"/>
63 <Method name="createByteArray"/>
65 <Bug pattern="INT_VACUOUS_COMPARISON"/>
69 <Class name="org.apache.hadoop.hbase.util.ByteBufferUtils"/>
71 <Method name="putInt"/>
73 <Bug pattern="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT"/>
77 <Class name="org.apache.hadoop.hbase.mapreduce.MultithreadedTableMapper"/>
79 <Method name="MapRunner"/>
81 <Bug pattern="REC_CATCH_EXCEPTION"/>
85 <Class name="org.apache.hadoop.hbase.util.PoolMap$RoundRobinPool"/>
86 <Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
90 <Class name="org.apache.hadoop.hbase.ipc.RpcClient$Connection"/>
92 <Bug pattern="IS2_INCONSISTENT_SYNC"/>
93 <Bug pattern="NN_NAKED_NOTIFY"/>
98 <Class name="org.apache.hadoop.hbase.regionserver.HRegion"/>
100 <Method name="startRegionOperation"/>
101 <Method name="startBulkRegionOperation"/>
103 <Bug pattern="UL_UNRELEASED_LOCK"/>
108 A mutable static field could be changed by malicious code or by accident. The field could be
109 made package protected to avoid this vulnerability.
111 We have a set of stuff like:
112 public static final byte [] SKIP_ARRAY = new byte [ ] {'S', 'K', 'I', 'P'};
114 Warning is not wrong, but difficult to avoid...
116 <Bug pattern="MS_PKGPROTECT"/>
119 <Bug pattern="MS_OOI_PKGPROTECT"/>
125 Returning a reference to a mutable object value stored in one of the object's fields exposes
126 the internal representation of the object. If instances are accessed by untrusted code,
127 and unchecked changes to the mutable object would compromise security or other important
128 properties, you will need to do something different. Returning a new copy of the object is
129 better approach in many situations.
131 We have getters on our internal fields. Questionable, but out of findbugs scope. Returning a
132 copy is not practical in most cases.
134 <Bug pattern="EI_EXPOSE_REP"/>
137 <Bug pattern="EI_EXPOSE_REP2"/>
143 This class implements the Comparator interface. You should consider whether or not it should
144 also implement the Serializable interface. If a comparator is used to construct an ordered
145 collection such as a TreeMap, then the TreeMap will be serializable only if the comparator
146 is also serializable. As most comparators have little or no state, making them serializable
147 is generally easy and good defensive programming.
149 <Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE"/>
155 This method performs synchronization an object that is an instance of a class from
156 the java.util.concurrent package (or its subclasses). Instances of these classes have their own
157 concurrency control mechanisms that are orthogonal to the synchronization provided by the Java
158 keyword synchronized. For example, synchronizing on an AtomicBoolean will not prevent other
159 threads from modifying the AtomicBoolean.
161 Such code may be correct, but should be carefully reviewed and documented, and may confuse people
162 who have to maintain the code at a later date.
164 We do that all the time to save lock objects.
166 <Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER"/>
171 Found a call to a method which will perform a byte to String (or String to byte) conversion,
172 and will assume that the default platform encoding is suitable. This will cause the
173 application behaviour to vary between platforms. Use an alternative API and specify a
174 charset name or Charset object explicitly.
176 <Bug pattern="DM_DEFAULT_ENCODING"/>
181 Invoking System.exit shuts down the entire Java virtual machine. This should only been
182 done when it is appropriate. Such calls make it hard or impossible for your code to be
183 invoked by other code. Consider throwing a RuntimeException instead.
185 It's so bad that the reviews will catch all the wrong cases.
187 <Bug pattern="DM_EXIT"/>
192 This method returns a value that is not checked. The return value should be checked since
193 it can indicate an unusual or unexpected function execution. For example, the
194 File.delete() method returns false if the file could not be successfully deleted
195 (rather than throwing an Exception). If you don't check the result, you won't notice
196 if the method invocation signals unexpected behavior by returning an atypical return
199 It's so bad that the reviews will catch all the wrong cases.
201 <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
204 <Bug pattern="RV_RETURN_VALUE_IGNORED_INFERRED"/>
210 This method contains a redundant check of a known non-null value against the constant null.
212 Most of the time we're securing ourselves, does no much harm.
214 <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
219 A final static field references an array and can be accessed by malicious code or by
220 accident from another package. This code can freely modify the contents of the array.
222 We've got this all over the place... Cloning the array by security is not a general
223 solution from a performance point of view
225 <Bug pattern="MS_MUTABLE_ARRAY"/>
230 The logic explicitly checks equality of two floating point numbers. Ignore the warning
232 <Class name="org.apache.hadoop.hbase.master.AssignmentVerificationReport"/>
233 <Bug pattern="FE_FLOATING_POINT_EQUALITY"/>
237 <Class name="org.apache.hadoop.hbase.HRegionInfo"/>
239 <Method name="getEndKeyForDisplay"/>
240 <Method name="getStartKeyForDisplay"/>
242 <Bug pattern="MS_EXPOSE_REP"/>
246 <Class name="org.apache.hadoop.hbase.io.hfile.LruBlockCache"/>
247 <Bug pattern="SC_START_IN_CTOR"/>
251 <Class name="org.apache.hadoop.hbase.io.hfile.LruAdaptiveBlockCache"/>
252 <Bug pattern="SC_START_IN_CTOR"/>
257 False positives, NettyRpcServer#start & SimpleRpcServer#start are already synchronized and
258 there is check to ensure single initialization of authTokenSecretMgr field.
259 Ignore the warning, see HBASE-25875.
263 <Class name="org.apache.hadoop.hbase.ipc.NettyRpcServer"/>
264 <Method name="start"/>
267 <Class name="org.apache.hadoop.hbase.ipc.SimpleRpcServer"/>
268 <Method name="start"/>
271 <Bug pattern="ML_SYNC_ON_UPDATED_FIELD"/>