From 7986be139d7accfbd464ebb66f473131c0006d2d Mon Sep 17 00:00:00 2001 From: nickfelt Date: Mon, 6 Feb 2017 15:04:29 -0800 Subject: [PATCH] Add @Deprecated to DomainApplication.cloneProjectedAtTime() DomainApplications have nothing to project, so it's a mistake to call their cloneProjectedAtTime() method. Marking it @Deprecated helps prevent such inadvertent use. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146716189 --- java/google/registry/model/domain/DomainApplication.java | 2 ++ .../google/registry/model/index/DomainApplicationIndex.java | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/java/google/registry/model/domain/DomainApplication.java b/java/google/registry/model/domain/DomainApplication.java index d3ce8e8db..287c95695 100644 --- a/java/google/registry/model/domain/DomainApplication.java +++ b/java/google/registry/model/domain/DomainApplication.java @@ -169,6 +169,8 @@ public class DomainApplication extends DomainBase { return getRepoId(); } + /** This is a no-op and should never be called on an application explicitly. */ + @Deprecated @Override public DomainApplication cloneProjectedAtTime(DateTime now) { // Applications have no grace periods and can't be transferred, so there is nothing to project. diff --git a/java/google/registry/model/index/DomainApplicationIndex.java b/java/google/registry/model/index/DomainApplicationIndex.java index 9e21051aa..11325664d 100644 --- a/java/google/registry/model/index/DomainApplicationIndex.java +++ b/java/google/registry/model/index/DomainApplicationIndex.java @@ -19,7 +19,6 @@ import static com.google.common.base.Strings.isNullOrEmpty; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.model.ofy.Ofy.RECOMMENDED_MEMCACHE_EXPIRATION; import static google.registry.util.CollectionUtils.isNullOrEmpty; -import static google.registry.util.DateTimeUtils.latestOf; import com.google.common.collect.ImmutableSet; import com.googlecode.objectify.Key; @@ -95,9 +94,8 @@ public class DomainApplicationIndex extends BackupGroupRoot { } ImmutableSet.Builder apps = new ImmutableSet.Builder<>(); for (DomainApplication app : ofy().load().keys(index.getKeys()).values()) { - DateTime forwardedNow = latestOf(now, app.getUpdateAutoTimestamp().getTimestamp()); - if (app.getDeletionTime().isAfter(forwardedNow)) { - apps.add(app.cloneProjectedAtTime(forwardedNow)); + if (app.getDeletionTime().isAfter(now)) { + apps.add(app); } } return apps.build();