findbugsExcludeFile.xml 6.3 KB

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