Replace many Work and VoidWork usages with lambdas

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176153460
This commit is contained in:
mcilwain 2017-11-17 13:38:53 -08:00 committed by jianglai
parent 603e0470cc
commit cd314bdc75
36 changed files with 443 additions and 680 deletions

View file

@ -20,7 +20,6 @@ import static google.registry.util.PipelineUtils.createJobPath;
import com.google.appengine.tools.mapreduce.Mapper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.googlecode.objectify.VoidWork;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.mapreduce.inputs.EppResourceInputs;
import google.registry.model.EppResource;
@ -70,11 +69,7 @@ public class ResaveAllHistoryEntriesAction implements Runnable {
@Override
public final void map(final HistoryEntry historyEntry) {
ofy().transact(new VoidWork() {
@Override
public void vrun() {
ofy().save().entity(ofy().load().entity(historyEntry).now()).now();
}});
ofy().transact(() -> ofy().save().entity(ofy().load().entity(historyEntry).now()).now());
getContext().incrementCounter(
String.format(
"HistoryEntries parented under %s re-saved", historyEntry.getParent().getKind()));