findbugsExcludeFile.xml 11 KB

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