activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject [2/2] activemq git commit: https://issues.apache.org/jira/browse/AMQ-6433
Date Fri, 23 Sep 2016 12:05:14 GMT
https://issues.apache.org/jira/browse/AMQ-6433

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

(cherry picked from commit 2b99ffcc22e8c982883ae553bd91d03acc68aaa2)


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

Branch: refs/heads/activemq-5.14.x
Commit: 8bde32a07c28500793924b183f2956e8cc6b13f4
Parents: a80f7cc
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Fri Sep 23 08:02:22 2016 -0400
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Fri Sep 23 08:04:36 2016 -0400

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/8bde32a0/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


Mime
View raw message