Updated Branches: refs/heads/master 706497299 -> b77b55f04
CLOUDSTACK-6089: Use resource tag's key to determine match in equals() method for ResourceTagResponse Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b77b55f0 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b77b55f0 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b77b55f0 Branch: refs/heads/master Commit: b77b55f04081554ce89822cbeab9c46f779d7e85 Parents: 7064972 Author: Marcus Sorensen <[email protected]> Authored: Wed Feb 12 17:00:10 2014 -0700 Committer: Marcus Sorensen <[email protected]> Committed: Wed Feb 12 17:00:10 2014 -0700 ---------------------------------------------------------------------- .../api/response/ResourceTagResponse.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b77b55f0/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java b/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java index d8fb782..ae61347 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; }
