Skip to content

Commit 433a2e4

Browse files
author
Marcus Sorensen
committed
CLOUDSTACK-6089: Use resource tag's key to determine match in
equals() method for ResourceTagResponse
1 parent 864d148 commit 433a2e4

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,16 @@ public void setCustomer(String customer) {
102102
this.customer = customer;
103103
}
104104

105-
public String getResourceId() {
106-
return this.resourceId;
105+
public String getKey() {
106+
return this.key;
107107
}
108108

109109
@Override
110110
public int hashCode() {
111111
final int prime = 31;
112112
int result = 1;
113-
String rId = this.getResourceId();
114-
result = prime * result + ((rId== null) ? 0 : rId.hashCode());
113+
String key = this.getKey();
114+
result = prime * result + ((key == null) ? 0 : key.hashCode());
115115
return result;
116116
}
117117

@@ -121,13 +121,14 @@ public boolean equals(Object obj) {
121121
return true;
122122
if (obj == null)
123123
return false;
124-
if (this.getClass() != obj.getClass())
124+
if (getClass() != obj.getClass())
125125
return false;
126126
ResourceTagResponse other = (ResourceTagResponse) obj;
127-
String rId = this.getResourceId();
128-
if (rId == null && other.getResourceId() != null) {
129-
return false;
130-
} else if (!rId.equals(other.getResourceId()))
127+
String key = this.getKey();
128+
if (key == null) {
129+
if (other.getKey() != null)
130+
return false;
131+
} else if (!key.equals(other.getKey()))
131132
return false;
132133
return true;
133134
}

0 commit comments

Comments
 (0)