findbugsExcludeFile.xml 6.4 KB

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