cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject git commit: updated refs/heads/4.2 to 864d148
Date Wed, 12 Feb 2014 23:10:39 GMT
Updated Branches:
  refs/heads/4.2 12a013798 -> 864d14857


CLOUDSTACK-6089: Implement equals() method for ResourceTagResponse
so that the java Set can properly determine if a ResourceTagResponse
is unique. This ensures we don't get duplicate resource tags showing
up any time a UserVmResponse is crafted (which can be quite often
due to the way the responses are crafted).


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/864d1485
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/864d1485
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/864d1485

Branch: refs/heads/4.2
Commit: 864d148573b58820e9182c1196d0d605a16945d1
Parents: 12a0137
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Wed Feb 12 16:07:34 2014 -0700
Committer: Marcus Sorensen <marcus@betterservers.com>
Committed: Wed Feb 12 16:10:27 2014 -0700

----------------------------------------------------------------------
 .../api/response/ResourceTagResponse.java       | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/864d1485/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 47b0625..8044376 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java
@@ -101,4 +101,34 @@ public class ResourceTagResponse extends BaseResponse implements ControlledViewE
     public void setCustomer(String customer) {
         this.customer = customer;
     }
+
+    public String getResourceId() {
+        return this.resourceId;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        String rId = this.getResourceId();
+        result = prime * result + ((rId== null) ? 0 : rId.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (this.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()))
+            return false;
+        return true;
+    }
 }


Mime
View raw message