mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Refactor Guava functional methods to use lambdas
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177027488
This commit is contained in:
parent
2ae496bfce
commit
bbe2584da4
47 changed files with 478 additions and 647 deletions
|
@ -21,7 +21,6 @@ import static google.registry.util.CollectionUtils.isNullOrEmpty;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.Work;
|
||||
import com.googlecode.objectify.annotation.Entity;
|
||||
import com.googlecode.objectify.annotation.Id;
|
||||
import google.registry.model.BackupGroupRoot;
|
||||
|
@ -100,17 +99,15 @@ public class DomainApplicationIndex extends BackupGroupRoot {
|
|||
return ImmutableSet.of();
|
||||
}
|
||||
// Perform eventually consistent query, to avoid overenlisting cross entity groups
|
||||
return ofy().doTransactionless(new Work<ImmutableSet<DomainApplication>>() {
|
||||
@Override
|
||||
public ImmutableSet<DomainApplication> run() {
|
||||
ImmutableSet.Builder<DomainApplication> apps = new ImmutableSet.Builder<>();
|
||||
for (DomainApplication app : ofy().load().keys(index.getKeys()).values()) {
|
||||
if (app.getDeletionTime().isAfter(now)) {
|
||||
apps.add(app);
|
||||
}
|
||||
}
|
||||
return apps.build();
|
||||
}});
|
||||
return ofy().doTransactionless(() -> {
|
||||
ImmutableSet.Builder<DomainApplication> apps = new ImmutableSet.Builder<>();
|
||||
for (DomainApplication app : ofy().load().keys(index.getKeys()).values()) {
|
||||
if (app.getDeletionTime().isAfter(now)) {
|
||||
apps.add(app);
|
||||
}
|
||||
}
|
||||
return apps.build();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue