diff --git a/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpDestinationMessageMatcher.java b/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpDestinationMessageMatcher.java index a924e8ec1c..b8ebc34c91 100644 --- a/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpDestinationMessageMatcher.java +++ b/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpDestinationMessageMatcher.java @@ -122,4 +122,11 @@ public final class SimpDestinationMessageMatcher implements MessageMatcher { /** * Creates a new instance * - * @param typeToMatch the {@link SimpMessageType} that will result in a match. Cannot be null. + * @param typeToMatch + * the {@link SimpMessageType} that will result in a match. + * Cannot be null. */ public SimpMessageTypeMatcher(SimpMessageType typeToMatch) { Assert.notNull(typeToMatch, "typeToMatch cannot be null"); @@ -53,23 +54,27 @@ public class SimpMessageTypeMatcher implements MessageMatcher { return typeToMatch == messageType; } - - @Override public boolean equals(Object other) { - if (this == other) { - return true; - } - if (!(other instanceof SimpMessageTypeMatcher)) { - return false; - } - SimpMessageTypeMatcher otherMatcher = (SimpMessageTypeMatcher) other; - return ObjectUtils.nullSafeEquals(this.typeToMatch, otherMatcher.typeToMatch); + if (this == other) { + return true; + } + if (!(other instanceof SimpMessageTypeMatcher)) { + return false; + } + SimpMessageTypeMatcher otherMatcher = (SimpMessageTypeMatcher) other; + return ObjectUtils.nullSafeEquals(this.typeToMatch, + otherMatcher.typeToMatch); } - public int hashCode() { - // Using nullSafeHashCode for proper array hashCode handling - return ObjectUtils.nullSafeHashCode(this.typeToMatch); - } + public int hashCode() { + // Using nullSafeHashCode for proper array hashCode handling + return ObjectUtils.nullSafeHashCode(this.typeToMatch); + } + + @Override + public String toString() { + return "SimpMessageTypeMatcher [typeToMatch=" + typeToMatch + "]"; + } } \ No newline at end of file