From b77b55f04081554ce89822cbeab9c46f779d7e85 Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Wed, 12 Feb 2014 17:00:10 -0700 Subject: [PATCH] CLOUDSTACK-6089: Use resource tag's key to determine match in equals() method for ResourceTagResponse --- .../api/response/ResourceTagResponse.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java b/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java index d8fb7823e4c..ae61347b480 100644 --- a/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java +++ b/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java @@ -110,16 +110,16 @@ public class ResourceTagResponse extends BaseResponse implements ControlledViewE this.customer = customer; } - public String getResourceId() { - return this.resourceId; + public String getKey() { + return this.key; } @Override public int hashCode() { final int prime = 31; int result = 1; - String rId = this.getResourceId(); - result = prime * result + ((rId== null) ? 0 : rId.hashCode()); + String key = this.getKey(); + result = prime * result + ((key == null) ? 0 : key.hashCode()); return result; } @@ -129,13 +129,14 @@ public class ResourceTagResponse extends BaseResponse implements ControlledViewE return true; if (obj == null) return false; - if (this.getClass() != obj.getClass()) + if (getClass() != obj.getClass()) return false; ResourceTagResponse other = (ResourceTagResponse) obj; - String rId = this.getResourceId(); - if (rId == null && other.getResourceId() != null) { - return false; - } else if (!rId.equals(other.getResourceId())) + String key = this.getKey(); + if (key == null) { + if (other.getKey() != null) + return false; + } else if (!key.equals(other.getKey())) return false; return true; }