From 9149451b9dfd56ba922da39320e289e43a538fa9 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Fri, 23 Jan 2015 15:32:49 -0600 Subject: [PATCH] SEC-2828: SimDestinationMessageMatcher#toString() --- .../SimpDestinationMessageMatcher.java | 7 ++++ .../util/matcher/SimpMessageTypeMatcher.java | 37 +++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) 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