Skip to content

Commit 561f5d9

Browse files
committed
Activate SpotBugs and add exclusions for current errors
QA-1118
1 parent 63d97d5 commit 561f5d9

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

findbugs-filter.xml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<FindBugsFilter>
3+
<Match>
4+
<Class name="com.itextpdf.html2pdf.HtmlConverter"/>
5+
<Or>
6+
<Method
7+
name="convertToDocument"
8+
params="java.io.InputStream, com.itextpdf.kernel.pdf.PdfDocument, com.itextpdf.html2pdf.ConverterProperties"
9+
/>
10+
<Method
11+
name="convertToDocument"
12+
params="java.lang.String, com.itextpdf.kernel.pdf.PdfDocument, com.itextpdf.html2pdf.ConverterProperties"
13+
/>
14+
<Method
15+
name="convertToElements"
16+
params="java.io.InputStream, com.itextpdf.html2pdf.ConverterProperties"
17+
/>
18+
<Method
19+
name="convertToElements"
20+
params="java.lang.String, com.itextpdf.html2pdf.ConverterProperties"
21+
/>
22+
</Or>
23+
<Bug pattern="EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS"/>
24+
</Match>
25+
<Match>
26+
<Class name="com.itextpdf.html2pdf.attach.impl.DefaultHtmlProcessor"/>
27+
<Method name="visit" params="com.itextpdf.styledxmlparser.node.INode"/>
28+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
29+
</Match>
30+
<Match>
31+
<Class name="com.itextpdf.html2pdf.attach.impl.layout.HeightDimensionContainer"/>
32+
<Method
33+
name="&lt;init&gt;"
34+
params="com.itextpdf.styledxmlparser.css.CssContextNode, float, float, com.itextpdf.layout.renderer.IRenderer, float"
35+
/>
36+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
37+
</Match>
38+
<Match>
39+
<Class name="com.itextpdf.html2pdf.attach.impl.layout.WidthDimensionContainer"/>
40+
<Method
41+
name="&lt;init&gt;"
42+
params="com.itextpdf.styledxmlparser.css.CssContextNode, float, com.itextpdf.layout.renderer.IRenderer, float"
43+
/>
44+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
45+
</Match>
46+
<Match>
47+
<Class name="com.itextpdf.html2pdf.attach.impl.tags.ThTagWorker"/>
48+
<Method
49+
name="processEnd"
50+
params="com.itextpdf.styledxmlparser.node.IElementNode, com.itextpdf.html2pdf.attach.ProcessorContext"
51+
/>
52+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
53+
</Match>
54+
<Match>
55+
<Class name="com.itextpdf.html2pdf.attach.util.WaitingColgroupsHelper"/>
56+
<Or>
57+
<Method name="applyColStyles" params=""/>
58+
<Method
59+
name="applyColStyles"
60+
params="com.itextpdf.styledxmlparser.node.INode, com.itextpdf.html2pdf.attach.util.RowColHelper"
61+
/>
62+
</Or>
63+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
64+
</Match>
65+
<Match>
66+
<Class name="com.itextpdf.html2pdf.css.CssConstants"/>
67+
<Field name="OVERFLOW_VALUES"/>
68+
<Bug pattern="MS_MUTABLE_COLLECTION"/>
69+
</Match>
70+
<Match>
71+
<Class name="com.itextpdf.html2pdf.css.apply.util.BackgroundApplierUtil"/>
72+
<Method
73+
name="applyBackground"
74+
params="java.util.Map, com.itextpdf.html2pdf.attach.ProcessorContext, com.itextpdf.layout.IPropertyContainer"
75+
/>
76+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
77+
</Match>
78+
<Match>
79+
<Class name="com.itextpdf.html2pdf.css.apply.util.FontStyleApplierUtil"/>
80+
<Method
81+
name="applyFontStyles"
82+
params="java.util.Map, com.itextpdf.html2pdf.attach.ProcessorContext, com.itextpdf.styledxmlparser.node.IStylesContainer, com.itextpdf.layout.IPropertyContainer"
83+
/>
84+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
85+
</Match>
86+
<Match>
87+
<Class name="com.itextpdf.html2pdf.css.resolve.DefaultCssResolver"/>
88+
<Method
89+
name="collectCssDeclarations"
90+
params="com.itextpdf.styledxmlparser.node.INode, com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver, com.itextpdf.html2pdf.css.resolve.CssContext"
91+
/>
92+
<Or>
93+
<Bug pattern="DM_DEFAULT_ENCODING"/>
94+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
95+
</Or>
96+
</Match>
97+
<Match>
98+
<Class name="com.itextpdf.html2pdf.html.HtmlUtils"/>
99+
<Method name="isStyleSheetLink" params="com.itextpdf.styledxmlparser.node.IElementNode"/>
100+
<Bug pattern="LSC_LITERAL_STRING_COMPARISON"/>
101+
</Match>
102+
</FindBugsFilter>

pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@
9797
</resource>
9898
</resources>
9999
<plugins>
100+
<plugin>
101+
<groupId>com.github.spotbugs</groupId>
102+
<artifactId>spotbugs-maven-plugin</artifactId>
103+
<version>${spotbugs.version}</version>
104+
<configuration>
105+
<threshold>High</threshold>
106+
<failOnError>true</failOnError>
107+
<excludeFilterFile>findbugs-filter.xml</excludeFilterFile>
108+
</configuration>
109+
</plugin>
100110
<plugin>
101111
<groupId>external.atlassian.jgitflow</groupId>
102112
<artifactId>jgitflow-maven-plugin</artifactId>

0 commit comments

Comments
 (0)