Skip to content

Commit

Permalink
[JENKINS-45323] Extra null safety (just to be sure to be sure)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenc committed Jul 5, 2017
1 parent c3fca9a commit 8ffb1c3
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -132,7 +132,7 @@ public synchronized boolean addEndpoint(@NonNull Endpoint endpoint) {
}
List<Endpoint> endpoints = new ArrayList<>(getEndpoints());
for (Endpoint ep : endpoints) {
if (ep.getApiUri().equals(endpoint.getApiUri())) {
if (StringUtils.equals(ep.getApiUri(), endpoint.getApiUri())) {
return false;
}
}
Expand All @@ -154,7 +154,7 @@ public synchronized void updateEndpoint(@NonNull Endpoint endpoint) {
boolean found = false;
for (int i = 0; i < endpoints.size(); i++) {
Endpoint ep = endpoints.get(i);
if (ep.getApiUri().equals(endpoint.getApiUri())) {
if (StringUtils.equals(ep.getApiUri(), endpoint.getApiUri())) {
endpoints.set(i, endpoint);
found = true;
break;
Expand Down Expand Up @@ -187,7 +187,7 @@ public synchronized boolean removeEndpoint(@CheckForNull String apiUri) {
boolean modified = false;
List<Endpoint> endpoints = new ArrayList<>(getEndpoints());
for (Iterator<Endpoint> iterator = endpoints.iterator(); iterator.hasNext(); ) {
if (apiUri.equals(iterator.next().getApiUri())) {
if (StringUtils.equals(apiUri, iterator.next().getApiUri())) {
iterator.remove();
modified = true;
}
Expand All @@ -206,7 +206,7 @@ public synchronized boolean removeEndpoint(@CheckForNull String apiUri) {
public synchronized Endpoint findEndpoint(@CheckForNull String apiUri) {
apiUri = normalizeApiUri(apiUri);
for (Endpoint endpoint : getEndpoints()) {
if (apiUri.equals(endpoint.getApiUri())) {
if (StringUtils.equals(apiUri, endpoint.getApiUri())) {
return endpoint;
}
}
Expand Down

0 comments on commit 8ffb1c3

Please sign in to comment.