Refine null-safety in the spring-webmvc module
Closes gh-34164
This commit is contained in:
@@ -65,7 +65,7 @@ public class ResourceChainRegistration {
|
||||
this(cacheResources, (cacheResources ? new ConcurrentMapCache(DEFAULT_CACHE_NAME) : null));
|
||||
}
|
||||
|
||||
@SuppressWarnings("NullAway")
|
||||
@SuppressWarnings("NullAway") // Dataflow analysis limitation
|
||||
public ResourceChainRegistration(boolean cacheResources, @Nullable Cache cache) {
|
||||
Assert.isTrue(!cacheResources || cache != null, "'cache' is required when cacheResources=true");
|
||||
if (cacheResources) {
|
||||
|
||||
@@ -69,7 +69,7 @@ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("NullAway") // TODO NullAway bug potentially due to the recursive generic type
|
||||
@SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/1113
|
||||
public ServerResponse.BodyBuilder header(String headerName, @Nullable String... headerValues) {
|
||||
Assert.notNull(headerName, "HeaderName must not be null");
|
||||
for (String headerValue : headerValues) {
|
||||
|
||||
@@ -436,7 +436,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("NullAway")
|
||||
@SuppressWarnings("NullAway") // Dataflow analysis limitation
|
||||
private void addMatchingMappings(Collection<T> mappings, List<Match> matches, HttpServletRequest request) {
|
||||
for (T mapping : mappings) {
|
||||
T match = getMatchingMapping(mapping, request);
|
||||
|
||||
@@ -271,7 +271,7 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping i
|
||||
* @return a matching handler, or {@code null} if not found
|
||||
* @since 5.3
|
||||
*/
|
||||
@SuppressWarnings("NullAway")
|
||||
@SuppressWarnings("NullAway") // Dataflow analysis limitation
|
||||
protected @Nullable Object lookupHandler(
|
||||
RequestPath path, String lookupPath, HttpServletRequest request) throws Exception {
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
|
||||
* @param lookupPath the lookup path to check
|
||||
* @return the resolved public URL path, or {@code null} if unresolved
|
||||
*/
|
||||
@SuppressWarnings("NullAway")
|
||||
@SuppressWarnings("NullAway") // Dataflow analysis limitation
|
||||
public final @Nullable String getForLookupPath(String lookupPath) {
|
||||
// Clean duplicate slashes or pathWithinPattern won't match lookupPath
|
||||
String previous;
|
||||
|
||||
@@ -301,7 +301,7 @@ public class MessageTag extends HtmlEscapingAwareTag implements ArgumentAware {
|
||||
* Resolve the specified message into a concrete message String.
|
||||
* The returned message String should be unescaped.
|
||||
*/
|
||||
@SuppressWarnings("NullAway")
|
||||
@SuppressWarnings("NullAway") // Dataflow analysis limitation
|
||||
protected String resolveMessage() throws JspException, NoSuchMessageException {
|
||||
MessageSource messageSource = getMessageSource();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user