smolnar82 commented on a change in pull request #297: KNOX-2301 and KNOX-2302
URL: https://github.com/apache/knox/pull/297#discussion_r396341268
 
 

 ##########
 File path: 
gateway-spi/src/main/java/org/apache/knox/gateway/topology/Service.java
 ##########
 @@ -122,32 +122,61 @@ public boolean equals(Object object) {
       return false;
     }
     Service that = (Service) object;
-    String thatName = that.getName();
+    String thatName = that.name;
     if (thatName != null && !(thatName.equals(name))) {
         return false;
     }
-    String thatRole = that.getRole();
+    String thatRole = that.role;
     if (thatRole != null && !thatRole.equals(role)) {
         return false;
     }
-    Version thatVersion = that.getVersion();
+    Version thatVersion = that.version;
     if (thatVersion != null && !(thatVersion.equals(version))) {
         return false;
     }
+
+    // URLs
+    if (urls.size() != that.urls.size()) {
+      return false;
+    }
+
+    for (String url : urls) {
+      if (!that.urls.contains(url)) {
+        return false;
+      }
+    }
+
+    // Params
+    if (params.size() != that.params.size()) {
+      return false;
+    }
+
+    for (Map.Entry<String, String> param : params.entrySet()) {
+      if (!param.getValue().equals(that.params.get(param.getKey()))) {
+        return false;
+      }
+    }
+
     return true;
   }
 
   @Override
   public int hashCode() {
 
 Review comment:
   Adding `HashCodeBuilder` and `EqualsBuilder` here too?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to