1
0
mirror of synced 2026-08-05 09:47:05 +00:00

Using modern Java features

This commit is contained in:
Krzysztof Krason
2023-01-20 16:45:41 +01:00
committed by Josh Cummings
parent 7e01ebdd92
commit 9b603b99ab
72 changed files with 206 additions and 402 deletions
@@ -85,8 +85,7 @@ public final class MessageMatcherDelegatingAuthorizationManager implements Autho
if (!matcher.matches((Message) message)) {
return null;
}
if (matcher instanceof SimpDestinationMessageMatcher) {
SimpDestinationMessageMatcher simp = (SimpDestinationMessageMatcher) matcher;
if (matcher instanceof SimpDestinationMessageMatcher simp) {
return new MessageAuthorizationContext<>(message, simp.extractPathVariables(message));
}
if (matcher instanceof Builder.LazySimpDestinationMessageMatcher) {
@@ -111,7 +110,7 @@ public final class MessageMatcherDelegatingAuthorizationManager implements Autho
private final List<Entry<AuthorizationManager<MessageAuthorizationContext<?>>>> mappings = new ArrayList<>();
private Supplier<PathMatcher> pathMatcher = () -> new AntPathMatcher();
private Supplier<PathMatcher> pathMatcher = AntPathMatcher::new;
public Builder() {
}
@@ -57,10 +57,9 @@ public class SimpMessageTypeMatcher implements MessageMatcher<Object> {
if (this == other) {
return true;
}
if (!(other instanceof SimpMessageTypeMatcher)) {
if (!(other instanceof SimpMessageTypeMatcher otherMatcher)) {
return false;
}
SimpMessageTypeMatcher otherMatcher = (SimpMessageTypeMatcher) other;
return ObjectUtils.nullSafeEquals(this.typeToMatch, otherMatcher.typeToMatch);
}