Skip to content

Commit 6c86914

Browse files
committed
Refine null-safety in the spring-webmvc module
Closes gh-34164
1 parent b332920 commit 6c86914

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceChainRegistration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public ResourceChainRegistration(boolean cacheResources) {
6565
this(cacheResources, (cacheResources ? new ConcurrentMapCache(DEFAULT_CACHE_NAME) : null));
6666
}
6767

68-
@SuppressWarnings("NullAway")
68+
@SuppressWarnings("NullAway") // Dataflow analysis limitation
6969
public ResourceChainRegistration(boolean cacheResources, @Nullable Cache cache) {
7070
Assert.isTrue(!cacheResources || cache != null, "'cache' is required when cacheResources=true");
7171
if (cacheResources) {

spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerResponseBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public DefaultServerResponseBuilder(HttpStatusCode status) {
6969
}
7070

7171
@Override
72-
@SuppressWarnings("NullAway") // TODO NullAway bug potentially due to the recursive generic type
72+
@SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/1113
7373
public ServerResponse.BodyBuilder header(String headerName, @Nullable String... headerValues) {
7474
Assert.notNull(headerName, "HeaderName must not be null");
7575
for (String headerValue : headerValues) {

spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ protected void handlerMethodsInitialized(Map<T, HandlerMethod> handlerMethods) {
436436
}
437437
}
438438

439-
@SuppressWarnings("NullAway")
439+
@SuppressWarnings("NullAway") // Dataflow analysis limitation
440440
private void addMatchingMappings(Collection<T> mappings, List<Match> matches, HttpServletRequest request) {
441441
for (T mapping : mappings) {
442442
T match = getMatchingMapping(mapping, request);

spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractUrlHandlerMapping.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private String getHandlerDescription(Object handler) {
271271
* @return a matching handler, or {@code null} if not found
272272
* @since 5.3
273273
*/
274-
@SuppressWarnings("NullAway")
274+
@SuppressWarnings("NullAway") // Dataflow analysis limitation
275275
protected @Nullable Object lookupHandler(
276276
RequestPath path, String lookupPath, HttpServletRequest request) throws Exception {
277277

spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceUrlProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ private int getEndPathIndex(String lookupPath) {
233233
* @param lookupPath the lookup path to check
234234
* @return the resolved public URL path, or {@code null} if unresolved
235235
*/
236-
@SuppressWarnings("NullAway")
236+
@SuppressWarnings("NullAway") // Dataflow analysis limitation
237237
public final @Nullable String getForLookupPath(String lookupPath) {
238238
// Clean duplicate slashes or pathWithinPattern won't match lookupPath
239239
String previous;

spring-webmvc/src/main/java/org/springframework/web/servlet/tags/MessageTag.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public void release() {
301301
* Resolve the specified message into a concrete message String.
302302
* The returned message String should be unescaped.
303303
*/
304-
@SuppressWarnings("NullAway")
304+
@SuppressWarnings("NullAway") // Dataflow analysis limitation
305305
protected String resolveMessage() throws JspException, NoSuchMessageException {
306306
MessageSource messageSource = getMessageSource();
307307

0 commit comments

Comments
 (0)