Use equals() method to compare equality (#2158)

It will call equalsImmutableObject(), which seems the right thing to do.
We only care if the two Tld objects have the same fields, not if they
are the same object. ErrorProne complained about comparison by identity.
This commit is contained in:
Lai Jiang 2023-09-28 13:27:36 -04:00 committed by GitHub
parent 0801679173
commit cb240a8f03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,7 +130,7 @@ public class Tld extends ImmutableObject implements Buildable, UnsafeSerializabl
public static final Money DEFAULT_REGISTRY_LOCK_OR_UNLOCK_BILLING_COST = Money.of(USD, 0);
public boolean equalYaml(Tld tldToCompare) {
if (this == tldToCompare) {
if (this.equals(tldToCompare)) {
return true;
}
ObjectMapper mapper = createObjectMapper();