findbugsExcludeFile.xml 10 KB

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