Skip to content

Commit da248d9

Browse files
committed
Moved from findbugs to spotbugs (#120) and addresse new issue discovered by spotbugs
1 parent 1ad723f commit da248d9

File tree

5 files changed

+22
-142
lines changed

5 files changed

+22
-142
lines changed

aws-serverless-java-container-core/pom.xml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -65,42 +65,12 @@
6565
</dependency>
6666
</dependencies>
6767

68-
<reporting>
69-
<plugins>
70-
<plugin>
71-
<groupId>org.codehaus.mojo</groupId>
72-
<artifactId>findbugs-maven-plugin</artifactId>
73-
<version>3.0.5</version>
74-
<configuration>
75-
<!--
76-
Enables analysis which takes more memory but finds more bugs.
77-
If you run out of memory, changes the value of the effort element
78-
to 'low'.
79-
-->
80-
<effort>Max</effort>
81-
<!-- Reports all bugs (other values are medium and max) -->
82-
<threshold>Low</threshold>
83-
<!-- Produces XML report -->
84-
<xmlOutput>true</xmlOutput>
85-
86-
<plugins>
87-
<plugin>
88-
<groupId>com.h3xstream.findsecbugs</groupId>
89-
<artifactId>findsecbugs-plugin</artifactId>
90-
<version>1.7.1</version>
91-
</plugin>
92-
</plugins>
93-
</configuration>
94-
</plugin>
95-
</plugins>
96-
</reporting>
97-
9868
<build>
9969
<plugins>
10070
<plugin>
101-
<groupId>org.codehaus.mojo</groupId>
102-
<artifactId>findbugs-maven-plugin</artifactId>
103-
<version>3.0.5</version>
71+
<groupId>com.github.spotbugs</groupId>
72+
<artifactId>spotbugs-maven-plugin</artifactId>
73+
<version>3.1.1</version>
10474
<configuration>
10575
<!--
10676
Enables analysis which takes more memory but finds more bugs.
@@ -113,7 +83,7 @@
11383
<!-- Produces XML report -->
11484
<xmlOutput>true</xmlOutput>
11585
<!-- Configures the directory in which the XML report is created -->
116-
<findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
86+
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
11787

11888
<plugins>
11989
<plugin>
@@ -125,7 +95,7 @@
12595
</configuration>
12696
<executions>
12797
<!--
128-
Ensures that FindBugs inspects source code when project is compiled.
98+
Ensures that SpotBug inspects source code when project is compiled.
12999
-->
130100
<execution>
131101
<id>analyze-compile</id>

aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/servlet/AwsHttpServletRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ protected Cookie[] parseCookieHeaderValue(String headerValue) {
275275

276276
return parsedHeaders.stream()
277277
.filter(e -> e.getKey() != null)
278-
.map(e -> new Cookie(e.getKey(), e.getValue()))
278+
.map(e -> new Cookie(SecurityUtils.crlf(e.getKey()), SecurityUtils.crlf(e.getValue())))
279279
.toArray(Cookie[]::new);
280280
}
281281

@@ -304,7 +304,7 @@ protected String generateQueryString(Map<String, String> parameters) {
304304
newValue = URLEncoder.encode(newValue, StandardCharsets.UTF_8.name());
305305
}
306306
} catch (UnsupportedEncodingException e) {
307-
log.error("Could not URLEncode: " + newKey, e);
307+
log.error(SecurityUtils.crlf("Could not URLEncode: " + newKey), e);
308308

309309
}
310310
return newKey + "=" + newValue;

aws-serverless-java-container-jersey/pom.xml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -70,42 +70,12 @@
7070

7171
</dependencies>
7272

73-
<reporting>
74-
<plugins>
75-
<plugin>
76-
<groupId>org.codehaus.mojo</groupId>
77-
<artifactId>findbugs-maven-plugin</artifactId>
78-
<version>3.0.5</version>
79-
<configuration>
80-
<!--
81-
Enables analysis which takes more memory but finds more bugs.
82-
If you run out of memory, changes the value of the effort element
83-
to 'low'.
84-
-->
85-
<effort>Max</effort>
86-
<!-- Reports all bugs (other values are medium and max) -->
87-
<threshold>Low</threshold>
88-
<!-- Produces XML report -->
89-
<xmlOutput>true</xmlOutput>
90-
91-
<plugins>
92-
<plugin>
93-
<groupId>com.h3xstream.findsecbugs</groupId>
94-
<artifactId>findsecbugs-plugin</artifactId>
95-
<version>1.7.1</version>
96-
</plugin>
97-
</plugins>
98-
</configuration>
99-
</plugin>
100-
</plugins>
101-
</reporting>
102-
10373
<build>
10474
<plugins>
10575
<plugin>
106-
<groupId>org.codehaus.mojo</groupId>
107-
<artifactId>findbugs-maven-plugin</artifactId>
108-
<version>3.0.5</version>
76+
<groupId>com.github.spotbugs</groupId>
77+
<artifactId>spotbugs-maven-plugin</artifactId>
78+
<version>3.1.1</version>
10979
<configuration>
11080
<!--
11181
Enables analysis which takes more memory but finds more bugs.
@@ -118,7 +88,7 @@
11888
<!-- Produces XML report -->
11989
<xmlOutput>true</xmlOutput>
12090
<!-- Configures the directory in which the XML report is created -->
121-
<findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
91+
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
12292

12393
<plugins>
12494
<plugin>
@@ -130,7 +100,7 @@
130100
</configuration>
131101
<executions>
132102
<!--
133-
Ensures that FindBugs inspects source code when project is compiled.
103+
Ensures that SpotBug inspects source code when project is compiled.
134104
-->
135105
<execution>
136106
<id>analyze-compile</id>

aws-serverless-java-container-spark/pom.xml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,6 @@
4141
</dependency>
4242
</dependencies>
4343

44-
<reporting>
45-
<plugins>
46-
<plugin>
47-
<groupId>org.codehaus.mojo</groupId>
48-
<artifactId>findbugs-maven-plugin</artifactId>
49-
<version>3.0.5</version>
50-
<configuration>
51-
<!--
52-
Enables analysis which takes more memory but finds more bugs.
53-
If you run out of memory, changes the value of the effort element
54-
to 'low'.
55-
-->
56-
<effort>Max</effort>
57-
<!-- Reports all bugs (other values are medium and max) -->
58-
<threshold>Low</threshold>
59-
<!-- Produces XML report -->
60-
<xmlOutput>true</xmlOutput>
61-
62-
<plugins>
63-
<plugin>
64-
<groupId>com.h3xstream.findsecbugs</groupId>
65-
<artifactId>findsecbugs-plugin</artifactId>
66-
<version>1.7.1</version>
67-
</plugin>
68-
</plugins>
69-
</configuration>
70-
</plugin>
71-
</plugins>
72-
</reporting>
73-
7444
<build>
7545
<plugins>
7646
<!-- fork JVM before each spring test to make sure we have a clean context -->
@@ -83,9 +53,9 @@
8353
</configuration>
8454
</plugin>
8555
<plugin>
86-
<groupId>org.codehaus.mojo</groupId>
87-
<artifactId>findbugs-maven-plugin</artifactId>
88-
<version>3.0.5</version>
56+
<groupId>com.github.spotbugs</groupId>
57+
<artifactId>spotbugs-maven-plugin</artifactId>
58+
<version>3.1.1</version>
8959
<configuration>
9060
<!--
9161
Enables analysis which takes more memory but finds more bugs.
@@ -98,7 +68,7 @@
9868
<!-- Produces XML report -->
9969
<xmlOutput>true</xmlOutput>
10070
<!-- Configures the directory in which the XML report is created -->
101-
<findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
71+
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
10272

10373
<plugins>
10474
<plugin>
@@ -110,7 +80,7 @@
11080
</configuration>
11181
<executions>
11282
<!--
113-
Ensures that FindBugs inspects source code when project is compiled.
83+
Ensures that SpotBug inspects source code when project is compiled.
11484
-->
11585
<execution>
11686
<id>analyze-compile</id>

aws-serverless-java-container-spring/pom.xml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -146,36 +146,6 @@
146146
</dependency>
147147
</dependencies>
148148

149-
<reporting>
150-
<plugins>
151-
<plugin>
152-
<groupId>org.codehaus.mojo</groupId>
153-
<artifactId>findbugs-maven-plugin</artifactId>
154-
<version>3.0.5</version>
155-
<configuration>
156-
<!--
157-
Enables analysis which takes more memory but finds more bugs.
158-
If you run out of memory, changes the value of the effort element
159-
to 'low'.
160-
-->
161-
<effort>Max</effort>
162-
<!-- Reports all bugs (other values are medium and max) -->
163-
<threshold>Low</threshold>
164-
<!-- Produces XML report -->
165-
<xmlOutput>true</xmlOutput>
166-
167-
<plugins>
168-
<plugin>
169-
<groupId>com.h3xstream.findsecbugs</groupId>
170-
<artifactId>findsecbugs-plugin</artifactId>
171-
<version>1.7.1</version>
172-
</plugin>
173-
</plugins>
174-
</configuration>
175-
</plugin>
176-
</plugins>
177-
</reporting>
178-
179149
<build>
180150
<plugins>
181151
<!-- fork JVM before each spring test to make sure we have a clean context -->
@@ -188,9 +158,9 @@
188158
</configuration>
189159
</plugin>
190160
<plugin>
191-
<groupId>org.codehaus.mojo</groupId>
192-
<artifactId>findbugs-maven-plugin</artifactId>
193-
<version>3.0.5</version>
161+
<groupId>com.github.spotbugs</groupId>
162+
<artifactId>spotbugs-maven-plugin</artifactId>
163+
<version>3.1.1</version>
194164
<configuration>
195165
<!--
196166
Enables analysis which takes more memory but finds more bugs.
@@ -203,7 +173,7 @@
203173
<!-- Produces XML report -->
204174
<xmlOutput>true</xmlOutput>
205175
<!-- Configures the directory in which the XML report is created -->
206-
<findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
176+
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
207177

208178
<plugins>
209179
<plugin>
@@ -215,7 +185,7 @@
215185
</configuration>
216186
<executions>
217187
<!--
218-
Ensures that FindBugs inspects source code when project is compiled.
188+
Ensures that SpotBug inspects source code when project is compiled.
219189
-->
220190
<execution>
221191
<id>analyze-compile</id>

0 commit comments

Comments
 (0)