You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cs...@apache.org on 2016/09/23 12:04:01 UTC

activemq git commit: https://issues.apache.org/jira/browse/AMQ-6433

Repository: activemq
Updated Branches:
  refs/heads/master f25e7ab47 -> 2b99ffcc2


https://issues.apache.org/jira/browse/AMQ-6433

Generating a new equals method in TypeConversionSupport so the proper
null checks exist


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/2b99ffcc
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/2b99ffcc
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/2b99ffcc

Branch: refs/heads/master
Commit: 2b99ffcc22e8c982883ae553bd91d03acc68aaa2
Parents: f25e7ab
Author: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Authored: Fri Sep 23 08:02:22 2016 -0400
Committer: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Committed: Fri Sep 23 08:02:22 2016 -0400

----------------------------------------------------------------------
 .../activemq/util/TypeConversionSupport.java    | 22 +++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/2b99ffcc/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java b/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java
index c00b158..d84f94a 100755
--- a/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java
+++ b/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java
@@ -50,9 +50,25 @@ public final class TypeConversionSupport {
         }
 
         @Override
-        public boolean equals(Object o) {
-            ConversionKey x = (ConversionKey)o;
-            return x.from == from && x.to == to;
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            ConversionKey other = (ConversionKey) obj;
+            if (from == null) {
+                if (other.from != null)
+                    return false;
+            } else if (!from.equals(other.from))
+                return false;
+            if (to == null) {
+                if (other.to != null)
+                    return false;
+            } else if (!to.equals(other.to))
+                return false;
+            return true;
         }
 
         @Override