findbugsExcludeFile.xml 10 KB

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