You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exclusions.xml 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FindBugsFilter>
  3. <!--
  4. !
  5. ! This file is divided into two parts:
  6. ! 1. APPROVED EXCLUSIONS
  7. ! 2. TEMPORARY (UNAPPROVED) EXCLUSIONS
  8. !
  9. ! Approved exclusions come in two sub-types:
  10. ! 1. general exclusion of a named bug pattern, meaning that all instances that matches the bug
  11. ! pattern identifier are excluded;
  12. ! 2. specific exclusions for a named bug pattern, meaning that all instance exclusions are
  13. ! explicitly enumerated;
  14. !
  15. ! All specific exclusions must be accompanied inline (i.e., in the affected source code) by
  16. ! a commented out annotation of the form:
  17. !
  18. ! // @SuppressFBWarnings("pattern identifier")
  19. !
  20. ! where pattern identifier is one of findbugs' named patterns. At an appropriate point in the
  21. ! future, these commented out annotations will be uncommented and exclusion patterns removed
  22. ! from this file.
  23. !
  24. ! Temporary (unapproved) exclusions are short-term work arounds that should be removed as
  25. ! soon as possible by either (1) fixing (eliminating) cause of warning, or (2) conversion to
  26. ! approved exclusion.
  27. !
  28. ! The organization of pattern matches employs the following levels (from top down):
  29. ! 1. bug pattern
  30. ! 2. or clause matching instances
  31. ! 3. class name, if applies to class/interface
  32. ! 4. and clause matching class/instance and single or or clause of multiple {method,field} members
  33. !
  34. ! for example,
  35. !
  36. ! <Match>
  37. ! <Bug pattern="pattern identifier"/>
  38. ! <Or>
  39. ! <And>
  40. ! <Class name="dotted class name"/>
  41. ! <Member name="unqualified member name"/>
  42. ! </And>
  43. ! </Or>
  44. ! </Match>
  45. !
  46. -->
  47. <!-- START - APPROVED EXCLUSIONS -->
  48. <Match>
  49. <Bug pattern="ES_COMPARING_STRINGS_WITH_EQ"/>
  50. <!-- OK; check mainly serves to cover case where both strings are null -->
  51. <And>
  52. <Class name="org.apache.fop.afp.AFPResourceInfo"/>
  53. <Method name="equals"/>
  54. </And>
  55. </Match>
  56. <Match>
  57. <Bug pattern="BC_BAD_CAST_TO_CONCRETE_COLLECTION"/>
  58. <!-- TODO - Not sure what to do with those two... Seems messy/hacky -->
  59. <And>
  60. <Class name="org.apache.fop.area.AreaTreeObject"/>
  61. <Method name="clone"/>
  62. </And>
  63. </Match>
  64. <Match>
  65. <Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
  66. <!-- TODO - See if these can be solved in a better way -->
  67. <Or>
  68. <And>
  69. <Class name="org.apache.fop.layoutmgr.PageBreakingAlgorithm"/>
  70. <Or>
  71. <Method name="createFootnotePages"/>
  72. <Method name="finish"/>
  73. </Or>
  74. </And>
  75. <And>
  76. <Class name="org.apache.fop.render.rtf.RTFHandler"/>
  77. <Or>
  78. <Method name="endCell"/>
  79. <Method name="endFootnoteBody"/>
  80. <Method name="endPart"/>
  81. <Method name="endRow"/>
  82. <Method name="startCell"/>
  83. <Method name="startFootnoteBody"/>
  84. <Method name="startListItem"/>
  85. <Method name="startListLabel"/>
  86. <Method name="startPart"/>
  87. <Method name="startRow"/>
  88. </Or>
  89. </And>
  90. </Or>
  91. </Match>
  92. <Match>
  93. <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/>
  94. <Or>
  95. <And>
  96. <Class name="org.apache.fop.render.intermediate.IFGraphicContext"/>
  97. <Method name="clone"/>
  98. </And>
  99. <And>
  100. <Class name="org.apache.fop.svg.text.BidiAttributedCharacterIterator"/>
  101. <Method name="clone"/>
  102. </And>
  103. </Or>
  104. </Match>
  105. <Match>
  106. <Bug pattern="DM_DEFAULT_ENCODING"/>
  107. <Or>
  108. <!-- default encoding used as a fallback/last resort -->
  109. <Or>
  110. <And>
  111. <Method name="getNameBytes"/>
  112. <Or>
  113. <Class name="org.apache.fop.afp.fonts.CharacterSet"/>
  114. <Class name="org.apache.fop.afp.modca.AbstractNamedAFPObject"/>
  115. </Or>
  116. </And>
  117. <And>
  118. <Class name="org.apache.fop.pdf.PDFDocument"/>
  119. <Method name="encode"/>
  120. </And>
  121. </Or>
  122. <!-- reads from or writes to terminal/console -->
  123. <Or>
  124. <And>
  125. <Class name="org.apache.fop.fonts.autodetect.WindowsFontDirFinder"/>
  126. <Method name="getWinDir"/>
  127. </And>
  128. <And>
  129. <Class name="org.apache.fop.hyphenation.HyphenationTree"/>
  130. <Method name="main"/>
  131. </And>
  132. <And>
  133. <Class name="org.apache.fop.render.rtf.rtflib.RtfFile"/>
  134. <Method name="main"/>
  135. </And>
  136. </Or>
  137. <!-- private method: byte-to-string and string-to-byte always on the same platform -->
  138. <And>
  139. <Class name="org.apache.fop.render.afp.AFPPainter$AFPBorderPainterAdapter"/>
  140. <Method name="hash"/>
  141. </And>
  142. <!-- source encoding out of FOP's control (FontBox) -->
  143. <Or>
  144. <And>
  145. <Class name="org.apache.fop.fonts.cff.CFFDataReader"/>
  146. <Method name="getString"/>
  147. </And>
  148. <And>
  149. <Class name="org.apache.fop.fonts.truetype.OTFSubSetFile"/>
  150. <Or>
  151. <Method name="createCFF"/>
  152. <Method name="writeROSEntry"/>
  153. <Method name="writeStringIndex"/>
  154. </Or>
  155. </And>
  156. <And>
  157. <Class name="org.apache.fop.render.ps.PSFontUtils"/>
  158. <Method name="embedType2CFF"/>
  159. </And>
  160. </Or>
  161. </Or>
  162. </Match>
  163. <Match>
  164. <!-- class only used when building? -->
  165. <Bug pattern="OS_OPEN_STREAM_EXCEPTION_PATH"/>
  166. <And>
  167. <Class name="org.apache.fop.hyphenation.SerializeHyphPattern"/>
  168. <Method name="serializeFile"/>
  169. </And>
  170. </Match>
  171. <Match>
  172. <Bug pattern="DM_EXIT"/>
  173. <Or>
  174. <And>
  175. <Class name="org.apache.fop.cli.CommandLineOptions"/>
  176. <Or>
  177. <Method name="parseCustomOutputOption"/>
  178. <Method name="parseOptions"/>
  179. </Or>
  180. </And>
  181. <And>
  182. <Class name="org.apache.fop.cli.Main"/>
  183. <Or>
  184. <Method name="startFOP"/>
  185. <Method name="startFOPWithDynamicClasspath"/>
  186. </Or>
  187. </And>
  188. <And>
  189. <Class name="org.apache.fop.tools.fontlist.FontListMain"/>
  190. <Or>
  191. <Method name="parseArguments"/>
  192. </Or>
  193. </And>
  194. </Or>
  195. </Match>
  196. <Match>
  197. <!-- Only OK as long as the type of the base map remains plain HashMap... -->
  198. <Bug pattern="DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS"/>
  199. <And>
  200. <Class name="org.apache.fop.fonts.truetype.OpenFont"/>
  201. <Method name="sortDirTabMap"/>
  202. </And>
  203. </Match>
  204. <Match>
  205. <Bug pattern="EQ_ALWAYS_TRUE"/>
  206. <Or>
  207. <And>
  208. <Class name="org.apache.fop.fo.properties.ToBeImplementedProperty"/>
  209. <Method name="equals"/>
  210. </And>
  211. </Or>
  212. </Match>
  213. <Match>
  214. <Bug pattern="MS_EXPOSE_REP"/>
  215. <Or>
  216. <And>
  217. <Class name="org.apache.fop.fo.FOPropertyMapping"/>
  218. <Method name="getGenericMappings"/>
  219. </And>
  220. </Or>
  221. </Match>
  222. <Match>
  223. <Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/>
  224. <Or>
  225. <Class name="org.apache.fop.apps.MimeConstants"/>
  226. <Class name="org.apache.fop.events.EventListener"/>
  227. <Class name="org.apache.fop.render.Graphics2DImagePainter"/>
  228. </Or>
  229. </Match>
  230. <Match>
  231. <Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
  232. <Or>
  233. <Class name="org.apache.fop.render.ps.PSFontUtils"/>
  234. <Class name="org.apache.fop.render.ps.PSImageUtils"/>
  235. <Class name="org.apache.fop.svg.GraphicsConfiguration"/>
  236. <Class name="org.apache.fop.svg.PDFTextUtil"/>
  237. <Class name="org.apache.fop.util.QName"/>
  238. </Or>
  239. </Match>
  240. <Match>
  241. <Bug pattern="OS_OPEN_STREAM_EXCEPTION_PATH"/>
  242. <!-- TODO - fix potential file descriptor leak -->
  243. <And>
  244. <Class name="org.apache.fop.hyphenation.SerializeHyphPattern"/>
  245. <Method name="serializeFile"/>
  246. </And>
  247. </Match>
  248. <Match>
  249. <Bug pattern="SE_INNER_CLASS"/>
  250. <Or>
  251. <Class name="org.apache.fop.afp.AFPPaintingState$AFPData"/>
  252. <Class name="org.apache.fop.area.inline.AbstractTextArea$TextAdjustingInfo"/>
  253. <Class name="org.apache.fop.area.inline.InlineArea$InlineAdjustingInfo"/>
  254. <Class name="org.apache.fop.area.LineArea$LineAdjustingInfo"/>
  255. <Class name="org.apache.fop.pdf.PDFPaintingState$PDFData"/>
  256. <Class name="org.apache.fop.util.AbstractPaintingState$StateStack"/>
  257. </Or>
  258. </Match>
  259. <Match>
  260. <Bug pattern="SF_SWITCH_FALLTHROUGH"/>
  261. <Or>
  262. <And>
  263. <Class name="org.apache.fop.render.awt.viewer.PreviewPanel$Reloader"/>
  264. <Method name="run"/>
  265. </And>
  266. </Or>
  267. </Match>
  268. <Match>
  269. <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
  270. <Or>
  271. <!-- TODO - fix later -->
  272. <Class name="org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement"/>
  273. <!-- FOs not yet implemented -->
  274. <Class name="org.apache.fop.fo.flow.MultiProperties"/>
  275. <Class name="org.apache.fop.fo.flow.MultiPropertySet"/>
  276. <Class name="org.apache.fop.fo.flow.MultiToggle"/>
  277. <Class name="org.apache.fop.fo.flow.table.TableAndCaption"/>
  278. <Class name="org.apache.fop.fo.flow.table.TableCaption"/>
  279. </Or>
  280. </Match>
  281. <Match>
  282. <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
  283. <Or>
  284. <!-- TODO - Implementation incomplete?
  285. If not, remove unused field(s) and unused accessors -->
  286. <Class name="org.apache.fop.complexscripts.fonts.GlyphProcessingState"/>
  287. <Class name="org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager"/>
  288. <Class name="org.apache.fop.pdf.PDFCMap"/>
  289. <Class name="org.apache.fop.render.pdf.PDFSVGHandler$PDFInfo"/>
  290. <Class name="org.apache.fop.svg.PDFGraphics2D"/>
  291. <!-- Properties not yet implemented -->
  292. <Class name="org.apache.fop.fo.flow.MultiToggle"/>
  293. <Class name="org.apache.fop.fo.properties.CommonMarginInline"/>
  294. <Class name="org.apache.fop.fo.properties.CommonRelativePosition"/>
  295. </Or>
  296. </Match>
  297. <Match>
  298. <Bug pattern="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD"/>
  299. <!-- Properties not yet implemented -->
  300. <Class name="org.apache.fop.fo.properties.CommonAural"/>
  301. </Match>
  302. <Match>
  303. <Class name="org.apache.fop.render.pdf.ImageRawPNGAdapter"/>
  304. <Or>
  305. <Method name="outputContents"/>
  306. <Method name="setup"/>
  307. </Or>
  308. <Or>
  309. <Bug pattern="OS_OPEN_STREAM"/>
  310. <Bug pattern="OS_OPEN_STREAM_EXCEPTION_PATH"/>
  311. </Or>
  312. </Match>
  313. <!-- END - APPROVED EXCLUSIONS -->
  314. <!-- START - TEMPORARY (UNAPPROVED) EXCLUSIONS -->
  315. <Match>
  316. <!-- 131 warnings -->
  317. <Bug pattern="BC_UNCONFIRMED_CAST"/>
  318. </Match>
  319. <Match>
  320. <!-- 15 warnings -->
  321. <Bug pattern="DB_DUPLICATE_SWITCH_CLAUSES"/>
  322. </Match>
  323. <Match>
  324. <!-- 27 warnings -->
  325. <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
  326. </Match>
  327. <Match>
  328. <!-- 29 warnings -->
  329. <Bug pattern="DM_CONVERT_CASE"/>
  330. </Match>
  331. <Match>
  332. <!-- 17 warnings -->
  333. <Bug pattern="DM_DEFAULT_ENCODING"/>
  334. </Match>
  335. <Match>
  336. <!-- 20 warnings -->
  337. <Bug pattern="DM_FP_NUMBER_CTOR"/>
  338. </Match>
  339. <Match>
  340. <!-- 88 warnings -->
  341. <Bug pattern="DM_NUMBER_CTOR"/>
  342. </Match>
  343. <Match>
  344. <!-- 84 warnings -->
  345. <Bug pattern="EI_EXPOSE_REP"/>
  346. </Match>
  347. <Match>
  348. <!-- 55 warnings -->
  349. <Bug pattern="EI_EXPOSE_REP2"/>
  350. </Match>
  351. <Match>
  352. <!-- 12 warnings -->
  353. <Bug pattern="FE_FLOATING_POINT_EQUALITY"/>
  354. </Match>
  355. <Match>
  356. <!-- 12 warnings -->
  357. <Bug pattern="MS_OOI_PKGPROTECT"/>
  358. </Match>
  359. <Match>
  360. <!-- 15 warnings -->
  361. <Bug pattern="MS_PKGPROTECT"/>
  362. </Match>
  363. <Match>
  364. <!-- 11 warnings -->
  365. <Bug pattern="NM_CONFUSING"/>
  366. </Match>
  367. <Match>
  368. <!-- 46 warnings -->
  369. <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
  370. </Match>
  371. <Match>
  372. <!-- 10 warnings -->
  373. <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
  374. </Match>
  375. <Match>
  376. <!-- 23 warnings -->
  377. <Bug pattern="REC_CATCH_EXCEPTION"/>
  378. </Match>
  379. <Match>
  380. <!-- 11 warnings -->
  381. <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
  382. </Match>
  383. <Match>
  384. <!-- 33 warnings -->
  385. <Bug pattern="SE_BAD_FIELD"/>
  386. </Match>
  387. <Match>
  388. <!-- 21 warnings -->
  389. <Bug pattern="SIC_INNER_SHOULD_BE_STATIC"/>
  390. </Match>
  391. <Match>
  392. <!-- 20 warnings -->
  393. <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
  394. </Match>
  395. <Match>
  396. <!-- 1 warning -->
  397. <Bug pattern="UI_INHERITANCE_UNSAFE_GETRESOURCE"/>
  398. </Match>
  399. <Match>
  400. <!-- 12 warnings -->
  401. <Bug pattern="URF_UNREAD_FIELD"/>
  402. </Match>
  403. <Match>
  404. <!-- 58 warnings -->
  405. <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
  406. </Match>
  407. <Match>
  408. <Bug pattern="PT_ABSOLUTE_PATH_TRAVERSAL"/>
  409. <And>
  410. <Class name="org.apache.fop.servlet.FopServlet"/>
  411. </And>
  412. </Match>
  413. <!-- Bug in findbugs? -->
  414. <Match>
  415. <Bug pattern="RC_REF_COMPARISON"/>
  416. <Or>
  417. <And>
  418. <Class name="org.apache.fop.fo.properties.OptionalCharacterProperty"/>
  419. <Method name="equals"/>
  420. </And>
  421. </Or>
  422. </Match>
  423. <!-- END - TEMPORARY (UNAPPROVED) EXCLUSIONS -->
  424. </FindBugsFilter>