findbugsExcludeFile.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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="persistPaxosData" />
  178. <Bug pattern="OS_OPEN_STREAM" />
  179. </Match>
  180. <!-- Don't complain about LocalDatanodeInfo's anonymous class -->
  181. <Match>
  182. <Class name="org.apache.hadoop.hdfs.client.impl.BlockReaderLocal$LocalDatanodeInfo$1" />
  183. <Bug pattern="SE_BAD_FIELD_INNER_CLASS" />
  184. </Match>
  185. <!-- Only one method increments numFailedVolumes and it is synchronized -->
  186. <Match>
  187. <Class name="org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsVolumeList" />
  188. <Field name="numFailedVolumes" />
  189. <Bug pattern="VO_VOLATILE_INCREMENT" />
  190. </Match>
  191. <!-- Access to pendingReceivedRequests is synchronized -->
  192. <Match>
  193. <Class name="org.apache.hadoop.hdfs.server.datanode.BPServiceActor" />
  194. <Method name="notifyNamenodeBlockImmediately" />
  195. <Field name="pendingReceivedRequests" />
  196. <Bug pattern="VO_VOLATILE_INCREMENT" />
  197. </Match>
  198. <!-- Replace System.exit() call with ExitUtil.terminate() -->
  199. <Match>
  200. <Class name="org.apache.hadoop.hdfs.tools.JMXGet"/>
  201. <Method name="main" />
  202. <Bug pattern="NP_NULL_ON_SOME_PATH" />
  203. </Match>
  204. <Match>
  205. <Class name="org.apache.hadoop.hdfs.server.datanode.ReplicaInfo" />
  206. <Method name="setDirInternal" />
  207. <Bug pattern="DM_STRING_CTOR" />
  208. </Match>
  209. <!-- Manually verified to be okay, we want to throw away the top bit here -->
  210. <Match>
  211. <Class name="org.apache.hadoop.hdfs.server.namenode.CachedBlock" />
  212. <Method name="getReplication" />
  213. <Bug pattern="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT" />
  214. </Match>
  215. <Match>
  216. <Class name="org.apache.hadoop.hdfs.protocol.CacheDirective" />
  217. <Method name="insertInternal" />
  218. <Bug pattern="BC_UNCONFIRMED_CAST" />
  219. </Match>
  220. <Match>
  221. <Class name="org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor" />
  222. <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
  223. </Match>
  224. <Match>
  225. <Class name="org.apache.hadoop.hdfs.DFSUtil"/>
  226. <Method name="assertAllResultsEqual" />
  227. <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
  228. </Match>
  229. <!-- Manually verified that signed byte value involved in bitwise OR is not negative -->
  230. <Match>
  231. <Class name="org.apache.hadoop.hdfs.server.namenode.INodeFile$HeaderFormat" />
  232. <Method name="getBlockLayoutRedundancy" />
  233. <Bug pattern="BIT_IOR_OF_SIGNED_BYTE" />
  234. </Match>
  235. <Match>
  236. <Class name="org.apache.hadoop.hdfs.server.datanode.checker.AbstractFuture" />
  237. <Bug pattern="DLS_DEAD_STORE_OF_CLASS_LITERAL" />
  238. </Match>
  239. <Match>
  240. <Class name="org.apache.hadoop.hdfs.server.datanode.checker.AbstractFuture" />
  241. <Bug pattern="DLS_DEAD_LOCAL_STORE" />
  242. </Match>
  243. <Match>
  244. <Class name="org.apache.hadoop.hdfs.server.datanode.checker.AbstractFuture" />
  245. <Bug pattern="NS_DANGEROUS_NON_SHORT_CIRCUIT" />
  246. </Match>
  247. <Match>
  248. <Class name="org.apache.hadoop.hdfs.server.namenode.NNUpgradeUtil$1" />
  249. <Method name="visitFile" />
  250. <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
  251. </Match>
  252. <Match>
  253. <Class name="org.apache.hadoop.hdfs.server.namenode.NNUpgradeUtil$1" />
  254. <Method name="visitFile" />
  255. <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
  256. </Match>
  257. <!-- Ignore warnings for not changing the startup option parsing behavior. -->
  258. <Match>
  259. <Class name="org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption" />
  260. <Method name="setClusterId" />
  261. <Bug pattern="ME_ENUM_FIELD_SETTER" />
  262. </Match>
  263. <Match>
  264. <Class name="org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption" />
  265. <Method name="setForce" />
  266. <Bug pattern="ME_ENUM_FIELD_SETTER" />
  267. </Match>
  268. <Match>
  269. <Class name="org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption" />
  270. <Method name="setForceFormat" />
  271. <Bug pattern="ME_ENUM_FIELD_SETTER" />
  272. </Match>
  273. <Match>
  274. <Class name="org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption" />
  275. <Method name="setInteractiveFormat" />
  276. <Bug pattern="ME_ENUM_FIELD_SETTER" />
  277. </Match>
  278. </FindBugsFilter>