diff --git a/core/src/main/java/google/registry/model/ImmutableObject.java b/core/src/main/java/google/registry/model/ImmutableObject.java index 4efe5ef53..224e242a5 100644 --- a/core/src/main/java/google/registry/model/ImmutableObject.java +++ b/core/src/main/java/google/registry/model/ImmutableObject.java @@ -51,15 +51,6 @@ public abstract class ImmutableObject implements Cloneable { @Target(FIELD) public @interface DoNotHydrate {} - /** - * Indicates that the field stores a null value to indicate an empty set. This is also used in - * object comparison. - */ - @Documented - @Retention(RUNTIME) - @Target(FIELD) - public @interface EmptySetToNull {} - /** * Indicates that the field does not take part in the immutability contract. * diff --git a/core/src/main/java/google/registry/model/domain/DomainBase.java b/core/src/main/java/google/registry/model/domain/DomainBase.java index ef2ba1a41..961a5c3a1 100644 --- a/core/src/main/java/google/registry/model/domain/DomainBase.java +++ b/core/src/main/java/google/registry/model/domain/DomainBase.java @@ -124,7 +124,7 @@ public class DomainBase extends EppResource String tld; /** References to hosts that are the nameservers for the domain. */ - @EmptySetToNull @Transient Set> nsHosts; + @Transient Set> nsHosts; /** Contacts. */ VKey adminContact; diff --git a/core/src/main/java/google/registry/model/domain/DomainHistory.java b/core/src/main/java/google/registry/model/domain/DomainHistory.java index a3c3141cb..182a2b7f2 100644 --- a/core/src/main/java/google/registry/model/domain/DomainHistory.java +++ b/core/src/main/java/google/registry/model/domain/DomainHistory.java @@ -96,7 +96,6 @@ public class DomainHistory extends HistoryEntry { columnList = "domain_history_history_revision_id,domain_history_domain_repo_id,host_repo_id", unique = true)) - @EmptySetToNull @Column(name = "host_repo_id") Set> nsHosts; @@ -160,7 +159,6 @@ public class DomainHistory extends HistoryEntry { @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) @JoinColumn(name = "historyRevisionId", referencedColumnName = "historyRevisionId") @JoinColumn(name = "domainRepoId", referencedColumnName = "domainRepoId") - @EmptySetToNull Set domainTransactionRecords; public Set getDomainTransactionRecords() { diff --git a/util/src/main/java/google/registry/util/CollectionUtils.java b/util/src/main/java/google/registry/util/CollectionUtils.java index 68bcfd6b1..2fdc9a70e 100644 --- a/util/src/main/java/google/registry/util/CollectionUtils.java +++ b/util/src/main/java/google/registry/util/CollectionUtils.java @@ -120,8 +120,8 @@ public class CollectionUtils { * Turns an empty collection into a null collection. * *

This is unwise in the general case (nulls are bad; empties are good) but occasionally needed - * to cause JAXB not to emit a field, or to avoid saving something to Datastore. The method name - * includes "force" to indicate that you should think twice before using it. + * to cause JAXB not to emit a field. The method name includes "force" to indicate that you should + * think twice before using it. */ @Nullable public static > C forceEmptyToNull(@Nullable C potentiallyEmpty) {