Migrate away from VoidWorks

This is one last hanging piece of work left over from last year's Java 8
migration. There's no functionality changes in this CL, just refactoring.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201947600
This commit is contained in:
mcilwain 2018-06-25 07:04:26 -07:00 committed by Ben McIlwain
parent 7d3cb3d426
commit d3364b0387
18 changed files with 349 additions and 502 deletions

View file

@ -19,7 +19,6 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.googlecode.objectify.VoidWork;
import google.registry.model.domain.DomainResource;
import google.registry.model.registrar.Registrar;
import google.registry.model.registry.Registry;
@ -78,11 +77,7 @@ final class DeleteTldCommand extends ConfirmingCommand implements RemoteApiComma
@Override
protected String execute() {
ofy().transactNew(new VoidWork() {
@Override
public void vrun() {
ofy().delete().entity(registry).now();
}});
ofy().transactNew(() -> ofy().delete().entity(registry).now());
registry.invalidateInCache();
return String.format("Deleted TLD '%s'.\n", tld);
}