Skip to content

Commit b77b55f

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

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,16 @@ public void setCustomer(String customer) {
110110
this.customer = customer;
111111
}
112112

113-
public String getResourceId() {
114-
return this.resourceId;
113+
public String getKey() {
114+
return this.key;
115115
}
116116

117117
@Override
118118
public int hashCode() {
119119
final int prime = 31;
120120
int result = 1;
121-
String rId = this.getResourceId();
122-
result = prime * result + ((rId== null) ? 0 : rId.hashCode());
121+
String key = this.getKey();
122+
result = prime * result + ((key == null) ? 0 : key.hashCode());
123123
return result;
124124
}
125125

@@ -129,13 +129,14 @@ public boolean equals(Object obj) {
129129
return true;
130130
if (obj == null)
131131
return false;
132-
if (this.getClass() != obj.getClass())
132+
if (getClass() != obj.getClass())
133133
return false;
134134
ResourceTagResponse other = (ResourceTagResponse) obj;
135-
String rId = this.getResourceId();
136-
if (rId == null && other.getResourceId() != null) {
137-
return false;
138-
} else if (!rId.equals(other.getResourceId()))
135+
String key = this.getKey();
136+
if (key == null) {
137+
if (other.getKey() != null)
138+
return false;
139+
} else if (!key.equals(other.getKey()))
139140
return false;
140141
return true;
141142
}

0 commit comments

Comments
 (0)