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

@ -21,7 +21,6 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.google.common.net.InternetDomainName;
import com.googlecode.objectify.VoidWork;
import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.launch.LaunchNotice.InvalidChecksumException;
@ -67,15 +66,15 @@ final class UpdateClaimsNoticeCommand implements RemoteApiCommand {
final LaunchNotice launchNotice = LaunchNotice.create(
tcnId, validatorId, DateTime.parse(expirationTime), DateTime.parse(acceptedTime));
ofy().transact(new VoidWork() {
@Override
public void vrun() {
try {
updateClaimsNotice(id, launchNotice);
} catch (InvalidChecksumException e) {
throw new RuntimeException(e);
}
}});
ofy()
.transact(
() -> {
try {
updateClaimsNotice(id, launchNotice);
} catch (InvalidChecksumException e) {
throw new RuntimeException(e);
}
});
}
private void updateClaimsNotice(String applicationId, LaunchNotice launchNotice)