findbugsExcludeFile.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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. ResponseProccessor is thread that is designed to catch RuntimeException.
  75. -->
  76. <Match>
  77. <Class name="org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer$ResponseProcessor" />
  78. <Method name="run" />
  79. <Bug pattern="REC_CATCH_EXCEPTION" />
  80. </Match>
  81. <!--
  82. we don't need to synchronize out in newStreamForAppend method because
  83. out.streamer cannot be touched by other threads. It is false-positive.
  84. -->
  85. <Match>
  86. <Class name="org.apache.hadoop.hdfs.DFSOutputStream" />
  87. <Method name="newStreamForAppend" />
  88. <Field name="streamer" />
  89. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  90. </Match>
  91. <!--
  92. lastAppliedTxid is carefully unsynchronized in the BackupNode in a couple spots.
  93. See the comments in BackupImage for justification.
  94. -->
  95. <Match>
  96. <Class name="org.apache.hadoop.hdfs.server.namenode.FSImage" />
  97. <Field name="lastAppliedTxId" />
  98. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  99. </Match>
  100. <!--
  101. Findbugs doesn't realize that closing a FilterOutputStream pushes the close down to
  102. wrapped streams, too.
  103. -->
  104. <Match>
  105. <Class name="org.apache.hadoop.hdfs.server.namenode.FSImageFormat$Saver" />
  106. <Method name="save" />
  107. <Bug pattern="OS_OPEN_STREAM" />
  108. </Match>
  109. <!--
  110. the 'metrics' member is sometimes used from synchronized blocks, sometimes not,
  111. but it's only reset by test cases, so should be fine
  112. -->
  113. <Match>
  114. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  115. <Field name="metrics" />
  116. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  117. </Match>
  118. <!--
  119. We use a separate lock to protect modifications to journalSet so that
  120. FSEditLog#selectInputStreams does not need to be a synchronized method.
  121. -->
  122. <Match>
  123. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  124. <Field name="journalSet" />
  125. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  126. </Match>
  127. <!--
  128. FSEditLog#getTotalSyncCount is not synchronized because this method is
  129. used by metrics. NullPointerException can happen and it is ignored.
  130. -->
  131. <Match>
  132. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  133. <Field name="editLogStream" />
  134. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  135. </Match>
  136. <!--
  137. FSEditLog#isOpenForWriteWithoutLock and FSEditLog#isSegmentOpenWithoutLock
  138. are not synchronized because these methods are used by metrics.
  139. -->
  140. <Match>
  141. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  142. <Field name="state" />
  143. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  144. </Match>
  145. <!--
  146. All of the threads which update/increment txid are synchronized,
  147. so make txid volatile instead of AtomicLong.
  148. -->
  149. <Match>
  150. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  151. <Field name="txid" />
  152. <Bug pattern="VO_VOLATILE_INCREMENT" />
  153. </Match>
  154. <!--
  155. This method isn't performance-critical and is much clearer to write as it's written.
  156. -->
  157. <Match>
  158. <Class name="org.apache.hadoop.hdfs.server.datanode.BlockPoolManager" />
  159. <Method name="doRefreshNamenodes" />
  160. <Bug category="PERFORMANCE" />
  161. </Match>
  162. <!-- Don't complain about System.exit() being called from quit() -->
  163. <Match>
  164. <Class name="org.apache.hadoop.hdfs.server.namenode.MetaRecoveryContext" />
  165. <Method name="quit" />
  166. <Bug pattern="DM_EXIT" />
  167. </Match>
  168. <!-- Don't complain about recoverBlock equality check -->
  169. <Match>
  170. <Class name="org.apache.hadoop.hdfs.server.datanode.DataNode" />
  171. <Method name="recoverBlock" />
  172. <Bug pattern="EC_UNRELATED_TYPES" />
  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.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. <Match>
  210. <Class name="org.apache.hadoop.hdfs.shortcircuit.DfsClientShmManager$EndpointShmManager" />
  211. <Method name="allocSlot" />
  212. <Bug pattern="UL_UNRELEASED_LOCK_EXCEPTION_PATH" />
  213. </Match>
  214. <Match>
  215. <Class name="org.apache.hadoop.hdfs.shortcircuit.DfsClientShmManager$EndpointShmManager" />
  216. <Method name="allocSlot" />
  217. <Bug pattern="UL_UNRELEASED_LOCK" />
  218. </Match>
  219. <!-- Manually verified to be okay, we want to throw away the top bit here -->
  220. <Match>
  221. <Class name="org.apache.hadoop.hdfs.server.namenode.CachedBlock" />
  222. <Method name="getReplication" />
  223. <Bug pattern="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT" />
  224. </Match>
  225. <Match>
  226. <Class name="org.apache.hadoop.hdfs.protocol.CacheDirective" />
  227. <Method name="insertInternal" />
  228. <Bug pattern="BC_UNCONFIRMED_CAST" />
  229. </Match>
  230. <Match>
  231. <Class name="org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor" />
  232. <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
  233. </Match>
  234. <Match>
  235. <Class name="org.apache.hadoop.hdfs.DFSUtil"/>
  236. <Method name="assertAllResultsEqual" />
  237. <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
  238. </Match>
  239. <!--
  240. We use a separate lock to guard cachingStrategy in order to separate
  241. locks for p-reads from seek + read invocations.
  242. -->
  243. <Match>
  244. <Class name="org.apache.hadoop.hdfs.DFSInputStream" />
  245. <Field name="cachingStrategy" />
  246. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  247. </Match>
  248. </FindBugsFilter>