Using modern Java features
This commit is contained in:
committed by
Josh Cummings
parent
7e01ebdd92
commit
9b603b99ab
+2
-3
@@ -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() {
|
||||
}
|
||||
|
||||
+1
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user