Refine null-safety in the spring-messaging module

Closes gh-34158
This commit is contained in:
Sébastien Deleuze
2024-12-26 16:00:24 +01:00
parent 4fa33dfece
commit abccba22f1
7 changed files with 12 additions and 9 deletions

View File

@@ -25,6 +25,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -236,7 +237,7 @@ class MethodMessageHandlerTests {
}
@Override
protected String getMatchingMapping(String mapping, Message<?> message) {
protected @Nullable String getMatchingMapping(String mapping, Message<?> message) {
String destination = getLookupDestination(getDestination(message));
Assert.notNull(destination, "No destination");
return mapping.equals(destination) || this.pathMatcher.match(mapping, destination) ? mapping : null;