diff --git a/java/google/registry/batch/ExpandRecurringBillingEventsAction.java b/java/google/registry/batch/ExpandRecurringBillingEventsAction.java index 431f48d07..2c1775948 100644 --- a/java/google/registry/batch/ExpandRecurringBillingEventsAction.java +++ b/java/google/registry/batch/ExpandRecurringBillingEventsAction.java @@ -66,7 +66,7 @@ import org.joda.time.DateTime; *

The cursor used throughout this mapreduce (overridden if necessary using the parameter * {@code cursorTime}) represents the inclusive lower bound on the range of billing times that will * be expanded as a result of the job (the exclusive upper bound being the execution time of the - * job). + * job). */ @Action(path = "/_dr/task/expandRecurringBillingEvents") public class ExpandRecurringBillingEventsAction implements Runnable { @@ -101,7 +101,7 @@ public class ExpandRecurringBillingEventsAction implements Runnable { .runMapreduce( new ExpandRecurringBillingEventsMapper(isDryRun, cursorTime, clock.nowUtc()), new ExpandRecurringBillingEventsReducer(isDryRun, persistedCursorTime), - // Add an extra shard that maps over a null recurring event (see the mapper for why). + // Add an extra shard that maps over a null recurring event (see the mapper for why). ImmutableList.of( new NullInput(), createChildEntityInput( @@ -142,7 +142,7 @@ public class ExpandRecurringBillingEventsAction implements Runnable { @Override public Integer run() { ImmutableSet.Builder syntheticOneTimesBuilder = - ImmutableSet.builder(); + new ImmutableSet.Builder<>(); final Registry tld = Registry.get(getTldFromDomainName(recurring.getTargetId())); // Determine the complete set of times at which this recurring event should occur @@ -224,7 +224,7 @@ public class ExpandRecurringBillingEventsAction implements Runnable { .filter(Range.closedOpen(cursorTime, executeTime)) .toSet(); } - + /** * Determines an {@link ImmutableSet} of {@link DateTime}s that have already been persisted * for a given recurring billing event. @@ -252,7 +252,7 @@ public class ExpandRecurringBillingEventsAction implements Runnable { /** * "Reducer" to advance the cursor after all map jobs have been completed. The NullInput into the * mapper will cause the mapper to emit one timestamp pair (current cursor and execution time), - * and the cursor will be advanced (and the timestamps logged) at the end of a successful + * and the cursor will be advanced (and the timestamps logged) at the end of a successful * mapreduce. */ public static class ExpandRecurringBillingEventsReducer @@ -294,7 +294,7 @@ public class ExpandRecurringBillingEventsAction implements Runnable { } if (!isDryRun) { ofy().save().entity(Cursor.createGlobal(RECURRING_BILLING, executionTime)); - } + } } }); } diff --git a/java/google/registry/flows/domain/DomainAllocateFlow.java b/java/google/registry/flows/domain/DomainAllocateFlow.java index 4ca285af7..e8a97142d 100644 --- a/java/google/registry/flows/domain/DomainAllocateFlow.java +++ b/java/google/registry/flows/domain/DomainAllocateFlow.java @@ -88,7 +88,7 @@ public class DomainAllocateFlow extends DomainCreateOrAllocateFlow { protected final void setDomainCreateOrAllocateProperties(Builder builder) { boolean sunrushAddGracePeriod = isNullOrEmpty(command.getNameservers()); Registry registry = Registry.get(getTld()); - ImmutableSet.Builder billingFlagsBuilder = ImmutableSet.builder(); + ImmutableSet.Builder billingFlagsBuilder = new ImmutableSet.Builder<>(); if (!application.getEncodedSignedMarks().isEmpty()) { billingFlagsBuilder.add(Flag.SUNRISE); } else { diff --git a/java/google/registry/mapreduce/inputs/ChildEntityReader.java b/java/google/registry/mapreduce/inputs/ChildEntityReader.java index b80c678b3..9f05c8c39 100644 --- a/java/google/registry/mapreduce/inputs/ChildEntityReader.java +++ b/java/google/registry/mapreduce/inputs/ChildEntityReader.java @@ -71,7 +71,7 @@ class ChildEntityReader extend @SuppressWarnings("unchecked") private ImmutableList> expandPolymorphicClasses( ImmutableSet> resourceClasses) { - ImmutableList.Builder> builder = ImmutableList.builder(); + ImmutableList.Builder> builder = new ImmutableList.Builder<>(); for (Class clazz : resourceClasses) { if (clazz.isAnnotationPresent(Entity.class)) { builder.add(clazz); diff --git a/java/google/registry/monitoring/metrics/VirtualMetric.java b/java/google/registry/monitoring/metrics/VirtualMetric.java index 686548753..5010fb195 100644 --- a/java/google/registry/monitoring/metrics/VirtualMetric.java +++ b/java/google/registry/monitoring/metrics/VirtualMetric.java @@ -79,7 +79,7 @@ public final class VirtualMetric extends AbstractMetric { ImmutableList> getTimestampedValues(Instant timestamp) { ImmutableMap, V> values = valuesSupplier.get(); - ImmutableList.Builder> metricPoints = ImmutableList.builder(); + ImmutableList.Builder> metricPoints = new ImmutableList.Builder<>(); for (Entry, V> entry : values.entrySet()) { metricPoints.add( MetricPoint.create(this, entry.getKey(), timestamp, timestamp, entry.getValue())); diff --git a/java/google/registry/monitoring/whitebox/EppMetric.java b/java/google/registry/monitoring/whitebox/EppMetric.java index a4e80df7f..17eb84f90 100644 --- a/java/google/registry/monitoring/whitebox/EppMetric.java +++ b/java/google/registry/monitoring/whitebox/EppMetric.java @@ -79,7 +79,7 @@ public abstract class EppMetric implements BigQueryMetric { public ImmutableMap getBigQueryRowEncoding() { // Create map builder, start with required values ImmutableMap.Builder map = - ImmutableMap.builder() + new ImmutableMap.Builder() .put("requestId", getRequestId()) .put("startTime", toBigqueryTimestamp(getStartTimestamp())) .put("endTime", toBigqueryTimestamp(getEndTimestamp())) diff --git a/java/google/registry/tmch/LordnLog.java b/java/google/registry/tmch/LordnLog.java index 3543c6a9d..5150107af 100644 --- a/java/google/registry/tmch/LordnLog.java +++ b/java/google/registry/tmch/LordnLog.java @@ -88,7 +88,7 @@ public final class LordnLog implements Iterable> } } - private static final Map RESULTS = ImmutableMap.builder() + private static final Map RESULTS = new ImmutableMap.Builder() .put(2000, new Result(2000, "OK")) .put(2001, new Result(2001, "OK but not processed")) .put(3601, new Result(3601, "TCN Acceptance Date after Registration Date")) diff --git a/java/google/registry/tools/EppToolCommand.java b/java/google/registry/tools/EppToolCommand.java index ef8de4828..c7b2fe7c2 100644 --- a/java/google/registry/tools/EppToolCommand.java +++ b/java/google/registry/tools/EppToolCommand.java @@ -81,7 +81,7 @@ abstract class EppToolCommand extends ConfirmingCommand implements ServerSideCom * EPP calls when invoking commands (i.e. domain check) with sets of domains across multiple TLDs. */ protected static Multimap validateAndGroupDomainNamesByTld(List names) { - ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); + ImmutableMultimap.Builder builder = new ImmutableMultimap.Builder<>(); for (String name : names) { InternetDomainName tld = findTldForNameOrThrow(InternetDomainName.from(name)); builder.put(tld.toString(), name); diff --git a/java/google/registry/tools/GetLrpTokenCommand.java b/java/google/registry/tools/GetLrpTokenCommand.java index d4acfbbb2..13d51bd40 100644 --- a/java/google/registry/tools/GetLrpTokenCommand.java +++ b/java/google/registry/tools/GetLrpTokenCommand.java @@ -45,13 +45,13 @@ public final class GetLrpTokenCommand implements RemoteApiCommand { names = {"-h", "--history"}, description = "Return expanded history entry (including domain application)") private boolean includeHistory = false; - + @Override public void run() throws Exception { checkArgument( (tokenString == null) == (assignee != null), "Exactly one of either token or assignee must be specified."); - ImmutableSet.Builder tokensBuilder = ImmutableSet.builder(); + ImmutableSet.Builder tokensBuilder = new ImmutableSet.Builder<>(); if (tokenString != null) { LrpToken token = ofy().load().key(Key.create(LrpToken.class, tokenString)).now(); if (token != null) { @@ -69,7 +69,7 @@ public final class GetLrpTokenCommand implements RemoteApiCommand { System.out.println( ofy().load().key(token.getRedemptionHistoryEntry()).now().toHydratedString()); } - } + } } else { System.out.println("Token not found."); } diff --git a/java/google/registry/tools/ListObjectsCommand.java b/java/google/registry/tools/ListObjectsCommand.java index aabe07a41..d525a8234 100644 --- a/java/google/registry/tools/ListObjectsCommand.java +++ b/java/google/registry/tools/ListObjectsCommand.java @@ -74,7 +74,7 @@ abstract class ListObjectsCommand implements RemoteApiCommand, ServerSideCommand @Override public void run() throws Exception { - ImmutableMap.Builder params = ImmutableMap.builder(); + ImmutableMap.Builder params = new ImmutableMap.Builder<>(); if (fields != null) { params.put(FIELDS_PARAM, fields); } diff --git a/java/google/registry/tools/server/ListObjectsAction.java b/java/google/registry/tools/server/ListObjectsAction.java index b0beb5ce2..9c4d3e099 100644 --- a/java/google/registry/tools/server/ListObjectsAction.java +++ b/java/google/registry/tools/server/ListObjectsAction.java @@ -177,7 +177,7 @@ public abstract class ListObjectsAction implements Ru */ private ImmutableTable extractData(ImmutableSet fields, ImmutableSet objects) { - ImmutableTable.Builder builder = ImmutableTable.builder(); + ImmutableTable.Builder builder = new ImmutableTable.Builder<>(); for (T object : objects) { Map fieldMap = new HashMap<>(); // Base case of the mapping is to use ImmutableObject's toDiffableFieldMap(). diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java index a33814c01..2fda88e73 100644 --- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java @@ -213,8 +213,8 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase billingEvents = ImmutableSet.of( - createBillingEvent, renewBillingEvent); + ImmutableSet.Builder expectedBillingEvents = + new ImmutableSet.Builder().add(createBillingEvent).add(renewBillingEvent); // If EAP is applied, a billing event for EAP should be present. if (!eapFee.isZero()) { @@ -229,12 +229,9 @@ public class DomainCreateFlowTest extends ResourceFlowTestCasebuilder() - .addAll(billingEvents) - .add(eapBillingEvent) - .build(); + expectedBillingEvents.add(eapBillingEvent); } - assertBillingEvents(billingEvents); + assertBillingEvents(expectedBillingEvents.build()); assertGracePeriods( domain.getGracePeriods(), diff --git a/javatests/google/registry/model/index/EppResourceIndexTest.java b/javatests/google/registry/model/index/EppResourceIndexTest.java index 12c379063..1e6695827 100644 --- a/javatests/google/registry/model/index/EppResourceIndexTest.java +++ b/javatests/google/registry/model/index/EppResourceIndexTest.java @@ -64,7 +64,7 @@ public class EppResourceIndexTest extends EntityTestCase { */ private ImmutableList getEppResourceIndexObjects() { int numBuckets = RegistryEnvironment.get().config().getEppResourceIndexBucketCount(); - ImmutableList.Builder indexEntities = ImmutableList.builder(); + ImmutableList.Builder indexEntities = new ImmutableList.Builder<>(); for (int i = 0; i < numBuckets; i++) { indexEntities.addAll(ofy().load() .type(EppResourceIndex.class) diff --git a/javatests/google/registry/rdap/RdapActionBaseTest.java b/javatests/google/registry/rdap/RdapActionBaseTest.java index 5a9508863..8f30144ce 100644 --- a/javatests/google/registry/rdap/RdapActionBaseTest.java +++ b/javatests/google/registry/rdap/RdapActionBaseTest.java @@ -78,7 +78,7 @@ public class RdapActionBaseTest { if (pathSearchString.equals("RuntimeException")) { throw new RuntimeException(); } - ImmutableMap.Builder builder = ImmutableMap.builder(); + ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); RdapJsonFormatter.addTopLevelEntries( builder, diff --git a/javatests/google/registry/rdap/RdapJsonFormatterTest.java b/javatests/google/registry/rdap/RdapJsonFormatterTest.java index 88263d915..1fb25c5e4 100644 --- a/javatests/google/registry/rdap/RdapJsonFormatterTest.java +++ b/javatests/google/registry/rdap/RdapJsonFormatterTest.java @@ -468,7 +468,7 @@ public class RdapJsonFormatterTest { @Test public void testTopLevel() throws Exception { - ImmutableMap.Builder builder = ImmutableMap.builder(); + ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); RdapJsonFormatter.addTopLevelEntries( builder, @@ -481,7 +481,7 @@ public class RdapJsonFormatterTest { @Test public void testTopLevel_withTermsOfService() throws Exception { - ImmutableMap.Builder builder = ImmutableMap.builder(); + ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); RdapJsonFormatter.addTopLevelEntries( builder, @@ -494,7 +494,7 @@ public class RdapJsonFormatterTest { @Test public void testTopLevel_domain() throws Exception { - ImmutableMap.Builder builder = ImmutableMap.builder(); + ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); RdapJsonFormatter.addTopLevelEntries( builder, @@ -507,7 +507,7 @@ public class RdapJsonFormatterTest { @Test public void testTopLevel_domainWithTermsOfService() throws Exception { - ImmutableMap.Builder builder = ImmutableMap.builder(); + ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); builder.put("key", "value"); RdapJsonFormatter.addTopLevelEntries( builder, diff --git a/javatests/google/registry/testing/TaskQueueHelper.java b/javatests/google/registry/testing/TaskQueueHelper.java index dca97e278..881d1f997 100644 --- a/javatests/google/registry/testing/TaskQueueHelper.java +++ b/javatests/google/registry/testing/TaskQueueHelper.java @@ -308,7 +308,7 @@ public class TaskQueueHelper { if (info.getTagAsBytes() != null) { this.tag = new String(info.getTagAsBytes(), UTF_8); } - ImmutableMultimap.Builder headerBuilder = ImmutableMultimap.builder(); + ImmutableMultimap.Builder headerBuilder = new ImmutableMultimap.Builder<>(); for (HeaderWrapper header : info.getHeaders()) { // Lowercase header name for comparison since HTTP // header names are case-insensitive. diff --git a/javatests/google/registry/tools/ListObjectsCommandTestCase.java b/javatests/google/registry/tools/ListObjectsCommandTestCase.java index bd8f851f3..b309fbe92 100644 --- a/javatests/google/registry/tools/ListObjectsCommandTestCase.java +++ b/javatests/google/registry/tools/ListObjectsCommandTestCase.java @@ -79,7 +79,7 @@ public abstract class ListObjectsCommandTestCase Optional printHeaderRow, Optional fullFieldNames) throws Exception { - ImmutableMap.Builder params = ImmutableMap.builder(); + ImmutableMap.Builder params = new ImmutableMap.Builder<>(); if (fields != null) { params.put(FIELDS_PARAM, fields); }