findbugsExcludeFile.xml 11 KB

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