Skip to content
Permalink
Browse files
[JENKINS-45323] Extra null safety (just to be sure to be sure)
  • Loading branch information
stephenc committed Jul 5, 2017
1 parent c3fca9a commit 8ffb1c3d098595e5ae14b51978a3bd0ad55aae61
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubConfiguration.java
@@ -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;
}
}
@@ -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;
@@ -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;
}
@@ -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;
}
}

0 comments on commit 8ffb1c3

Please sign in to comment.