findbugsExcludeFile.xml 12 KB

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