Skip to content

Commit 4957e89

Browse files
committed
Regenerated equals/hashCode
1 parent dc74cf9 commit 4957e89

File tree

1 file changed

+18
-11
lines changed
  • jenkins-client/src/main/java/com/offbytwo/jenkins/model

1 file changed

+18
-11
lines changed

jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,33 @@ private void stopPost() throws HttpResponseException, IOException {
107107
}
108108

109109
@Override
110-
public boolean equals(Object o) {
111-
if (this == o)
110+
public boolean equals(Object obj) {
111+
if (this == obj)
112112
return true;
113-
if (o == null || getClass() != o.getClass())
113+
if (obj == null)
114114
return false;
115-
116-
Build build = (Build) o;
117-
118-
if (number != build.number)
115+
if (getClass() != obj.getClass())
119116
return false;
120-
if (url != null ? !url.equals(build.url) : build.url != null)
117+
Build other = (Build) obj;
118+
if (number != other.number)
119+
return false;
120+
if (queueId != other.queueId)
121+
return false;
122+
if (url == null) {
123+
if (other.url != null)
124+
return false;
125+
} else if (!url.equals(other.url))
121126
return false;
122-
123127
return true;
124128
}
125129

126130
@Override
127131
public int hashCode() {
128-
int result = number;
129-
result = 31 * result + (url != null ? url.hashCode() : 0);
132+
final int prime = 31;
133+
int result = 1;
134+
result = prime * result + number;
135+
result = prime * result + queueId;
136+
result = prime * result + ((url == null) ? 0 : url.hashCode());
130137
return result;
131138
}
132139
}

0 commit comments

Comments
 (0)