diff --git a/java/google/registry/model/registry/label/ReservedList.java b/java/google/registry/model/registry/label/ReservedList.java index 413f337ca..9c0764d96 100644 --- a/java/google/registry/model/registry/label/ReservedList.java +++ b/java/google/registry/model/registry/label/ReservedList.java @@ -16,7 +16,6 @@ package google.registry.model.registry.label; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; import static google.registry.model.common.EntityGroupRoot.getCrossTldKey; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.model.ofy.Ofy.RECOMMENDED_MEMCACHE_EXPIRATION; @@ -36,7 +35,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.net.InternetDomainName; import com.google.common.util.concurrent.UncheckedExecutionException; import com.googlecode.objectify.Key; -import com.googlecode.objectify.VoidWork; import com.googlecode.objectify.annotation.Cache; import com.googlecode.objectify.annotation.Embed; import com.googlecode.objectify.annotation.Entity; @@ -234,22 +232,6 @@ public final class ReservedList return ofy().load().type(ReservedList.class).parent(getCrossTldKey()).id(listName).now(); }}); - /** Deletes the ReservedList with the given name. */ - public static void delete(final String listName) { - final ReservedList reservedList = ReservedList.get(listName).orNull(); - checkState( - reservedList != null, - "Attempted to delete reserved list %s which doesn't exist", - listName); - ofy().transactNew(new VoidWork() { - @Override - public void vrun() { - ofy().delete().entity(reservedList).now(); - } - }); - cache.invalidate(listName); - } - /** * Gets the {@link ReservationType} of a label in a single ReservedList, or returns an absent * Optional if none exists in the list. diff --git a/javatests/google/registry/model/registry/label/ReservedListTest.java b/javatests/google/registry/model/registry/label/ReservedListTest.java index 0d7c09163..ba8738efc 100644 --- a/javatests/google/registry/model/registry/label/ReservedListTest.java +++ b/javatests/google/registry/model/registry/label/ReservedListTest.java @@ -232,14 +232,6 @@ public class ReservedListTest { assertThat(rl.isInUse()).isFalse(); } - @Test - public void testDelete() throws Exception { - persistReservedList("reserved", "trombone,FULLY_BLOCKED"); - assertThat(ReservedList.get("reserved")).isPresent(); - ReservedList.delete("reserved"); - assertThat(ReservedList.get("reserved")).isAbsent(); - } - @Test public void testSetFromInputLines() throws Exception { ReservedList reservedList = persistReservedList("reserved", "trombone,FULLY_BLOCKED"); @@ -263,12 +255,6 @@ public class ReservedListTest { assertThat(original.getReservedListEntries()).isEqualTo(clone.getReservedListEntries()); } - @Test - public void testDelete_failsWhenListDoesntExist() throws Exception { - thrown.expect(IllegalStateException.class); - ReservedList.delete("reserved"); - } - @Test public void testSave_badSyntax() throws Exception { thrown.expect(IllegalArgumentException.class, "Could not parse line in reserved list");