findbugsExcludeFile.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <FindBugsFilter>
  2. <Match>
  3. <Package name="org.apache.hadoop.record.compiler.generated" />
  4. </Match>
  5. <Match>
  6. <Package name="org.apache.hadoop.hdfs.protocol.proto" />
  7. </Match>
  8. <Match>
  9. <Package name="org.apache.hadoop.hdfs.server.namenode.ha.proto" />
  10. </Match>
  11. <Match>
  12. <Class name="~org.apache.hadoop.hdfs.server.namenode.FsImageProto.*" />
  13. </Match>
  14. <Match>
  15. <Package name="org.apache.hadoop.hdfs.qjournal.protocol" />
  16. </Match>
  17. <Match>
  18. <Bug pattern="EI_EXPOSE_REP" />
  19. </Match>
  20. <Match>
  21. <Bug pattern="EI_EXPOSE_REP2" />
  22. </Match>
  23. <Match>
  24. <Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE" />
  25. </Match>
  26. <Match>
  27. <Bug pattern="SE_BAD_FIELD" />
  28. </Match>
  29. <Match>
  30. <Class name="~.*_jsp" />
  31. <Bug pattern="DLS_DEAD_LOCAL_STORE" />
  32. </Match>
  33. <Match>
  34. <Field name="_jspx_dependants" />
  35. <Bug pattern="UWF_UNWRITTEN_FIELD" />
  36. </Match>
  37. <!--
  38. Inconsistent synchronization for Client.Connection.out is
  39. is intentional to make a connection to be closed instantly.
  40. -->
  41. <Match>
  42. <Class name="org.apache.hadoop.ipc.Client$Connection" />
  43. <Field name="out" />
  44. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  45. </Match>
  46. <!--
  47. Ignore Cross Scripting Vulnerabilities
  48. We have an input quoting filter that protects us.
  49. -->
  50. <Match>
  51. <Bug code="XSS" />
  52. </Match>
  53. <Match>
  54. <Bug code="HRS" />
  55. </Match>
  56. <!--
  57. core changes
  58. -->
  59. <Match>
  60. <Class name="~org.apache.hadoop.*" />
  61. <Bug code="MS" />
  62. </Match>
  63. <!--
  64. getTmpInputStreams is pretty much like a stream constructor.
  65. The newly created streams are not supposed to be closed in the constructor. So ignore
  66. the OBL warning.
  67. -->
  68. <Match>
  69. <Class name="org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetImpl" />
  70. <Method name="getTmpInputStreams" />
  71. <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
  72. </Match>
  73. <!--
  74. This class exposes stream constructors. The newly created streams are not
  75. supposed to be closed in the constructor. Ignore the OBL warning.
  76. -->
  77. <Match>
  78. <Class name="org.apache.hadoop.hdfs.server.datanode.FileIoProvider$WrappedFileOutputStream" />
  79. <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
  80. </Match>
  81. <!--
  82. This class exposes stream constructors. The newly created streams are not
  83. supposed to be closed in the constructor. Ignore the OBL warning.
  84. -->
  85. <Match>
  86. <Class name="org.apache.hadoop.hdfs.server.datanode.FileIoProvider$WrappedFileInputStream" />
  87. <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
  88. </Match>
  89. <!--
  90. This class exposes stream constructors. The newly created streams are not
  91. supposed to be closed in the constructor. Ignore the OBL warning.
  92. -->
  93. <Match>
  94. <Class name="org.apache.hadoop.hdfs.server.datanode.FileIoProvider$WrappedRandomAccessFile" />
  95. <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
  96. </Match>
  97. <!--
  98. lastAppliedTxid is carefully unsynchronized in the BackupNode in a couple spots.
  99. See the comments in BackupImage for justification.
  100. -->
  101. <Match>
  102. <Class name="org.apache.hadoop.hdfs.server.namenode.FSImage" />
  103. <Field name="lastAppliedTxId" />
  104. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  105. </Match>
  106. <!--
  107. Findbugs doesn't realize that closing a FilterOutputStream pushes the close down to
  108. wrapped streams, too.
  109. -->
  110. <Match>
  111. <Class name="org.apache.hadoop.hdfs.server.namenode.FSImageFormat$Saver" />
  112. <Method name="save" />
  113. <Bug pattern="OS_OPEN_STREAM" />
  114. </Match>
  115. <!--
  116. the 'metrics' member is sometimes used from synchronized blocks, sometimes not,
  117. but it's only reset by test cases, so should be fine
  118. -->
  119. <Match>
  120. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  121. <Field name="metrics" />
  122. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  123. </Match>
  124. <!--
  125. We use a separate lock to protect modifications to journalSet so that
  126. FSEditLog#selectInputStreams does not need to be a synchronized method.
  127. -->
  128. <Match>
  129. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  130. <Field name="journalSet" />
  131. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  132. </Match>
  133. <!--
  134. FSEditLog#getTotalSyncCount is not synchronized because this method is
  135. used by metrics. NullPointerException can happen and it is ignored.
  136. -->
  137. <Match>
  138. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  139. <Field name="editLogStream" />
  140. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  141. </Match>
  142. <!--
  143. FSEditLog#isOpenForWriteWithoutLock and FSEditLog#isSegmentOpenWithoutLock
  144. are not synchronized because these methods are used by metrics.
  145. -->
  146. <Match>
  147. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  148. <Field name="state" />
  149. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  150. </Match>
  151. <!--
  152. All of the threads which update/increment txid are synchronized,
  153. so make txid volatile instead of AtomicLong.
  154. -->
  155. <Match>
  156. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  157. <Field name="txid" />
  158. <Bug pattern="VO_VOLATILE_INCREMENT" />
  159. </Match>
  160. <!--
  161. This method isn't performance-critical and is much clearer to write as it's written.
  162. -->
  163. <Match>
  164. <Class name="org.apache.hadoop.hdfs.server.datanode.BlockPoolManager" />
  165. <Method name="doRefreshNamenodes" />
  166. <Bug category="PERFORMANCE" />
  167. </Match>
  168. <!-- Don't complain about System.exit() being called from quit() -->
  169. <Match>
  170. <Class name="org.apache.hadoop.hdfs.server.namenode.MetaRecoveryContext" />
  171. <Method name="quit" />
  172. <Bug pattern="DM_EXIT" />
  173. </Match>
  174. <!-- More complex cleanup logic confuses findbugs -->
  175. <Match>
  176. <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />
  177. <Method name="getPersistedPaxosData" />
  178. <Bug pattern="NP_NULL_PARAM_DEREF" />
  179. </Match>
  180. <!-- guava 27.0 update: @Nullable is not detected, however it's there -->
  181. <Match>
  182. <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />
  183. <Method name="persistPaxosData" />
  184. <Bug pattern="NP_NULL_PARAM_DEREF" />
  185. </Match>
  186. <!-- guava 27.0 update: @Nullable is not detected, however it's there -->
  187. <Match>
  188. <Class name="org.apache.hadoop.hdfs.qjournal.server.JournalNode" />
  189. <Method name="getLogDir" />
  190. <Bug pattern="NP_NULL_PARAM_DEREF" />
  191. </Match>
  192. <!-- guava 27.0 update: redundant nullcheck (assert for not null) -->
  193. <Match>
  194. <Class name="org.apache.hadoop.hdfs.qjournal.server.JournalNode" />
  195. <Method name="getLogDir" />
  196. <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
  197. </Match>
  198. <!-- Don't complain about LocalDatanodeInfo's anonymous class -->
  199. <Match>
  200. <Class name="org.apache.hadoop.hdfs.client.impl.BlockReaderLocal$LocalDatanodeInfo$1" />
  201. <Bug pattern="SE_BAD_FIELD_INNER_CLASS" />
  202. </Match>
  203. <!-- Only one method increments numFailedVolumes and it is synchronized -->
  204. <Match>
  205. <Class name="org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsVolumeList" />
  206. <Field name="numFailedVolumes" />
  207. <Bug pattern="VO_VOLATILE_INCREMENT" />
  208. </Match>
  209. <!-- Access to pendingReceivedRequests is synchronized -->
  210. <Match>
  211. <Class name="org.apache.hadoop.hdfs.server.datanode.BPServiceActor" />
  212. <Method name="notifyNamenodeBlockImmediately" />
  213. <Field name="pendingReceivedRequests" />
  214. <Bug pattern="VO_VOLATILE_INCREMENT" />
  215. </Match>
  216. <!-- Replace System.exit() call with ExitUtil.terminate() -->
  217. <Match>
  218. <Class name="org.apache.hadoop.hdfs.tools.JMXGet"/>
  219. <Method name="main" />
  220. <Bug pattern="NP_NULL_ON_SOME_PATH" />
  221. </Match>
  222. <Match>
  223. <Class name="org.apache.hadoop.hdfs.server.datanode.ReplicaInfo" />
  224. <Method name="setDirInternal" />
  225. <Bug pattern="DM_STRING_CTOR" />
  226. </Match>
  227. <!-- Manually verified to be okay, we want to throw away the top bit here -->
  228. <Match>
  229. <Class name="org.apache.hadoop.hdfs.server.namenode.CachedBlock" />
  230. <Method name="getReplication" />
  231. <Bug pattern="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT" />
  232. </Match>
  233. <Match>
  234. <Class name="org.apache.hadoop.hdfs.protocol.CacheDirective" />
  235. <Method name="insertInternal" />
  236. <Bug pattern="BC_UNCONFIRMED_CAST" />
  237. </Match>
  238. <Match>
  239. <Class name="org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor" />
  240. <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
  241. </Match>
  242. <Match>
  243. <Class name="org.apache.hadoop.hdfs.DFSUtil"/>
  244. <Method name="assertAllResultsEqual" />
  245. <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
  246. </Match>
  247. <!-- Manually verified that signed byte value involved in bitwise OR is not negative -->
  248. <Match>
  249. <Class name="org.apache.hadoop.hdfs.server.namenode.INodeFile$HeaderFormat" />
  250. <Method name="getBlockLayoutRedundancy" />
  251. <Bug pattern="BIT_IOR_OF_SIGNED_BYTE" />
  252. </Match>
  253. <Match>
  254. <Class name="org.apache.hadoop.hdfs.server.datanode.checker.AbstractFuture" />
  255. <Bug pattern="DLS_DEAD_STORE_OF_CLASS_LITERAL" />
  256. </Match>
  257. <Match>
  258. <Class name="org.apache.hadoop.hdfs.server.datanode.checker.AbstractFuture" />
  259. <Bug pattern="DLS_DEAD_LOCAL_STORE" />
  260. </Match>
  261. <Match>
  262. <Class name="org.apache.hadoop.hdfs.server.datanode.checker.AbstractFuture" />
  263. <Bug pattern="NS_DANGEROUS_NON_SHORT_CIRCUIT" />
  264. </Match>
  265. <Match>
  266. <Class name="org.apache.hadoop.hdfs.server.namenode.NNUpgradeUtil$1" />
  267. <Method name="visitFile" />
  268. <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
  269. </Match>
  270. <Match>
  271. <Class name="org.apache.hadoop.hdfs.server.namenode.NNUpgradeUtil$1" />
  272. <Method name="visitFile" />
  273. <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
  274. </Match>
  275. <!-- Ignore warnings for not changing the startup option parsing behavior. -->
  276. <Match>
  277. <Class name="org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption" />
  278. <Method name="setClusterId" />
  279. <Bug pattern="ME_ENUM_FIELD_SETTER" />
  280. </Match>
  281. <Match>
  282. <Class name="org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption" />
  283. <Method name="setForce" />
  284. <Bug pattern="ME_ENUM_FIELD_SETTER" />
  285. </Match>
  286. <Match>
  287. <Class name="org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption" />
  288. <Method name="setForceFormat" />
  289. <Bug pattern="ME_ENUM_FIELD_SETTER" />
  290. </Match>
  291. <Match>
  292. <Class name="org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption" />
  293. <Method name="setInteractiveFormat" />
  294. <Bug pattern="ME_ENUM_FIELD_SETTER" />
  295. </Match>
  296. <Match>
  297. <Class name="org.apache.hadoop.hdfs.server.datanode.DirectoryScanner" />
  298. <Method name="reconcile" />
  299. <Bug pattern="SWL_SLEEP_WITH_LOCK_HELD" />
  300. </Match>
  301. </FindBugsFilter>