Commit 7bb6bf6a authored by Phillip Webb's avatar Phillip Webb

Polish

parent 68293f34
...@@ -18,6 +18,8 @@ package org.springframework.boot.cli.compiler.grape; ...@@ -18,6 +18,8 @@ package org.springframework.boot.cli.compiler.grape;
import java.net.URI; import java.net.URI;
import org.springframework.util.ObjectUtils;
/** /**
* The configuration of a repository * The configuration of a repository
* *
...@@ -75,28 +77,22 @@ public final class RepositoryConfiguration { ...@@ -75,28 +77,22 @@ public final class RepositoryConfiguration {
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; return ObjectUtils.nullSafeHashCode(this.name);
int result = 1;
result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
return result;
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj) {
return true; return true;
if (obj == null) }
return false; if (obj == null) {
if (getClass() != obj.getClass())
return false; return false;
RepositoryConfiguration other = (RepositoryConfiguration) obj;
if (this.name == null) {
if (other.name != null)
return false;
} }
else if (!this.name.equals(other.name)) if (getClass() != obj.getClass()) {
return false; return false;
return true; }
RepositoryConfiguration other = (RepositoryConfiguration) obj;
return ObjectUtils.nullSafeEquals(this.name, other.name);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment