findbugsExcludeFile.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  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. <Class name="~.*_jsp" />
  28. <Bug pattern="DLS_DEAD_LOCAL_STORE" />
  29. </Match>
  30. <Match>
  31. <Field name="_jspx_dependants" />
  32. <Bug pattern="UWF_UNWRITTEN_FIELD" />
  33. </Match>
  34. <!--
  35. Inconsistent synchronization for Client.Connection.out is
  36. is intentional to make a connection to be closed instantly.
  37. -->
  38. <Match>
  39. <Class name="org.apache.hadoop.ipc.Client$Connection" />
  40. <Field name="out" />
  41. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  42. </Match>
  43. <!--
  44. Ignore Cross Scripting Vulnerabilities
  45. We have an input quoting filter that protects us.
  46. -->
  47. <Match>
  48. <Bug code="XSS" />
  49. </Match>
  50. <Match>
  51. <Bug code="HRS" />
  52. </Match>
  53. <!--
  54. Ignore warnings where child class has the same name as
  55. super class. Classes based on Old API shadow names from
  56. new API. Should go off after HADOOP-1.0
  57. -->
  58. <Match>
  59. <Class name="~org.apache.hadoop.mapred.*" />
  60. <Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />
  61. </Match>
  62. <!--
  63. Ignore warnings for usage of System.exit. This is
  64. required and have been well thought out
  65. -->
  66. <Match>
  67. <Class name="org.apache.hadoop.mapred.Child$2" />
  68. <Method name="run" />
  69. <Bug pattern="DM_EXIT" />
  70. </Match>
  71. <Match>
  72. <Class name="org.apache.hadoop.mapred.JobTracker" />
  73. <Method name="addHostToNodeMapping" />
  74. <Bug pattern="DM_EXIT" />
  75. </Match>
  76. <Match>
  77. <Class name="org.apache.hadoop.mapred.Task" />
  78. <Or>
  79. <Method name="done" />
  80. <Method name="commit" />
  81. <Method name="statusUpdate" />
  82. </Or>
  83. <Bug pattern="DM_EXIT" />
  84. </Match>
  85. <Match>
  86. <Class name="org.apache.hadoop.mapred.Task$TaskReporter" />
  87. <Method name="run" />
  88. <Bug pattern="DM_EXIT" />
  89. </Match>
  90. <!--
  91. We need to cast objects between old and new api objects
  92. -->
  93. <Match>
  94. <Class name="org.apache.hadoop.mapred.OutputCommitter" />
  95. <Bug pattern="BC_UNCONFIRMED_CAST" />
  96. </Match>
  97. <!--
  98. We intentionally do the get name from the inner class
  99. -->
  100. <Match>
  101. <Class name="org.apache.hadoop.mapred.TaskTracker$MapEventsFetcherThread" />
  102. <Method name="run" />
  103. <Bug pattern="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD" />
  104. </Match>
  105. <Match>
  106. <Class name="org.apache.hadoop.mapred.FileOutputCommitter" />
  107. <Bug pattern="NM_WRONG_PACKAGE_INTENTIONAL" />
  108. </Match>
  109. <!--
  110. Ignoring this warning as resolving this would need a non-trivial change in code
  111. -->
  112. <Match>
  113. <Class name="org.apache.hadoop.mapred.lib.aggregate.ValueAggregatorBaseDescriptor" />
  114. <Method name="configure" />
  115. <Field name="maxNumItems" />
  116. <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
  117. </Match>
  118. <!--
  119. Comes from org.apache.jasper.runtime.ResourceInjector. Cannot do much.
  120. -->
  121. <Match>
  122. <Class name="org.apache.hadoop.mapred.jobqueue_005fdetails_jsp" />
  123. <Field name="_jspx_resourceInjector" />
  124. <Bug pattern="SE_BAD_FIELD" />
  125. </Match>
  126. <!--
  127. Storing textInputFormat and then passing it as a parameter. Safe to ignore.
  128. -->
  129. <Match>
  130. <Class name="org.apache.hadoop.mapred.lib.aggregate.ValueAggregatorJob" />
  131. <Method name="createValueAggregatorJob" />
  132. <Bug pattern="DLS_DEAD_STORE_OF_CLASS_LITERAL" />
  133. </Match>
  134. <!--
  135. Can remove this after the upgrade to findbugs1.3.8
  136. -->
  137. <Match>
  138. <Class name="org.apache.hadoop.mapred.lib.db.DBInputFormat" />
  139. <Method name="getSplits" />
  140. <Bug pattern="DLS_DEAD_LOCAL_STORE" />
  141. </Match>
  142. <!--
  143. This is a spurious warning. Just ignore
  144. -->
  145. <Match>
  146. <Class name="org.apache.hadoop.mapred.MapTask$MapOutputBuffer" />
  147. <Field name="kvindex" />
  148. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  149. </Match>
  150. <!--
  151. core changes
  152. -->
  153. <Match>
  154. <Class name="~org.apache.hadoop.*" />
  155. <Bug code="MS" />
  156. </Match>
  157. <Match>
  158. <Class name="org.apache.hadoop.fs.FileSystem" />
  159. <Method name="checkPath" />
  160. <Bug pattern="ES_COMPARING_STRINGS_WITH_EQ" />
  161. </Match>
  162. <Match>
  163. <Class name="org.apache.hadoop.fs.kfs.KFSOutputStream" />
  164. <Field name="path" />
  165. <Bug pattern="URF_UNREAD_FIELD" />
  166. </Match>
  167. <Match>
  168. <Class name="org.apache.hadoop.fs.kfs.KosmosFileSystem" />
  169. <Method name="initialize" />
  170. <Bug pattern="DM_EXIT" />
  171. </Match>
  172. <Match>
  173. <Class name="org.apache.hadoop.io.Closeable" />
  174. <Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE" />
  175. </Match>
  176. <Match>
  177. <Class name="org.apache.hadoop.security.AccessControlException" />
  178. <Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />
  179. </Match>
  180. <Match>
  181. <Class name="org.apache.hadoop.record.meta.Utils" />
  182. <Method name="skip" />
  183. <Bug pattern="BC_UNCONFIRMED_CAST" />
  184. </Match>
  185. <!--
  186. The compareTo method is actually a dummy method that just
  187. throws excpetions. So, no need to override equals. Ignore
  188. -->
  189. <Match>
  190. <Class name="org.apache.hadoop.record.meta.RecordTypeInfo" />
  191. <Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS" />
  192. </Match>
  193. <Match>
  194. <Class name="org.apache.hadoop.util.ProcfsBasedProcessTree" />
  195. <Bug pattern="DMI_HARDCODED_ABSOLUTE_FILENAME" />
  196. </Match>
  197. <!--
  198. Streaming, Examples
  199. -->
  200. <Match>
  201. <Class name="org.apache.hadoop.streaming.StreamUtil$TaskId" />
  202. <Bug pattern="URF_UNREAD_FIELD" />
  203. </Match>
  204. <Match>
  205. <Class name="org.apache.hadoop.examples.DBCountPageView" />
  206. <Method name="verify" />
  207. <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
  208. </Match>
  209. <!--
  210. getTmpInputStreams is pretty much like a stream constructor.
  211. The newly created streams are not supposed to be closed in the constructor. So ignore
  212. the OBL warning.
  213. -->
  214. <Match>
  215. <Class name="org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetImpl" />
  216. <Method name="getTmpInputStreams" />
  217. <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
  218. </Match>
  219. <!--
  220. ResponseProccessor is thread that is designed to catch RuntimeException.
  221. -->
  222. <Match>
  223. <Class name="org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer$ResponseProcessor" />
  224. <Method name="run" />
  225. <Bug pattern="REC_CATCH_EXCEPTION" />
  226. </Match>
  227. <!--
  228. lastAppliedTxid is carefully unsynchronized in the BackupNode in a couple spots.
  229. See the comments in BackupImage for justification.
  230. -->
  231. <Match>
  232. <Class name="org.apache.hadoop.hdfs.server.namenode.FSImage" />
  233. <Field name="lastAppliedTxId" />
  234. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  235. </Match>
  236. <!--
  237. Findbugs doesn't realize that closing a FilterOutputStream pushes the close down to
  238. wrapped streams, too.
  239. -->
  240. <Match>
  241. <Class name="org.apache.hadoop.hdfs.server.namenode.FSImageFormat$Saver" />
  242. <Method name="save" />
  243. <Bug pattern="OS_OPEN_STREAM" />
  244. </Match>
  245. <!--
  246. the 'metrics' member is sometimes used from synchronized blocks, sometimes not,
  247. but it's only reset by test cases, so should be fine
  248. -->
  249. <Match>
  250. <Class name="org.apache.hadoop.hdfs.server.namenode.FSEditLog" />
  251. <Field name="metrics" />
  252. <Bug pattern="IS2_INCONSISTENT_SYNC" />
  253. </Match>
  254. <!--
  255. This method isn't performance-critical and is much clearer to write as it's written.
  256. -->
  257. <Match>
  258. <Class name="org.apache.hadoop.hdfs.server.datanode.BlockPoolManager" />
  259. <Method name="doRefreshNamenodes" />
  260. <Bug category="PERFORMANCE" />
  261. </Match>
  262. <!-- Don't complain about System.exit() being called from quit() -->
  263. <Match>
  264. <Class name="org.apache.hadoop.hdfs.server.namenode.MetaRecoveryContext" />
  265. <Method name="quit" />
  266. <Bug pattern="DM_EXIT" />
  267. </Match>
  268. <!-- Don't complain about recoverBlock equality check -->
  269. <Match>
  270. <Class name="org.apache.hadoop.hdfs.server.datanode.DataNode" />
  271. <Method name="recoverBlock" />
  272. <Bug pattern="EC_UNRELATED_TYPES" />
  273. </Match>
  274. <!-- More complex cleanup logic confuses findbugs -->
  275. <Match>
  276. <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />
  277. <Method name="persistPaxosData" />
  278. <Bug pattern="OS_OPEN_STREAM" />
  279. </Match>
  280. <!-- Don't complain about LocalDatanodeInfo's anonymous class -->
  281. <Match>
  282. <Class name="org.apache.hadoop.hdfs.BlockReaderLocal$LocalDatanodeInfo$1" />
  283. <Bug pattern="SE_BAD_FIELD_INNER_CLASS" />
  284. </Match>
  285. <!-- Only one method increments numFailedVolumes and it is synchronized -->
  286. <Match>
  287. <Class name="org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsVolumeList" />
  288. <Field name="numFailedVolumes" />
  289. <Bug pattern="VO_VOLATILE_INCREMENT" />
  290. </Match>
  291. <!-- Access to pendingReceivedRequests is synchronized -->
  292. <Match>
  293. <Class name="org.apache.hadoop.hdfs.server.datanode.BPServiceActor" />
  294. <Method name="notifyNamenodeBlockImmediately" />
  295. <Field name="pendingReceivedRequests" />
  296. <Bug pattern="VO_VOLATILE_INCREMENT" />
  297. </Match>
  298. <!-- The "LightWeight" classes are explicitly not thread safe -->
  299. <Match>
  300. <Class name="org.apache.hadoop.hdfs.util.LightWeightGSet" />
  301. <Field name="modification" />
  302. <Bug pattern="VO_VOLATILE_INCREMENT" />
  303. </Match>
  304. <Match>
  305. <Class name="org.apache.hadoop.hdfs.util.LightWeightHashSet" />
  306. <Field name="modification" />
  307. <Bug pattern="VO_VOLATILE_INCREMENT" />
  308. </Match>
  309. <Match>
  310. <Class name="org.apache.hadoop.hdfs.util.LightWeightLinkedSet" />
  311. <Field name="modification" />
  312. <Bug pattern="VO_VOLATILE_INCREMENT" />
  313. </Match>
  314. <!-- Replace System.exit() call with ExitUtil.terminate() -->
  315. <Match>
  316. <Class name="org.apache.hadoop.hdfs.tools.JMXGet"/>
  317. <Method name="main" />
  318. <Bug pattern="NP_NULL_ON_SOME_PATH" />
  319. </Match>
  320. <Match>
  321. <Class name="org.apache.hadoop.hdfs.server.datanode.ReplicaInfo" />
  322. <Method name="setDirInternal" />
  323. <Bug pattern="DM_STRING_CTOR" />
  324. </Match>
  325. <Match>
  326. <Class name="org.apache.hadoop.hdfs.client.ClientMmapManager" />
  327. <Method name="create" />
  328. <Bug pattern="UL_UNRELEASED_LOCK_EXCEPTION_PATH" />
  329. </Match>
  330. <Match>
  331. <Class name="org.apache.hadoop.hdfs.client.ClientMmapManager" />
  332. <Method name="create" />
  333. <Bug pattern="UL_UNRELEASED_LOCK" />
  334. </Match>
  335. <!-- Manually verified to be okay, we want to throw away the top bit here -->
  336. <Match>
  337. <Class name="org.apache.hadoop.hdfs.server.namenode.CachedBlock" />
  338. <Method name="getReplication" />
  339. <Bug pattern="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT" />
  340. </Match>
  341. <Match>
  342. <Class name="org.apache.hadoop.hdfs.protocol.CacheDirective" />
  343. <Method name="insertInternal" />
  344. <Bug pattern="BC_UNCONFIRMED_CAST" />
  345. </Match>
  346. <Match>
  347. <Class name="org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor" />
  348. <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
  349. </Match>
  350. <Match>
  351. <Class name="org.apache.hadoop.hdfs.DFSUtil"/>
  352. <Method name="assertAllResultsEqual" />
  353. <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
  354. </Match>
  355. </FindBugsFilter>