findbugsExcludeFile.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. lastAppliedTxid is carefully unsynchronized in the BackupNode in a couple spots.
  84. See the comments in BackupImage for justification.
  85. -->
  86. <Match>
  87. <Class name="org.apache.hadoop.hdfs.server.namenode.FSImage" />
  88. <Field name="lastAppliedTxId" />
  89. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  90. </Match>
  91. <!--
  92. Findbugs doesn't realize that closing a FilterOutputStream pushes the close down to
  93. wrapped streams, too.
  94. -->
  95. <Match>
  96. <Class name="org.apache.hadoop.hdfs.server.namenode.FSImageFormat$Saver" />
  97. <Method name="save" />
  98. <Bug pattern="OS_OPEN_STREAM" />
  99. </Match>
  100. <!--
  101. the 'metrics' member is sometimes used from synchronized blocks, sometimes not,
  102. but it's only reset by test cases, so should be fine
  103. -->
  104. <Match>
  105. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  106. <Field name="metrics" />
  107. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  108. </Match>
  109. <!--
  110. We use a separate lock to protect modifications to journalSet so that
  111. FSEditLog#selectInputStreams does not need to be a synchronized method.
  112. -->
  113. <Match>
  114. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  115. <Field name="journalSet" />
  116. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  117. </Match>
  118. <!--
  119. This method isn't performance-critical and is much clearer to write as it's written.
  120. -->
  121. <Match>
  122. <Class name="org.apache.hadoop.hdfs.server.datanode.BlockPoolManager" />
  123. <Method name="doRefreshNamenodes" />
  124. <Bug category="PERFORMANCE" />
  125. </Match>
  126. <!-- Don't complain about System.exit() being called from quit() -->
  127. <Match>
  128. <Class name="org.apache.hadoop.hdfs.server.namenode.MetaRecoveryContext" />
  129. <Method name="quit" />
  130. <Bug pattern="DM_EXIT" />
  131. </Match>
  132. <!-- More complex cleanup logic confuses findbugs -->
  133. <Match>
  134. <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />
  135. <Method name="persistPaxosData" />
  136. <Bug pattern="OS_OPEN_STREAM" />
  137. </Match>
  138. <!-- Don't complain about LocalDatanodeInfo's anonymous class -->
  139. <Match>
  140. <Class name="org.apache.hadoop.hdfs.client.impl.BlockReaderLocal$LocalDatanodeInfo$1" />
  141. <Bug pattern="SE_BAD_FIELD_INNER_CLASS" />
  142. </Match>
  143. <!-- Only one method increments numFailedVolumes and it is synchronized -->
  144. <Match>
  145. <Class name="org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsVolumeList" />
  146. <Field name="numFailedVolumes" />
  147. <Bug pattern="VO_VOLATILE_INCREMENT" />
  148. </Match>
  149. <!-- Access to pendingReceivedRequests is synchronized -->
  150. <Match>
  151. <Class name="org.apache.hadoop.hdfs.server.datanode.BPServiceActor" />
  152. <Method name="notifyNamenodeBlockImmediately" />
  153. <Field name="pendingReceivedRequests" />
  154. <Bug pattern="VO_VOLATILE_INCREMENT" />
  155. </Match>
  156. <!-- Replace System.exit() call with ExitUtil.terminate() -->
  157. <Match>
  158. <Class name="org.apache.hadoop.hdfs.tools.JMXGet"/>
  159. <Method name="main" />
  160. <Bug pattern="NP_NULL_ON_SOME_PATH" />
  161. </Match>
  162. <Match>
  163. <Class name="org.apache.hadoop.hdfs.server.datanode.ReplicaInfo" />
  164. <Method name="setDirInternal" />
  165. <Bug pattern="DM_STRING_CTOR" />
  166. </Match>
  167. <!-- Manually verified to be okay, we want to throw away the top bit here -->
  168. <Match>
  169. <Class name="org.apache.hadoop.hdfs.server.namenode.CachedBlock" />
  170. <Method name="getReplication" />
  171. <Bug pattern="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT" />
  172. </Match>
  173. <Match>
  174. <Class name="org.apache.hadoop.hdfs.protocol.CacheDirective" />
  175. <Method name="insertInternal" />
  176. <Bug pattern="BC_UNCONFIRMED_CAST" />
  177. </Match>
  178. <Match>
  179. <Class name="org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor" />
  180. <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
  181. </Match>
  182. <Match>
  183. <Class name="org.apache.hadoop.hdfs.DFSUtil"/>
  184. <Method name="assertAllResultsEqual" />
  185. <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
  186. </Match>
  187. </FindBugsFilter>