From 2aa897e698b162e013045cc6a639abe5054d41b4 Mon Sep 17 00:00:00 2001 From: mcilwain Date: Thu, 9 Nov 2017 07:33:40 -0800 Subject: [PATCH] Remove unnecessary generic type arguments ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=175155365 --- java/google/registry/backup/BackupUtils.java | 2 +- .../ExpandRecurringBillingEventsAction.java | 3 +- .../batch/MapreduceEntityCleanupAction.java | 2 +- .../batch/MapreduceEntityCleanupUtil.java | 6 +-- .../batch/VerifyEntityIntegrityAction.java | 6 +-- .../google/registry/cron/TldFanoutAction.java | 6 +-- .../dns/writer/clouddns/CloudDnsWriter.java | 4 +- .../dns/writer/dnsupdate/DnsUpdateWriter.java | 2 +- .../export/PublishDetailReportAction.java | 2 +- .../export/SyncGroupMembersAction.java | 2 +- .../google/registry/flows/CheckApiAction.java | 4 +- java/google/registry/flows/FlowReporter.java | 2 +- .../registry/flows/ResourceFlowUtils.java | 2 +- .../contact/ContactTransferRequestFlow.java | 2 +- .../registry/flows/custom/EntityChanges.java | 4 +- .../flows/domain/DomainAllocateFlow.java | 4 +- .../flows/domain/DomainCheckFlow.java | 2 +- .../flows/domain/DomainCreateFlow.java | 7 ++- .../flows/domain/DomainFlowUtils.java | 6 +-- .../flows/domain/DomainPricingLogic.java | 2 +- .../flows/domain/DomainRenewFlow.java | 5 +- .../domain/DomainRestoreRequestFlow.java | 2 +- .../domain/DomainTransferApproveFlow.java | 4 +- .../domain/DomainTransferRequestFlow.java | 7 ++- .../registry/flows/picker/FlowPicker.java | 4 +- .../registry/mapreduce/MapreduceRunner.java | 4 +- .../mapreduce/inputs/ChildEntityInput.java | 4 +- .../inputs/EppResourceBaseReader.java | 2 +- .../inputs/EppResourceEntityInput.java | 2 +- .../inputs/EppResourceIndexReader.java | 2 +- .../mapreduce/inputs/EppResourceKeyInput.java | 2 +- java/google/registry/model/EntityClasses.java | 2 +- .../registry/model/EppResourceUtils.java | 2 +- .../model/billing/RegistrarCreditBalance.java | 2 +- .../model/common/TimedTransitionProperty.java | 2 +- .../registry/model/domain/DomainResource.java | 2 +- .../registry/model/eppinput/EppInput.java | 2 +- .../model/index/DomainApplicationIndex.java | 2 +- .../registry/model/index/ForeignKeyIndex.java | 4 +- .../registry/model/ofy/AugmentedDeleter.java | 4 +- .../registry/model/ofy/TransactionInfo.java | 2 +- .../registry/model/poll/PollMessage.java | 7 +-- .../poll/PollMessageExternalKeyConverter.java | 2 +- .../StaticPremiumListPricingEngine.java | 2 +- .../registry/label/BaseDomainLabelList.java | 2 +- .../registry/label/PremiumListUtils.java | 8 +-- .../monitoring/metrics/MetricMetrics.java | 2 +- .../monitoring/metrics/MetricReporter.java | 2 +- .../stackdriver/StackdriverWriter.java | 2 +- .../monitoring/whitebox/EppMetric.java | 2 +- .../whitebox/MetricsExportAction.java | 2 +- .../registry/rdap/RdapAuthorization.java | 4 +- .../registry/rdap/RdapDomainSearchAction.java | 4 +- .../registry/rdap/RdapEntityAction.java | 3 +- .../registry/rdap/RdapEntitySearchAction.java | 11 ++-- java/google/registry/rdap/RdapHelpAction.java | 2 +- .../rdap/RdapIcannStandardInformation.java | 16 +++--- .../registry/rdap/RdapJsonFormatter.java | 16 +++--- .../rdap/RdapNameserverSearchAction.java | 2 +- .../registry/rdap/RdapSearchResults.java | 2 +- .../registry/rde/imports/RdeImportUtils.java | 2 +- .../imports/XjcToDomainResourceConverter.java | 2 +- java/google/registry/request/Modules.java | 2 +- .../registry/request/RequestParameters.java | 10 ++-- .../registry/request/auth/AuthModule.java | 2 +- .../registry/request/auth/AuthResult.java | 2 +- .../registry/request/auth/UserAuthInfo.java | 2 +- .../registry/security/JsonResponseHelper.java | 6 +-- .../registry/tldconfig/idn/IdnTable.java | 2 +- .../idn/JapaneseLanguageValidator.java | 6 +-- .../tldconfig/idn/LanguageValidator.java | 2 +- java/google/registry/tmch/TmchCrlAction.java | 2 +- .../registry/tools/AppEngineConnection.java | 2 +- .../registry/tools/CreateTldCommand.java | 2 +- .../tools/GenerateAuctionDataCommand.java | 4 +- .../registry/tools/GetSchemaTreeCommand.java | 2 +- .../registry/tools/ListDomainsCommand.java | 2 +- .../tools/RegistryToolEnvironment.java | 2 +- .../registry/tools/SetupOteCommand.java | 8 +-- .../registry/tools/UpdateTldCommand.java | 2 +- .../registry/tools/params/EnumParameter.java | 2 +- .../tools/server/GenerateZoneFilesAction.java | 2 +- .../tools/server/ListObjectsAction.java | 2 +- .../server/ResaveAllHistoryEntriesAction.java | 4 +- .../tools/server/ToolsServerModule.java | 4 +- .../tools/server/VerifyOteAction.java | 6 +-- java/google/registry/ui/forms/FormField.java | 2 +- .../registrar/RegistrarSettingsAction.java | 3 +- .../google/registry/util/CollectionUtils.java | 10 ++-- java/google/registry/util/SqlTemplate.java | 2 +- java/google/registry/util/X509Utils.java | 3 +- .../registry/whois/DomainLookupCommand.java | 2 +- .../whois/NameserverLookupByHostCommand.java | 2 +- java/google/registry/xml/XmlTransformer.java | 2 +- .../batch/DeleteProberDataActionTest.java | 4 +- .../MapreduceEntityCleanupActionTest.java | 50 +++++++++---------- .../registry/cron/TldFanoutActionTest.java | 2 +- .../dns/PublishDnsUpdatesActionTest.java | 4 +- .../writer/clouddns/CloudDnsWriterTest.java | 17 +++---- .../DomainApplicationCreateFlowTest.java | 11 +--- .../DomainApplicationDeleteFlowTest.java | 17 ++----- .../DomainApplicationUpdateFlowTest.java | 15 ++---- .../flows/domain/DomainCheckFlowTest.java | 14 ++---- .../domain/DomainClaimsCheckFlowTest.java | 15 ++---- .../flows/domain/DomainCreateFlowTest.java | 8 +-- .../flows/domain/DomainDeleteFlowTest.java | 37 ++++++-------- .../flows/domain/DomainRenewFlowTest.java | 13 ++--- .../domain/DomainRestoreRequestFlowTest.java | 11 +--- .../domain/DomainTransferApproveFlowTest.java | 13 ++--- .../domain/DomainTransferCancelFlowTest.java | 15 ++---- .../domain/DomainTransferRejectFlowTest.java | 15 ++---- .../domain/DomainTransferRequestFlowTest.java | 34 +++++-------- .../flows/domain/DomainUpdateFlowTest.java | 13 ++--- .../flows/session/LoginFlowViaTlsTest.java | 2 +- .../registry/rdap/RdapActionBaseTest.java | 4 +- .../registry/rdap/RdapEntityActionTest.java | 4 +- .../registry/rdap/RdapJsonFormatterTest.java | 16 +++--- .../rdap/RdapNameserverActionTest.java | 14 +++--- .../google/registry/rdap/RdapTestHelper.java | 16 +++--- .../rde/DomainResourceToXjcConverterTest.java | 3 +- .../google/registry/rde/RdeFixtures.java | 3 +- .../registry/rde/RdeStagingActionTest.java | 14 +++--- .../imports/RdeContactImportActionTest.java | 2 +- .../rde/imports/RdeContactInputTest.java | 26 +++++----- .../imports/RdeDomainImportActionTest.java | 2 +- .../rde/imports/RdeHostImportActionTest.java | 2 +- .../rde/imports/RdeHostInputTest.java | 26 +++++----- .../rde/imports/RdeHostLinkActionTest.java | 2 +- .../google/registry/tmch/LordnLogTest.java | 2 +- .../google/registry/tmch/LordnTaskTest.java | 4 +- .../registry/ui/forms/FormFieldTest.java | 9 ++-- .../server/registrar/ContactSettingsTest.java | 2 +- .../RegistrarPaymentSetupActionTest.java | 4 +- .../RegistrarSettingsActionTest.java | 4 +- .../RegistrarSettingsActionTestCase.java | 2 +- .../registry/util/DateTimeUtilsTest.java | 4 +- .../util/RequestStatusCheckerImplTest.java | 2 +- .../registry/util/TeeOutputStreamTest.java | 2 +- .../google/registry/util/TypeUtilsTest.java | 6 +-- .../google/registry/xml/XmlTestUtils.java | 2 +- 140 files changed, 355 insertions(+), 465 deletions(-) diff --git a/java/google/registry/backup/BackupUtils.java b/java/google/registry/backup/BackupUtils.java index 3bf042720..398154cf9 100644 --- a/java/google/registry/backup/BackupUtils.java +++ b/java/google/registry/backup/BackupUtils.java @@ -62,7 +62,7 @@ public class BackupUtils { protected ImmutableObject computeNext() { EntityProto proto = new EntityProto(); if (proto.parseDelimitedFrom(input)) { // False means end of stream; other errors throw. - return ofy().load().fromEntity(EntityTranslator.createFromPb(proto)); + return ofy().load().fromEntity(EntityTranslator.createFromPb(proto)); } return endOfData(); }}; diff --git a/java/google/registry/batch/ExpandRecurringBillingEventsAction.java b/java/google/registry/batch/ExpandRecurringBillingEventsAction.java index 31dd01300..05be3a677 100644 --- a/java/google/registry/batch/ExpandRecurringBillingEventsAction.java +++ b/java/google/registry/batch/ExpandRecurringBillingEventsAction.java @@ -115,8 +115,7 @@ public class ExpandRecurringBillingEventsAction implements Runnable { ImmutableList.of( new NullInput<>(), createChildEntityInput( - ImmutableSet.>of(DomainResource.class), - ImmutableSet.>of(Recurring.class)))))); + ImmutableSet.of(DomainResource.class), ImmutableSet.of(Recurring.class)))))); } /** Mapper to expand {@link Recurring} billing events into synthetic {@link OneTime} events. */ diff --git a/java/google/registry/batch/MapreduceEntityCleanupAction.java b/java/google/registry/batch/MapreduceEntityCleanupAction.java index c22b27807..2b8515dee 100644 --- a/java/google/registry/batch/MapreduceEntityCleanupAction.java +++ b/java/google/registry/batch/MapreduceEntityCleanupAction.java @@ -211,7 +211,7 @@ public class MapreduceEntityCleanupAction implements Runnable { private String requestDeletion(Set actualJobIds, boolean verbose) { Optional payloadChunkBuilder = - verbose ? Optional.of(new StringBuilder()) : Optional.empty(); + verbose ? Optional.of(new StringBuilder()) : Optional.empty(); int errorCount = 0; for (String actualJobId : actualJobIds) { Optional error = diff --git a/java/google/registry/batch/MapreduceEntityCleanupUtil.java b/java/google/registry/batch/MapreduceEntityCleanupUtil.java index 523bdc313..6c003e241 100644 --- a/java/google/registry/batch/MapreduceEntityCleanupUtil.java +++ b/java/google/registry/batch/MapreduceEntityCleanupUtil.java @@ -92,7 +92,7 @@ class MapreduceEntityCleanupUtil { boolean ignoreState, Optional cursor) { if (maxJobs.isPresent() && (maxJobs.get() <= 0)) { - return EligibleJobResults.create(ImmutableSet.of(), Optional.empty()); + return EligibleJobResults.create(ImmutableSet.of(), Optional.empty()); } Set eligibleJobs = new HashSet<>(); Pair, String> pair = @@ -185,7 +185,7 @@ class MapreduceEntityCleanupUtil { private ImmutableSet getPossibleIdsForPipelineJobRecur( BaseDatastoreService datastore, String jobId, Set handledJobIds) { if (handledJobIds.contains(jobId)) { - return ImmutableSet.of(); + return ImmutableSet.of(); } handledJobIds.add(jobId); @@ -193,7 +193,7 @@ class MapreduceEntityCleanupUtil { try { jobRecord = PipelineManager.getJob(jobId); } catch (NoSuchObjectException e) { - return ImmutableSet.of(); + return ImmutableSet.of(); } ImmutableSet.Builder idSetBuilder = new ImmutableSet.Builder<>(); diff --git a/java/google/registry/batch/VerifyEntityIntegrityAction.java b/java/google/registry/batch/VerifyEntityIntegrityAction.java index 8e58dddc1..248a07ec6 100644 --- a/java/google/registry/batch/VerifyEntityIntegrityAction.java +++ b/java/google/registry/batch/VerifyEntityIntegrityAction.java @@ -102,7 +102,7 @@ public class VerifyEntityIntegrityAction implements Runnable { @VisibleForTesting static BatchComponent component = DaggerBatchComponent.create(); private static final ImmutableSet> RESOURCE_CLASSES = - ImmutableSet.>of( + ImmutableSet.of( ForeignKeyDomainIndex.class, DomainApplicationIndex.class, ForeignKeyHostIndex.class, @@ -307,7 +307,7 @@ public class VerifyEntityIntegrityAction implements Runnable { } private void mapForeignKeyIndex(ForeignKeyIndex fki) { - Key> fkiKey = Key.>create(fki); + Key> fkiKey = Key.create(fki); @SuppressWarnings("cast") EppResource resource = verifyExistence(fkiKey, fki.getResourceKey()); if (resource != null) { @@ -368,7 +368,7 @@ public class VerifyEntityIntegrityAction implements Runnable { private void verifyExistence(Key source, Set> targets) { Set> missingEntityKeys = - Sets.difference(targets, ofy().load().keys(targets).keySet()); + Sets.difference(targets, ofy().load().keys(targets).keySet()); integrity().checkOneToMany( missingEntityKeys.isEmpty(), source, diff --git a/java/google/registry/cron/TldFanoutAction.java b/java/google/registry/cron/TldFanoutAction.java index 671796932..9431deeff 100644 --- a/java/google/registry/cron/TldFanoutAction.java +++ b/java/google/registry/cron/TldFanoutAction.java @@ -118,11 +118,11 @@ public final class TldFanoutAction implements Runnable { Set tlds = difference( Streams.concat( - Streams.stream(runInEmpty ? ImmutableSet.of("") : ImmutableSet.of()), + Streams.stream(runInEmpty ? ImmutableSet.of("") : ImmutableSet.of()), Streams.stream( - forEachRealTld ? getTldsOfType(REAL) : ImmutableSet.of()), + forEachRealTld ? getTldsOfType(REAL) : ImmutableSet.of()), Streams.stream( - forEachTestTld ? getTldsOfType(TEST) : ImmutableSet.of())) + forEachTestTld ? getTldsOfType(TEST) : ImmutableSet.of())) .collect(toImmutableSet()), excludes); Multimap flowThruParams = filterKeys(params, not(in(CONTROL_PARAMS))); diff --git a/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java b/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java index dc3ab6f23..15c8153da 100644 --- a/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java +++ b/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java @@ -121,7 +121,7 @@ public class CloudDnsWriter extends BaseDnsWriter { // desiredRecordsBuilder is populated with an empty set to indicate that all existing records // should be deleted. if (!domainResource.isPresent() || !domainResource.get().shouldPublishToDns()) { - desiredRecords.put(absoluteDomainName, ImmutableSet.of()); + desiredRecords.put(absoluteDomainName, ImmutableSet.of()); return; } @@ -189,7 +189,7 @@ public class CloudDnsWriter extends BaseDnsWriter { // Return early if the host is deleted. if (!host.isPresent()) { - desiredRecords.put(absoluteHostName, ImmutableSet.of()); + desiredRecords.put(absoluteHostName, ImmutableSet.of()); return; } diff --git a/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriter.java b/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriter.java index 76e518703..c20813dd6 100644 --- a/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriter.java +++ b/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriter.java @@ -203,7 +203,7 @@ public class DnsUpdateWriter extends BaseDnsWriter { union( domain.getSubordinateHosts(), (additionalHost == null - ? ImmutableSet.of() + ? ImmutableSet.of() : ImmutableSet.of(additionalHost)))) { update.delete(toAbsoluteName(hostName), Type.ANY); } diff --git a/java/google/registry/export/PublishDetailReportAction.java b/java/google/registry/export/PublishDetailReportAction.java index 938fd240e..5d387b97b 100644 --- a/java/google/registry/export/PublishDetailReportAction.java +++ b/java/google/registry/export/PublishDetailReportAction.java @@ -109,7 +109,7 @@ public final class PublishDetailReportAction implements Runnable, JsonAction { driveFolderId, gcsBucketName, gcsObjectName); - return ImmutableMap.of("driveId", driveId); + return ImmutableMap.of("driveId", driveId); } catch (FileNotFoundException e) { throw new IllegalArgumentException(e.getMessage(), e); } diff --git a/java/google/registry/export/SyncGroupMembersAction.java b/java/google/registry/export/SyncGroupMembersAction.java index 5635c2747..47ee79c13 100644 --- a/java/google/registry/export/SyncGroupMembersAction.java +++ b/java/google/registry/export/SyncGroupMembersAction.java @@ -134,7 +134,7 @@ public final class SyncGroupMembersAction implements Runnable { for (final Registrar registrar : dirtyRegistrars) { try { retrier.callWithRetry(() -> syncRegistrarContacts(registrar), RuntimeException.class); - resultsBuilder.put(registrar, Optional.empty()); + resultsBuilder.put(registrar, Optional.empty()); } catch (Throwable e) { logger.severe(e, e.getMessage()); resultsBuilder.put(registrar, Optional.of(e)); diff --git a/java/google/registry/flows/CheckApiAction.java b/java/google/registry/flows/CheckApiAction.java index 46f69d0ab..cfd2b00ea 100644 --- a/java/google/registry/flows/CheckApiAction.java +++ b/java/google/registry/flows/CheckApiAction.java @@ -144,9 +144,7 @@ public class CheckApiAction implements Runnable { } private Map fail(String reason) { - return ImmutableMap.of( - "status", "error", - "reason", reason); + return ImmutableMap.of("status", "error", "reason", reason); } /** Dagger module for the check api endpoint. */ diff --git a/java/google/registry/flows/FlowReporter.java b/java/google/registry/flows/FlowReporter.java index e861cea10..b5a52311c 100644 --- a/java/google/registry/flows/FlowReporter.java +++ b/java/google/registry/flows/FlowReporter.java @@ -108,7 +108,7 @@ public class FlowReporter { private static final Optional extractTld(String domainName) { int index = domainName.indexOf('.'); return index == -1 - ? Optional.empty() + ? Optional.empty() : Optional.of(Ascii.toLowerCase(domainName.substring(index + 1))); } diff --git a/java/google/registry/flows/ResourceFlowUtils.java b/java/google/registry/flows/ResourceFlowUtils.java index e6a160b53..6129da65f 100644 --- a/java/google/registry/flows/ResourceFlowUtils.java +++ b/java/google/registry/flows/ResourceFlowUtils.java @@ -251,7 +251,7 @@ public final class ResourceFlowUtils { B extends Builder & BuilderWithTransferData> R approvePendingTransfer(R resource, TransferStatus transferStatus, DateTime now) { checkArgument(transferStatus.isApproved(), "Not an approval transfer status"); - B builder = ResourceFlowUtils.resolvePendingTransfer(resource, transferStatus, now); + B builder = ResourceFlowUtils.resolvePendingTransfer(resource, transferStatus, now); return builder .setLastTransferTime(now) .setPersistedCurrentSponsorClientId(resource.getTransferData().getGainingClientId()) diff --git a/java/google/registry/flows/contact/ContactTransferRequestFlow.java b/java/google/registry/flows/contact/ContactTransferRequestFlow.java index a233f7908..2adadcb93 100644 --- a/java/google/registry/flows/contact/ContactTransferRequestFlow.java +++ b/java/google/registry/flows/contact/ContactTransferRequestFlow.java @@ -128,7 +128,7 @@ public final class ContactTransferRequestFlow implements TransactionalFlow { TransferData pendingTransferData = serverApproveTransferData.asBuilder() .setTransferStatus(TransferStatus.PENDING) .setServerApproveEntities( - ImmutableSet.>of( + ImmutableSet.of( Key.create(serverApproveGainingPollMessage), Key.create(serverApproveLosingPollMessage))) .build(); diff --git a/java/google/registry/flows/custom/EntityChanges.java b/java/google/registry/flows/custom/EntityChanges.java index 92909098e..7a64f7422 100644 --- a/java/google/registry/flows/custom/EntityChanges.java +++ b/java/google/registry/flows/custom/EntityChanges.java @@ -31,8 +31,8 @@ public abstract class EntityChanges { // Default both entities to save and entities to delete to empty sets, so that the build() // method won't subsequently throw an exception if one doesn't end up being applicable. return new AutoValue_EntityChanges.Builder() - .setSaves(ImmutableSet.of()) - .setDeletes(ImmutableSet.>of()); + .setSaves(ImmutableSet.of()) + .setDeletes(ImmutableSet.of()); } /** Builder for {@link EntityChanges}. */ diff --git a/java/google/registry/flows/domain/DomainAllocateFlow.java b/java/google/registry/flows/domain/DomainAllocateFlow.java index b58073083..5f38ca562 100644 --- a/java/google/registry/flows/domain/DomainAllocateFlow.java +++ b/java/google/registry/flows/domain/DomainAllocateFlow.java @@ -184,7 +184,7 @@ public class DomainAllocateFlow implements TransactionalFlow { // Names on the collision list will not be delegated. Set server hold. .setStatusValues(getReservationTypes(domainName).contains(ReservationType.NAME_COLLISION) ? ImmutableSet.of(StatusValue.SERVER_HOLD) - : ImmutableSet.of()) + : ImmutableSet.of()) .setRegistrant(command.getRegistrant()) .setAuthInfo(command.getAuthInfo()) .setFullyQualifiedDomainName(targetId) @@ -405,7 +405,7 @@ public class DomainAllocateFlow implements TransactionalFlow { FeeCreateCommandExtension feeCreate = eppInput.getSingleExtension(FeeCreateCommandExtension.class); return (feeCreate == null) - ? ImmutableList.of() + ? ImmutableList.of() : ImmutableList.of(createFeeCreateResponse(feeCreate, feesAndCredits)); } diff --git a/java/google/registry/flows/domain/DomainCheckFlow.java b/java/google/registry/flows/domain/DomainCheckFlow.java index 67af65425..5fc13c6f5 100644 --- a/java/google/registry/flows/domain/DomainCheckFlow.java +++ b/java/google/registry/flows/domain/DomainCheckFlow.java @@ -187,7 +187,7 @@ public final class DomainCheckFlow implements Flow { } return reservationTypes.isEmpty() - ? Optional.empty() + ? Optional.empty() : Optional.of(getTypeOfHighestSeverity(reservationTypes).getMessageForCheck()); } diff --git a/java/google/registry/flows/domain/DomainCreateFlow.java b/java/google/registry/flows/domain/DomainCreateFlow.java index 5617e8abf..cf49d0286 100644 --- a/java/google/registry/flows/domain/DomainCreateFlow.java +++ b/java/google/registry/flows/domain/DomainCreateFlow.java @@ -86,7 +86,6 @@ import google.registry.model.domain.metadata.MetadataExtension; import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.secdns.SecDnsCreateExtension; import google.registry.model.eppcommon.AuthInfo; -import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppinput.EppInput; import google.registry.model.eppinput.ResourceCommand; import google.registry.model.eppoutput.CreateData.DomainCreateData; @@ -305,7 +304,7 @@ public class DomainCreateFlow implements TransactionalFlow { .setStatusValues( registry.getDomainCreateRestricted() ? ImmutableSet.of(SERVER_UPDATE_PROHIBITED, SERVER_TRANSFER_PROHIBITED) - : ImmutableSet.of()) + : ImmutableSet.of()) .setContacts(command.getContacts()) .addGracePeriod(GracePeriod.forBillingEvent(GracePeriodStatus.ADD, createBillingEvent)) .build(); @@ -411,7 +410,7 @@ public class DomainCreateFlow implements TransactionalFlow { .setFlags( isAnchorTenant ? ImmutableSet.of(BillingEvent.Flag.ANCHOR_TENANT) - : ImmutableSet.of()) + : ImmutableSet.of()) .setParent(historyEntry) .build(); } @@ -471,7 +470,7 @@ public class DomainCreateFlow implements TransactionalFlow { private static ImmutableList createResponseExtensions( FeeCreateCommandExtension feeCreate, FeesAndCredits feesAndCredits) { return (feeCreate == null) - ? ImmutableList.of() + ? ImmutableList.of() : ImmutableList.of(createFeeCreateResponse(feeCreate, feesAndCredits)); } diff --git a/java/google/registry/flows/domain/DomainFlowUtils.java b/java/google/registry/flows/domain/DomainFlowUtils.java index 3d3cdff94..151241bed 100644 --- a/java/google/registry/flows/domain/DomainFlowUtils.java +++ b/java/google/registry/flows/domain/DomainFlowUtils.java @@ -503,7 +503,7 @@ public class DomainFlowUtils { : newAutorenewPollMessage(domain) .setId(existingAutorenewKey.getId()) .setAutorenewEndTime(newEndTime) - .setParentKey(existingAutorenewKey.getParent()) + .setParentKey(existingAutorenewKey.getParent()) .build(); // If the resultant autorenew poll message would have no poll messages to deliver, then just @@ -734,10 +734,10 @@ public class DomainFlowUtils { throw new SecDnsAllUsageException(); // Explicit all=false is meaningless. } Set toAdd = (add == null) - ? ImmutableSet.of() + ? ImmutableSet.of() : add.getDsData(); Set toRemove = (remove == null) - ? ImmutableSet.of() + ? ImmutableSet.of() : (remove.getAll() == null) ? remove.getDsData() : oldDsData; // RFC 5910 specifies that removes are processed before adds. return ImmutableSet.copyOf(union(difference(oldDsData, toRemove), toAdd)); diff --git a/java/google/registry/flows/domain/DomainPricingLogic.java b/java/google/registry/flows/domain/DomainPricingLogic.java index 22178d180..ebee12243 100644 --- a/java/google/registry/flows/domain/DomainPricingLogic.java +++ b/java/google/registry/flows/domain/DomainPricingLogic.java @@ -210,6 +210,6 @@ public final class DomainPricingLogic { return Optional.of(token); } } - return Optional.empty(); + return Optional.empty(); } } diff --git a/java/google/registry/flows/domain/DomainRenewFlow.java b/java/google/registry/flows/domain/DomainRenewFlow.java index a94504ab9..b7fdfee20 100644 --- a/java/google/registry/flows/domain/DomainRenewFlow.java +++ b/java/google/registry/flows/domain/DomainRenewFlow.java @@ -47,7 +47,6 @@ import google.registry.flows.custom.DomainRenewFlowCustomLogic.BeforeResponsePar import google.registry.flows.custom.DomainRenewFlowCustomLogic.BeforeResponseReturnData; import google.registry.flows.custom.DomainRenewFlowCustomLogic.BeforeSaveParameters; import google.registry.flows.custom.EntityChanges; -import google.registry.model.ImmutableObject; import google.registry.model.billing.BillingEvent; import google.registry.model.billing.BillingEvent.OneTime; import google.registry.model.billing.BillingEvent.Reason; @@ -189,7 +188,7 @@ public final class DomainRenewFlow implements TransactionalFlow { .setEntityChanges( EntityChanges.newBuilder() .setSaves( - ImmutableSet.of( + ImmutableSet.of( newDomain, historyEntry, explicitRenewEvent, @@ -264,7 +263,7 @@ public final class DomainRenewFlow implements TransactionalFlow { private ImmutableList createResponseExtensions( Money renewCost, FeeRenewCommandExtension feeRenew) { return (feeRenew == null) - ? ImmutableList.of() + ? ImmutableList.of() : ImmutableList.of(feeRenew.createResponseBuilder() .setCurrency(renewCost.getCurrencyUnit()) .setFees(ImmutableList.of(Fee.create(renewCost.getAmount(), FeeType.RENEW))) diff --git a/java/google/registry/flows/domain/DomainRestoreRequestFlow.java b/java/google/registry/flows/domain/DomainRestoreRequestFlow.java index f0519b1a6..a815c4882 100644 --- a/java/google/registry/flows/domain/DomainRestoreRequestFlow.java +++ b/java/google/registry/flows/domain/DomainRestoreRequestFlow.java @@ -263,7 +263,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow { private static ImmutableList createResponseExtensions( Money restoreCost, Money renewCost, FeeUpdateCommandExtension feeUpdate) { return (feeUpdate == null) - ? ImmutableList.of() + ? ImmutableList.of() : ImmutableList.of(feeUpdate.createResponseBuilder() .setCurrency(restoreCost.getCurrencyUnit()) .setFees(ImmutableList.of( diff --git a/java/google/registry/flows/domain/DomainTransferApproveFlow.java b/java/google/registry/flows/domain/DomainTransferApproveFlow.java index 2a417b499..1d44c891e 100644 --- a/java/google/registry/flows/domain/DomainTransferApproveFlow.java +++ b/java/google/registry/flows/domain/DomainTransferApproveFlow.java @@ -119,7 +119,7 @@ public final class DomainTransferApproveFlow implements TransactionalFlow { // the transfer period to zero. There is not a transfer cost if the transfer period is zero. Optional billingEvent = (transferData.getTransferPeriod().getValue() == 0) - ? Optional.empty() + ? Optional.empty() : Optional.of( new BillingEvent.OneTime.Builder() .setReason(Reason.TRANSFER) @@ -192,7 +192,7 @@ public final class DomainTransferApproveFlow implements TransactionalFlow { (billingEvent.isPresent()) ? ImmutableSet.of( GracePeriod.forBillingEvent(GracePeriodStatus.TRANSFER, billingEvent.get())) - : ImmutableSet.of()) + : ImmutableSet.of()) .build(); // Create a poll message for the gaining client. PollMessage gainingClientPollMessage = createGainingTransferPollMessage( diff --git a/java/google/registry/flows/domain/DomainTransferRequestFlow.java b/java/google/registry/flows/domain/DomainTransferRequestFlow.java index 2501f2951..a1f3dcf18 100644 --- a/java/google/registry/flows/domain/DomainTransferRequestFlow.java +++ b/java/google/registry/flows/domain/DomainTransferRequestFlow.java @@ -73,7 +73,6 @@ import google.registry.model.transfer.TransferResponse.DomainTransferResponse; import google.registry.model.transfer.TransferStatus; import java.util.Optional; import javax.inject.Inject; -import org.joda.money.Money; import org.joda.time.DateTime; /** @@ -160,7 +159,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow { // If the period is zero, then there is no fee for the transfer. Optional feesAndCredits = (period.getValue() == 0) - ? Optional.empty() + ? Optional.empty() : Optional.of(pricingLogic.getTransferPrice(registry, targetId, now)); if (feesAndCredits.isPresent()) { validateFeeChallenge(targetId, tld, now, feeTransfer, feesAndCredits.get()); @@ -200,7 +199,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow { gainingClientId, (feesAndCredits.isPresent()) ? Optional.of(feesAndCredits.get().getTotalCost()) - : Optional.empty(), + : Optional.empty(), now); // Create the transfer data that represents the pending transfer. TransferData pendingTransferData = @@ -337,7 +336,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow { private static ImmutableList createResponseExtensions( Optional feesAndCredits, FeeTransferCommandExtension feeTransfer) { return (feeTransfer == null || !feesAndCredits.isPresent()) - ? ImmutableList.of() + ? ImmutableList.of() : ImmutableList.of(feeTransfer.createResponseBuilder() .setFees(feesAndCredits.get().getFees()) .setCredits(feesAndCredits.get().getCredits()) diff --git a/java/google/registry/flows/picker/FlowPicker.java b/java/google/registry/flows/picker/FlowPicker.java index 71985cf7c..bd5fa3059 100644 --- a/java/google/registry/flows/picker/FlowPicker.java +++ b/java/google/registry/flows/picker/FlowPicker.java @@ -121,7 +121,7 @@ public class FlowPicker { /** Session flows like login and logout are keyed only on the {@link InnerCommand} type. */ private static final FlowProvider SESSION_FLOW_PROVIDER = new FlowProvider() { private final Map, Class> commandFlows = - ImmutableMap., Class>of( + ImmutableMap.of( Login.class, LoginFlow.class, Logout.class, LogoutFlow.class); @@ -240,7 +240,7 @@ public class FlowPicker { private static final FlowProvider APPLICATION_CRUD_FLOW_PROVIDER = new FlowProvider() { private final Map, Class> applicationFlows = - ImmutableMap., Class>of( + ImmutableMap.of( DomainCommand.Create.class, DomainApplicationCreateFlow.class, DomainCommand.Delete.class, DomainApplicationDeleteFlow.class, DomainCommand.Info.class, DomainApplicationInfoFlow.class, diff --git a/java/google/registry/mapreduce/MapreduceRunner.java b/java/google/registry/mapreduce/MapreduceRunner.java index c6e717753..ed2ab79a2 100644 --- a/java/google/registry/mapreduce/MapreduceRunner.java +++ b/java/google/registry/mapreduce/MapreduceRunner.java @@ -203,8 +203,8 @@ public class MapreduceRunner { .setMapper(mapper) .setReducer(reducer) .setOutput(output) - .setKeyMarshaller(Marshallers.getSerializationMarshaller()) - .setValueMarshaller(Marshallers.getSerializationMarshaller()) + .setKeyMarshaller(Marshallers.getSerializationMarshaller()) + .setValueMarshaller(Marshallers.getSerializationMarshaller()) .setNumReducers(httpParamReduceShards.orElse(defaultReduceShards)) .build(), new MapReduceSettings.Builder() diff --git a/java/google/registry/mapreduce/inputs/ChildEntityInput.java b/java/google/registry/mapreduce/inputs/ChildEntityInput.java index 9c598ff5a..d7e915087 100644 --- a/java/google/registry/mapreduce/inputs/ChildEntityInput.java +++ b/java/google/registry/mapreduce/inputs/ChildEntityInput.java @@ -41,8 +41,8 @@ class ChildEntityInput ImmutableSet> childResourceClasses) { this.resourceClasses = resourceClasses; this.childResourceClasses = childResourceClasses; - checkNoInheritanceRelationships(ImmutableSet.>copyOf(resourceClasses)); - checkNoInheritanceRelationships(ImmutableSet.>copyOf(childResourceClasses)); + checkNoInheritanceRelationships(ImmutableSet.copyOf(resourceClasses)); + checkNoInheritanceRelationships(ImmutableSet.copyOf(childResourceClasses)); } @Override diff --git a/java/google/registry/mapreduce/inputs/EppResourceBaseReader.java b/java/google/registry/mapreduce/inputs/EppResourceBaseReader.java index 8862a2a3e..836726f98 100644 --- a/java/google/registry/mapreduce/inputs/EppResourceBaseReader.java +++ b/java/google/registry/mapreduce/inputs/EppResourceBaseReader.java @@ -137,7 +137,7 @@ abstract class EppResourceBaseReader extends InputReader { ImmutableSet> resourceClasses) { // Ignore EppResource when finding kinds, since it doesn't have one and doesn't imply filtering. return resourceClasses.contains(EppResource.class) - ? ImmutableSet.of() + ? ImmutableSet.of() : resourceClasses.stream().map(CLASS_TO_KIND_FUNCTION).collect(toImmutableSet()); } } diff --git a/java/google/registry/mapreduce/inputs/EppResourceEntityInput.java b/java/google/registry/mapreduce/inputs/EppResourceEntityInput.java index a7ff3e113..2d6619abc 100644 --- a/java/google/registry/mapreduce/inputs/EppResourceEntityInput.java +++ b/java/google/registry/mapreduce/inputs/EppResourceEntityInput.java @@ -32,7 +32,7 @@ class EppResourceEntityInput extends EppResourceBaseInput public EppResourceEntityInput(ImmutableSet> resourceClasses) { this.resourceClasses = resourceClasses; - checkNoInheritanceRelationships(ImmutableSet.>copyOf(resourceClasses)); + checkNoInheritanceRelationships(ImmutableSet.copyOf(resourceClasses)); } @Override diff --git a/java/google/registry/mapreduce/inputs/EppResourceIndexReader.java b/java/google/registry/mapreduce/inputs/EppResourceIndexReader.java index 4d992e3a1..c37f0542b 100644 --- a/java/google/registry/mapreduce/inputs/EppResourceIndexReader.java +++ b/java/google/registry/mapreduce/inputs/EppResourceIndexReader.java @@ -29,7 +29,7 @@ class EppResourceIndexReader extends EppResourceBaseReader { public EppResourceIndexReader(Key bucketKey) { // Estimate 1MB of memory for this reader, which is massive overkill. // Use an empty set for the filter kinds, which disables filtering. - super(bucketKey, ONE_MB, ImmutableSet.of()); + super(bucketKey, ONE_MB, ImmutableSet.of()); } /** diff --git a/java/google/registry/mapreduce/inputs/EppResourceKeyInput.java b/java/google/registry/mapreduce/inputs/EppResourceKeyInput.java index 8b8c29d96..6222d4b77 100644 --- a/java/google/registry/mapreduce/inputs/EppResourceKeyInput.java +++ b/java/google/registry/mapreduce/inputs/EppResourceKeyInput.java @@ -36,7 +36,7 @@ class EppResourceKeyInput extends EppResourceBaseInput> resourceClasses) { this.resourceClasses = resourceClasses; - checkNoInheritanceRelationships(ImmutableSet.>copyOf(resourceClasses)); + checkNoInheritanceRelationships(ImmutableSet.copyOf(resourceClasses)); } @Override diff --git a/java/google/registry/model/EntityClasses.java b/java/google/registry/model/EntityClasses.java index f15a9ebdb..84b8628ef 100644 --- a/java/google/registry/model/EntityClasses.java +++ b/java/google/registry/model/EntityClasses.java @@ -63,7 +63,7 @@ public final class EntityClasses { /** Set of entity classes. */ @SuppressWarnings("unchecked") // varargs public static final ImmutableSet> ALL_CLASSES = - ImmutableSet.>of( + ImmutableSet.of( BillingEvent.Cancellation.class, BillingEvent.Modification.class, BillingEvent.OneTime.class, diff --git a/java/google/registry/model/EppResourceUtils.java b/java/google/registry/model/EppResourceUtils.java index b2a856419..1d50ced97 100644 --- a/java/google/registry/model/EppResourceUtils.java +++ b/java/google/registry/model/EppResourceUtils.java @@ -164,7 +164,7 @@ public final class EppResourceUtils { ofy().load().type(clazz) .filter(filterDefinition, filterValue) .filter("deletionTime >", now.toDate()), - EppResourceUtils.transformAtTime(now)); + EppResourceUtils.transformAtTime(now)); } /** diff --git a/java/google/registry/model/billing/RegistrarCreditBalance.java b/java/google/registry/model/billing/RegistrarCreditBalance.java index d4b45e9a2..9090eb395 100644 --- a/java/google/registry/model/billing/RegistrarCreditBalance.java +++ b/java/google/registry/model/billing/RegistrarCreditBalance.java @@ -211,7 +211,7 @@ public final class RegistrarCreditBalance extends ImmutableObject implements Bui private Optional getMostRecentlyWrittenBalance( Map.Entry> balancesAtEffectiveTime) { return balancesAtEffectiveTime == null - ? Optional.empty() + ? Optional.empty() // Don't use Optional.ofNullable() here since it's an error if there's a empty submap. : Optional.of(balancesAtEffectiveTime.getValue().lastEntry().getValue()); } diff --git a/java/google/registry/model/common/TimedTransitionProperty.java b/java/google/registry/model/common/TimedTransitionProperty.java index c25f4602e..2d0ad62bb 100644 --- a/java/google/registry/model/common/TimedTransitionProperty.java +++ b/java/google/registry/model/common/TimedTransitionProperty.java @@ -162,7 +162,7 @@ public class TimedTransitionProperty newInnerMap = new HashMap<>(currentMap); newInnerMap.put(transitionTime, transitionValue); ImmutableSortedMap newMap = - ImmutableSortedMap.copyOf(newInnerMap); + ImmutableSortedMap.copyOf(newInnerMap); validateTimedTransitionMap(newMap, allowedTransitions, allowedTransitionMapName); return fromValueMap(newMap, transitionClass); } diff --git a/java/google/registry/model/domain/DomainResource.java b/java/google/registry/model/domain/DomainResource.java index c2d4d85ef..aee074696 100644 --- a/java/google/registry/model/domain/DomainResource.java +++ b/java/google/registry/model/domain/DomainResource.java @@ -277,7 +277,7 @@ public class DomainResource extends DomainBase transferData.getServerApproveBillingEvent()))); } else { // There won't be a billing event, so we don't need a grace period - builder.setGracePeriods(ImmutableSet.of()); + builder.setGracePeriods(ImmutableSet.of()); } // Set all remaining transfer properties. setAutomaticTransferSuccessProperties(builder, transferData); diff --git a/java/google/registry/model/eppinput/EppInput.java b/java/google/registry/model/eppinput/EppInput.java index 31f16bb97..65bdeb033 100644 --- a/java/google/registry/model/eppinput/EppInput.java +++ b/java/google/registry/model/eppinput/EppInput.java @@ -131,7 +131,7 @@ public class EppInput extends ImmutableObject { ResourceCommand resourceCommand = getResourceCommand(); return resourceCommand instanceof SingleResourceCommand ? Optional.of(((SingleResourceCommand) resourceCommand).getTargetId()) - : Optional.empty(); + : Optional.empty(); } /** diff --git a/java/google/registry/model/index/DomainApplicationIndex.java b/java/google/registry/model/index/DomainApplicationIndex.java index 914adfc01..58f6c998e 100644 --- a/java/google/registry/model/index/DomainApplicationIndex.java +++ b/java/google/registry/model/index/DomainApplicationIndex.java @@ -134,7 +134,7 @@ public class DomainApplicationIndex extends BackupGroupRoot { public static DomainApplicationIndex createUpdatedInstance(DomainApplication application) { DomainApplicationIndex existing = load(application.getFullyQualifiedDomainName()); ImmutableSet> newKeys = CollectionUtils.union( - (existing == null ? ImmutableSet.>of() : existing.getKeys()), + (existing == null ? ImmutableSet.of() : existing.getKeys()), Key.create(application)); return createWithSpecifiedKeys(application.getFullyQualifiedDomainName(), newKeys); } diff --git a/java/google/registry/model/index/ForeignKeyIndex.java b/java/google/registry/model/index/ForeignKeyIndex.java index 4533aed2e..d27f9198d 100644 --- a/java/google/registry/model/index/ForeignKeyIndex.java +++ b/java/google/registry/model/index/ForeignKeyIndex.java @@ -59,7 +59,7 @@ public abstract class ForeignKeyIndex extends BackupGroup static final ImmutableMap< Class, Class>> RESOURCE_CLASS_TO_FKI_CLASS = - ImmutableMap., Class>>of( + ImmutableMap.of( ContactResource.class, ForeignKeyContactIndex.class, DomainResource.class, ForeignKeyDomainIndex.class, HostResource.class, ForeignKeyHostIndex.class); @@ -119,7 +119,7 @@ public abstract class ForeignKeyIndex extends BackupGroup public static Key> createKey(E resource) { @SuppressWarnings("unchecked") Class resourceClass = (Class) resource.getClass(); - return Key.>create(mapToFkiClass(resourceClass), resource.getForeignKey()); + return Key.create(mapToFkiClass(resourceClass), resource.getForeignKey()); } /** diff --git a/java/google/registry/model/ofy/AugmentedDeleter.java b/java/google/registry/model/ofy/AugmentedDeleter.java index fbf23c1cf..873975432 100644 --- a/java/google/registry/model/ofy/AugmentedDeleter.java +++ b/java/google/registry/model/ofy/AugmentedDeleter.java @@ -50,13 +50,13 @@ abstract class AugmentedDeleter implements Deleter { @Override public Result entity(Object entity) { - handleDeletion(Arrays.>asList(Key.create(entity))); + handleDeletion(Arrays.asList(Key.create(entity))); return delegate.entity(entity); } @Override public Result key(Key key) { - handleDeletion(Arrays.>asList(key)); + handleDeletion(Arrays.asList(key)); return delegate.keys(key); } diff --git a/java/google/registry/model/ofy/TransactionInfo.java b/java/google/registry/model/ofy/TransactionInfo.java index e241dbccd..611799ec8 100644 --- a/java/google/registry/model/ofy/TransactionInfo.java +++ b/java/google/registry/model/ofy/TransactionInfo.java @@ -33,7 +33,7 @@ import org.joda.time.DateTime; /** Metadata for an {@link Ofy} transaction that saves commit logs. */ class TransactionInfo { - private static final Predicate IS_DELETE = Predicates.equalTo(Delete.SENTINEL); + private static final Predicate IS_DELETE = Predicates.equalTo(Delete.SENTINEL); private enum Delete { SENTINEL } diff --git a/java/google/registry/model/poll/PollMessage.java b/java/google/registry/model/poll/PollMessage.java index ea286463f..9211c57d3 100644 --- a/java/google/registry/model/poll/PollMessage.java +++ b/java/google/registry/model/poll/PollMessage.java @@ -221,8 +221,9 @@ public abstract class PollMessage extends ImmutableObject @Override public ImmutableList getResponseExtensions() { - return (launchInfoResponseExtension == null) ? ImmutableList.of() : - ImmutableList.of(launchInfoResponseExtension); + return (launchInfoResponseExtension == null) + ? ImmutableList.of() + : ImmutableList.of(launchInfoResponseExtension); } /** A builder for {@link OneTime} since it is immutable. */ @@ -313,7 +314,7 @@ public abstract class PollMessage extends ImmutableObject public ImmutableList getResponseData() { // Note that the event time is when the auto-renew occured, so the expiration time in the // response should be 1 year past that, since it denotes the new expiration time. - return ImmutableList.of( + return ImmutableList.of( DomainRenewData.create(getTargetId(), getEventTime().plusYears(1))); } diff --git a/java/google/registry/model/poll/PollMessageExternalKeyConverter.java b/java/google/registry/model/poll/PollMessageExternalKeyConverter.java index 67ee279eb..d800d7644 100644 --- a/java/google/registry/model/poll/PollMessageExternalKeyConverter.java +++ b/java/google/registry/model/poll/PollMessageExternalKeyConverter.java @@ -51,7 +51,7 @@ public class PollMessageExternalKeyConverter extends Converter, * belongs to. */ public static final ImmutableBiMap, Long> EXTERNAL_KEY_CLASS_ID_MAP = - ImmutableBiMap., Long>of( + ImmutableBiMap.of( DomainBase.class, 1L, ContactResource.class, 2L, HostResource.class, 3L); diff --git a/java/google/registry/model/pricing/StaticPremiumListPricingEngine.java b/java/google/registry/model/pricing/StaticPremiumListPricingEngine.java index 8f951cef4..e0fcdded2 100644 --- a/java/google/registry/model/pricing/StaticPremiumListPricingEngine.java +++ b/java/google/registry/model/pricing/StaticPremiumListPricingEngine.java @@ -54,6 +54,6 @@ public final class StaticPremiumListPricingEngine implements PremiumPricingEngin premiumPrice.isPresent(), premiumPrice.orElse(registry.getStandardCreateCost()), premiumPrice.orElse(registry.getStandardRenewCost(priceTime)), - Optional.ofNullable(feeClass)); + Optional.ofNullable(feeClass)); } } diff --git a/java/google/registry/model/registry/label/BaseDomainLabelList.java b/java/google/registry/model/registry/label/BaseDomainLabelList.java index 144880b34..cc4ca3fbd 100644 --- a/java/google/registry/model/registry/label/BaseDomainLabelList.java +++ b/java/google/registry/model/registry/label/BaseDomainLabelList.java @@ -132,7 +132,7 @@ public abstract class BaseDomainLabelList, R extends Dom } else { line = line.trim(); } - return line.isEmpty() ? ImmutableList.of() : ImmutableList.of(line, comment); + return line.isEmpty() ? ImmutableList.of() : ImmutableList.of(line, comment); } /** Gets the names of the tlds that reference this list. */ diff --git a/java/google/registry/model/registry/label/PremiumListUtils.java b/java/google/registry/model/registry/label/PremiumListUtils.java index d23858098..23bf3a834 100644 --- a/java/google/registry/model/registry/label/PremiumListUtils.java +++ b/java/google/registry/model/registry/label/PremiumListUtils.java @@ -73,7 +73,7 @@ public final class PremiumListUtils { public static Optional getPremiumPrice(String label, Registry registry) { // If the registry has no configured premium list, then no labels are premium. if (registry.getPremiumList() == null) { - return Optional.empty(); + return Optional.empty(); } DateTime startTime = DateTime.now(UTC); String listName = registry.getPremiumList().getName(); @@ -103,7 +103,7 @@ public final class PremiumListUtils { private static CheckResults checkStatus(PremiumListRevision premiumListRevision, String label) { if (!premiumListRevision.getProbablePremiumLabels().mightContain(label)) { - return CheckResults.create(BLOOM_FILTER_NEGATIVE, Optional.empty()); + return CheckResults.create(BLOOM_FILTER_NEGATIVE, Optional.empty()); } Key entryKey = @@ -115,7 +115,7 @@ public final class PremiumListUtils { if (entry.isPresent()) { return CheckResults.create(CACHED_POSITIVE, Optional.of(entry.get().getValue())); } else { - return CheckResults.create(CACHED_NEGATIVE, Optional.empty()); + return CheckResults.create(CACHED_NEGATIVE, Optional.empty()); } } @@ -123,7 +123,7 @@ public final class PremiumListUtils { if (entry.isPresent()) { return CheckResults.create(UNCACHED_POSITIVE, Optional.of(entry.get().getValue())); } else { - return CheckResults.create(UNCACHED_NEGATIVE, Optional.empty()); + return CheckResults.create(UNCACHED_NEGATIVE, Optional.empty()); } } catch (InvalidCacheLoadException | ExecutionException e) { throw new RuntimeException("Could not load premium list entry " + entryKey, e); diff --git a/java/google/registry/monitoring/metrics/MetricMetrics.java b/java/google/registry/monitoring/metrics/MetricMetrics.java index a58caff8f..17a768533 100644 --- a/java/google/registry/monitoring/metrics/MetricMetrics.java +++ b/java/google/registry/monitoring/metrics/MetricMetrics.java @@ -29,7 +29,7 @@ final class MetricMetrics { "/metrics/push_intervals", "Count of push intervals.", "Push Intervals", - ImmutableSet.of()); + ImmutableSet.of()); private static final ImmutableSet LABELS = ImmutableSet.of( LabelDescriptor.create("kind", "Metric Kind"), diff --git a/java/google/registry/monitoring/metrics/MetricReporter.java b/java/google/registry/monitoring/metrics/MetricReporter.java index 3497b1208..58dcec00e 100644 --- a/java/google/registry/monitoring/metrics/MetricReporter.java +++ b/java/google/registry/monitoring/metrics/MetricReporter.java @@ -117,7 +117,7 @@ public class MetricReporter extends AbstractScheduledService { runOneIteration(); // Offer a poision pill to inform the exporter to stop. - writeQueue.offer(Optional.>>empty()); + writeQueue.offer(Optional.empty()); try { metricExporter.awaitTerminated(10, TimeUnit.SECONDS); logger.info("Shut down MetricExporter"); diff --git a/java/google/registry/monitoring/metrics/stackdriver/StackdriverWriter.java b/java/google/registry/monitoring/metrics/stackdriver/StackdriverWriter.java index d63bfbb76..8bc7275e2 100644 --- a/java/google/registry/monitoring/metrics/stackdriver/StackdriverWriter.java +++ b/java/google/registry/monitoring/metrics/stackdriver/StackdriverWriter.java @@ -382,7 +382,7 @@ public class StackdriverWriter implements MetricWriter { List encodedLabels = descriptor.getLabels(); // The MetricDescriptors returned by the GCM API have null fields rather than empty lists - encodedLabels = encodedLabels == null ? ImmutableList.of() : encodedLabels; + encodedLabels = encodedLabels == null ? ImmutableList.of() : encodedLabels; ImmutableMap.Builder labelValues = new ImmutableMap.Builder<>(); int i = 0; diff --git a/java/google/registry/monitoring/whitebox/EppMetric.java b/java/google/registry/monitoring/whitebox/EppMetric.java index a2472bf23..599d567c4 100644 --- a/java/google/registry/monitoring/whitebox/EppMetric.java +++ b/java/google/registry/monitoring/whitebox/EppMetric.java @@ -178,7 +178,7 @@ public abstract class EppMetric implements BigQueryMetric { public Builder setTlds(ImmutableSet tlds) { switch (tlds.size()) { case 0: - setTld(Optional.empty()); + setTld(Optional.empty()); break; case 1: String tld = Iterables.getOnlyElement(tlds); diff --git a/java/google/registry/monitoring/whitebox/MetricsExportAction.java b/java/google/registry/monitoring/whitebox/MetricsExportAction.java index 12a6a3c46..a871f90c8 100644 --- a/java/google/registry/monitoring/whitebox/MetricsExportAction.java +++ b/java/google/registry/monitoring/whitebox/MetricsExportAction.java @@ -67,7 +67,7 @@ public class MetricsExportAction implements Runnable { // Filter out the special parameters that the Action is called with. Everything that's left // is returned in a Map that is suitable to pass to Bigquery as row data. Map jsonRows = - ImmutableMap.copyOf( + ImmutableMap.copyOf( filterKeys(parameters, not(in(SPECIAL_PARAMS))).entries()); TableDataInsertAllResponse response = bigquery.tabledata() .insertAll( diff --git a/java/google/registry/rdap/RdapAuthorization.java b/java/google/registry/rdap/RdapAuthorization.java index 7e09c3032..b21c11e6b 100644 --- a/java/google/registry/rdap/RdapAuthorization.java +++ b/java/google/registry/rdap/RdapAuthorization.java @@ -54,9 +54,9 @@ public abstract class RdapAuthorization extends ImmutableObject { } public static final RdapAuthorization PUBLIC_AUTHORIZATION = - create(Role.PUBLIC, ImmutableList.of()); + create(Role.PUBLIC, ImmutableList.of()); public static final RdapAuthorization ADMINISTRATOR_AUTHORIZATION = - create(Role.ADMINISTRATOR, ImmutableList.of()); + create(Role.ADMINISTRATOR, ImmutableList.of()); } diff --git a/java/google/registry/rdap/RdapDomainSearchAction.java b/java/google/registry/rdap/RdapDomainSearchAction.java index e698c2421..7eb789a22 100644 --- a/java/google/registry/rdap/RdapDomainSearchAction.java +++ b/java/google/registry/rdap/RdapDomainSearchAction.java @@ -156,7 +156,7 @@ public class RdapDomainSearchAction extends RdapActionBase { builder, BoilerplateType.DOMAIN, results.getIncompletenessWarnings(), - ImmutableList.>of(), + ImmutableList.of(), fullServletPath); return builder.build(); } @@ -210,7 +210,7 @@ public class RdapDomainSearchAction extends RdapActionBase { loadByForeignKey(DomainResource.class, partialStringQuery.getInitialString(), now); ImmutableList results = ((domainResource == null) || !shouldBeVisible(domainResource, now)) - ? ImmutableList.of() + ? ImmutableList.of() : ImmutableList.of(domainResource); return makeSearchResults(results, now); } diff --git a/java/google/registry/rdap/RdapEntityAction.java b/java/google/registry/rdap/RdapEntityAction.java index cd742153d..44f6d13ee 100644 --- a/java/google/registry/rdap/RdapEntityAction.java +++ b/java/google/registry/rdap/RdapEntityAction.java @@ -24,7 +24,6 @@ import com.google.common.primitives.Longs; import com.google.re2j.Pattern; import com.googlecode.objectify.Key; import google.registry.model.contact.ContactResource; -import google.registry.model.domain.DesignatedContact; import google.registry.model.registrar.Registrar; import google.registry.rdap.RdapJsonFormatter.OutputDataType; import google.registry.rdap.RdapMetrics.EndpointType; @@ -95,7 +94,7 @@ public class RdapEntityAction extends RdapActionBase { return rdapJsonFormatter.makeRdapJsonForContact( contactResource, true, - Optional.empty(), + Optional.empty(), fullServletPath, rdapWhoisServer, now, diff --git a/java/google/registry/rdap/RdapEntitySearchAction.java b/java/google/registry/rdap/RdapEntitySearchAction.java index 99b816ee9..2d81f3925 100644 --- a/java/google/registry/rdap/RdapEntitySearchAction.java +++ b/java/google/registry/rdap/RdapEntitySearchAction.java @@ -27,7 +27,6 @@ import com.google.common.primitives.Booleans; import com.google.common.primitives.Longs; import com.googlecode.objectify.cmd.Query; import google.registry.model.contact.ContactResource; -import google.registry.model.domain.DesignatedContact; import google.registry.model.registrar.Registrar; import google.registry.rdap.RdapJsonFormatter.BoilerplateType; import google.registry.rdap.RdapJsonFormatter.OutputDataType; @@ -119,7 +118,7 @@ public class RdapEntitySearchAction extends RdapActionBase { jsonBuilder, BoilerplateType.ENTITY, results.getIncompletenessWarnings(), - ImmutableList.>of(), + ImmutableList.of(), fullServletPath); return jsonBuilder.build(); } @@ -219,7 +218,7 @@ public class RdapEntitySearchAction extends RdapActionBase { return makeSearchResults( ((contactResource != null) && shouldBeVisible(contactResource, now)) ? ImmutableList.of(contactResource) - : ImmutableList.of(), + : ImmutableList.of(), IncompletenessWarningType.NONE, getMatchingRegistrars(partialStringQuery.getInitialString()), now); @@ -230,7 +229,7 @@ public class RdapEntitySearchAction extends RdapActionBase { } else { ImmutableList registrars = partialStringQuery.getHasWildcard() - ? ImmutableList.of() + ? ImmutableList.of() : getMatchingRegistrars(partialStringQuery.getInitialString()); // Get the contact matches and return the results, fetching an additional contact to detect // truncation. If we are including deleted entries, we must fetch more entries, in case some @@ -257,7 +256,7 @@ public class RdapEntitySearchAction extends RdapActionBase { Optional registrar = getRegistrarByIanaIdentifier(ianaIdentifier); return (registrar.isPresent() && shouldBeVisible(registrar.get())) ? ImmutableList.of(registrar.get()) - : ImmutableList.of(); + : ImmutableList.of(); } /** @@ -310,7 +309,7 @@ public class RdapEntitySearchAction extends RdapActionBase { jsonOutputList.add(rdapJsonFormatter.makeRdapJsonForContact( contact, false, - Optional.empty(), + Optional.empty(), fullServletPath, rdapWhoisServer, now, diff --git a/java/google/registry/rdap/RdapHelpAction.java b/java/google/registry/rdap/RdapHelpAction.java index 323521380..ab20cf83a 100644 --- a/java/google/registry/rdap/RdapHelpAction.java +++ b/java/google/registry/rdap/RdapHelpAction.java @@ -65,7 +65,7 @@ public class RdapHelpAction extends RdapActionBase { builder, BoilerplateType.OTHER, ImmutableList.of(rdapJsonFormatter.getJsonHelpNotice(pathSearchString, fullServletPath)), - ImmutableList.>of(), + ImmutableList.of(), fullServletPath); return builder.build(); } diff --git a/java/google/registry/rdap/RdapIcannStandardInformation.java b/java/google/registry/rdap/RdapIcannStandardInformation.java index dab4a4f7d..976487b60 100644 --- a/java/google/registry/rdap/RdapIcannStandardInformation.java +++ b/java/google/registry/rdap/RdapIcannStandardInformation.java @@ -27,7 +27,7 @@ public class RdapIcannStandardInformation { /** Required by ICANN RDAP Profile section 1.4.10. */ private static final ImmutableMap CONFORMANCE_REMARK = - ImmutableMap.of( + ImmutableMap.of( "description", ImmutableList.of( "This response conforms to the RDAP Operational Profile for gTLD Registries and" @@ -35,7 +35,7 @@ public class RdapIcannStandardInformation { /** Required by ICANN RDAP Profile section 1.5.18. */ private static final ImmutableMap DOMAIN_STATUS_CODES_REMARK = - ImmutableMap. of( + ImmutableMap.of( "title", "EPP Status Codes", "description", @@ -51,7 +51,7 @@ public class RdapIcannStandardInformation { /** Required by ICANN RDAP Profile section 1.5.20. */ private static final ImmutableMap INACCURACY_COMPLAINT_FORM_REMARK = - ImmutableMap. of( + ImmutableMap.of( "description", ImmutableList.of( "URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf"), @@ -78,7 +78,7 @@ public class RdapIcannStandardInformation { * @see Questions about the ICANN RDAP Profile */ static final ImmutableMap SUMMARY_DATA_REMARK = - ImmutableMap. of( + ImmutableMap.of( "title", "Incomplete Data", "description", @@ -93,7 +93,7 @@ public class RdapIcannStandardInformation { * @see Questions about the ICANN RDAP Profile */ static final ImmutableMap TRUNCATED_RESULT_SET_NOTICE = - ImmutableMap. of( + ImmutableMap.of( "title", "Search Policy", "description", @@ -110,7 +110,7 @@ public class RdapIcannStandardInformation { * there were too many nameservers in the first stage results. */ static final ImmutableMap POSSIBLY_INCOMPLETE_RESULT_SET_NOTICE = - ImmutableMap.of( + ImmutableMap.of( "title", "Search Policy", "description", @@ -125,7 +125,7 @@ public class RdapIcannStandardInformation { /** Included when the requester is not logged in as the owner of the domain being returned. */ static final ImmutableMap DOMAIN_CONTACTS_HIDDEN_DATA_REMARK = - ImmutableMap. of( + ImmutableMap.of( "title", "Contacts Hidden", "description", @@ -135,7 +135,7 @@ public class RdapIcannStandardInformation { /** Included when requester is not logged in as the owner of the contact being returned. */ static final ImmutableMap CONTACT_PERSONAL_DATA_HIDDEN_DATA_REMARK = - ImmutableMap. of( + ImmutableMap.of( "title", "Contact Personal Data Hidden", "description", diff --git a/java/google/registry/rdap/RdapJsonFormatter.java b/java/google/registry/rdap/RdapJsonFormatter.java index 48ac19ee6..04fc7fbd4 100644 --- a/java/google/registry/rdap/RdapJsonFormatter.java +++ b/java/google/registry/rdap/RdapJsonFormatter.java @@ -482,7 +482,7 @@ public class RdapJsonFormatter { remarks = ImmutableList.of(RdapIcannStandardInformation.SUMMARY_DATA_REMARK); } else { remarks = displayContacts - ? ImmutableList.>of() + ? ImmutableList.of() : ImmutableList.of(RdapIcannStandardInformation.DOMAIN_CONTACTS_HIDDEN_DATA_REMARK); ImmutableList events = makeEvents(domainResource, now); if (!events.isEmpty()) { @@ -537,7 +537,7 @@ public class RdapJsonFormatter { jsonBuilder, BoilerplateType.DOMAIN, remarks, - ImmutableList.>of(), linkBase); + ImmutableList.of(), linkBase); } else if (!remarks.isEmpty()) { jsonBuilder.put(REMARKS, remarks); } @@ -633,7 +633,7 @@ public class RdapJsonFormatter { jsonBuilder, BoilerplateType.NAMESERVER, remarks, - ImmutableList.>of(), linkBase); + ImmutableList.of(), linkBase); } else if (!remarks.isEmpty()) { jsonBuilder.put(REMARKS, remarks); } @@ -735,7 +735,7 @@ public class RdapJsonFormatter { jsonBuilder, BoilerplateType.ENTITY, remarksBuilder.build(), - ImmutableList.>of(), + ImmutableList.of(), linkBase); } else { ImmutableList> remarks = remarksBuilder.build(); @@ -841,7 +841,7 @@ public class RdapJsonFormatter { jsonBuilder, BoilerplateType.ENTITY, remarks, - ImmutableList.>of(), + ImmutableList.of(), linkBase); } else if (!remarks.isEmpty()) { jsonBuilder.put(REMARKS, remarks); @@ -1036,7 +1036,7 @@ public class RdapJsonFormatter { jsonBuilder.add(nullToEmpty(address.getState())); jsonBuilder.add(nullToEmpty(address.getZip())); jsonBuilder.add(new Locale("en", address.getCountryCode()).getDisplayCountry(new Locale("en"))); - return ImmutableList.of( + return ImmutableList.of( "adr", ImmutableMap.of(), "text", @@ -1046,7 +1046,7 @@ public class RdapJsonFormatter { /** Creates a vCard phone number entry. */ private static ImmutableList makePhoneEntry( ImmutableMap> type, String phoneNumber) { - return ImmutableList.of("tel", type, "uri", phoneNumber); + return ImmutableList.of("tel", type, "uri", phoneNumber); } /** Creates a phone string in URI format, as per the vCard spec. */ @@ -1111,7 +1111,7 @@ public class RdapJsonFormatter { * RFC 7483: JSON Responses for the Registration Data Access Protocol (RDAP) */ ImmutableMap makeError(int status, String title, String description) { - return ImmutableMap.of( + return ImmutableMap.of( "rdapConformance", CONFORMANCE_LIST, "lang", "en", "errorCode", (long) status, diff --git a/java/google/registry/rdap/RdapNameserverSearchAction.java b/java/google/registry/rdap/RdapNameserverSearchAction.java index 42754ab00..ec9e27818 100644 --- a/java/google/registry/rdap/RdapNameserverSearchAction.java +++ b/java/google/registry/rdap/RdapNameserverSearchAction.java @@ -131,7 +131,7 @@ public class RdapNameserverSearchAction extends RdapActionBase { jsonBuilder, BoilerplateType.NAMESERVER, results.getIncompletenessWarnings(), - ImmutableList.>of(), + ImmutableList.of(), fullServletPath); return jsonBuilder.build(); } diff --git a/java/google/registry/rdap/RdapSearchResults.java b/java/google/registry/rdap/RdapSearchResults.java index 84f02a70f..93b42861f 100644 --- a/java/google/registry/rdap/RdapSearchResults.java +++ b/java/google/registry/rdap/RdapSearchResults.java @@ -69,6 +69,6 @@ abstract class RdapSearchResults { if (incompletenessWarningType() == IncompletenessWarningType.MIGHT_BE_INCOMPLETE) { return POSSIBLY_INCOMPLETE_NOTICES; } - return ImmutableList.>of(); + return ImmutableList.of(); } } diff --git a/java/google/registry/rde/imports/RdeImportUtils.java b/java/google/registry/rde/imports/RdeImportUtils.java index 8515d1b1a..041c09a24 100644 --- a/java/google/registry/rde/imports/RdeImportUtils.java +++ b/java/google/registry/rde/imports/RdeImportUtils.java @@ -98,7 +98,7 @@ public class RdeImportUtils { resource.getClass().getCanonicalName(), resource.getForeignKey(), resource.getRepoId()); - return ImmutableSet.of(ForeignKeyIndex.create(resource, resource.getDeletionTime()), + return ImmutableSet.of(ForeignKeyIndex.create(resource, resource.getDeletionTime()), EppResourceIndex.create(Key.create(resource))); } diff --git a/java/google/registry/rde/imports/XjcToDomainResourceConverter.java b/java/google/registry/rde/imports/XjcToDomainResourceConverter.java index 3fac19418..f107fb9d4 100644 --- a/java/google/registry/rde/imports/XjcToDomainResourceConverter.java +++ b/java/google/registry/rde/imports/XjcToDomainResourceConverter.java @@ -191,7 +191,7 @@ final class XjcToDomainResourceConverter extends XjcToEppResourceConverter { .collect(toImmutableSet())) .setDsData( domain.getSecDNS() == null - ? ImmutableSet.of() + ? ImmutableSet.of() : domain .getSecDNS() .getDsDatas() diff --git a/java/google/registry/request/Modules.java b/java/google/registry/request/Modules.java index 5d3b7d5c1..fbfe4000c 100644 --- a/java/google/registry/request/Modules.java +++ b/java/google/registry/request/Modules.java @@ -245,7 +245,7 @@ public final class Modules { // GoogleCredential constructor. We don't yet know the actual scopes to use here, and it // is thus the responsibility of every user of a delegated admin credential to call // createScoped() on it first to get the version with the correct scopes set. - .setServiceAccountScopes(ImmutableSet.of()) + .setServiceAccountScopes(ImmutableSet.of()) .setServiceAccountUser(gSuiteAdminAccountEmailAddress) .build(); } diff --git a/java/google/registry/request/RequestParameters.java b/java/google/registry/request/RequestParameters.java index 4b2f1f947..5b8882f6b 100644 --- a/java/google/registry/request/RequestParameters.java +++ b/java/google/registry/request/RequestParameters.java @@ -70,7 +70,7 @@ public final class RequestParameters { String stringParam = req.getParameter(name); try { return isNullOrEmpty(stringParam) - ? Optional.empty() + ? Optional.empty() : Optional.of(Integer.valueOf(stringParam)); } catch (NumberFormatException e) { throw new BadRequestException("Expected integer: " + name); @@ -93,7 +93,7 @@ public final class RequestParameters { /** Returns all GET or POST parameters associated with {@code name}. */ public static ImmutableSet extractSetOfParameters(HttpServletRequest req, String name) { String[] parameters = req.getParameterValues(name); - return parameters == null ? ImmutableSet.of() : ImmutableSet.copyOf(parameters); + return parameters == null ? ImmutableSet.of() : ImmutableSet.copyOf(parameters); } /** @@ -135,7 +135,7 @@ public final class RequestParameters { HttpServletRequest req, String name) { String stringParam = req.getParameter(name); return isNullOrEmpty(stringParam) - ? Optional.empty() + ? Optional.empty() : Optional.of(Boolean.valueOf(stringParam)); } @@ -179,7 +179,7 @@ public final class RequestParameters { String stringParam = req.getParameter(name); try { return isNullOrEmpty(stringParam) - ? Optional.empty() + ? Optional.empty() : Optional.of(DateTime.parse(stringParam)); } catch (IllegalArgumentException e) { throw new BadRequestException("Bad ISO 8601 timestamp: " + name); @@ -198,7 +198,7 @@ public final class RequestParameters { HttpServletRequest req, String name) { String[] stringParams = req.getParameterValues(name); if (stringParams == null) { - return ImmutableSet.of(); + return ImmutableSet.of(); } ImmutableSet.Builder datesBuilder = new ImmutableSet.Builder<>(); for (String stringParam : stringParams) { diff --git a/java/google/registry/request/auth/AuthModule.java b/java/google/registry/request/auth/AuthModule.java index 53f5cb67b..e2022cd7b 100644 --- a/java/google/registry/request/auth/AuthModule.java +++ b/java/google/registry/request/auth/AuthModule.java @@ -30,7 +30,7 @@ public class AuthModule { @Provides ImmutableList provideApiAuthenticationMechanisms( OAuthAuthenticationMechanism oauthAuthenticationMechanism) { - return ImmutableList.of( + return ImmutableList.of( oauthAuthenticationMechanism); } diff --git a/java/google/registry/request/auth/AuthResult.java b/java/google/registry/request/auth/AuthResult.java index c9e0ac4ec..d64b23c34 100644 --- a/java/google/registry/request/auth/AuthResult.java +++ b/java/google/registry/request/auth/AuthResult.java @@ -37,7 +37,7 @@ public abstract class AuthResult { } public static AuthResult create(AuthLevel authLevel) { - return new AutoValue_AuthResult(authLevel, Optional.empty()); + return new AutoValue_AuthResult(authLevel, Optional.empty()); } public static AuthResult create(AuthLevel authLevel, @Nullable UserAuthInfo userAuthInfo) { diff --git a/java/google/registry/request/auth/UserAuthInfo.java b/java/google/registry/request/auth/UserAuthInfo.java index 1b160466a..e5383b23f 100644 --- a/java/google/registry/request/auth/UserAuthInfo.java +++ b/java/google/registry/request/auth/UserAuthInfo.java @@ -39,7 +39,7 @@ public abstract class UserAuthInfo { public static UserAuthInfo create( User user, boolean isUserAdmin) { - return new AutoValue_UserAuthInfo(user, isUserAdmin, Optional.empty()); + return new AutoValue_UserAuthInfo(user, isUserAdmin, Optional.empty()); } public static UserAuthInfo create( diff --git a/java/google/registry/security/JsonResponseHelper.java b/java/google/registry/security/JsonResponseHelper.java index 96e84c169..ff7dc1ede 100644 --- a/java/google/registry/security/JsonResponseHelper.java +++ b/java/google/registry/security/JsonResponseHelper.java @@ -33,7 +33,7 @@ public final class JsonResponseHelper { /** Creates a JSON response message securely to the browser client with a parser breaker. */ public static ImmutableMap create( Status status, String message, Iterable> results) { - return ImmutableMap.of( + return ImmutableMap.of( "status", status.toString(), "message", checkNotNull(message, "message"), "results", ImmutableList.copyOf(results)); @@ -41,7 +41,7 @@ public final class JsonResponseHelper { /** Same as {@link #create(Status, String, Iterable)} but with zero results. */ public static ImmutableMap create(Status status, String message) { - return create(status, message, ImmutableList.>of()); + return create(status, message, ImmutableList.of()); } /** Same as {@link #create(Status, String, Iterable)} but with only one results. */ @@ -53,7 +53,7 @@ public final class JsonResponseHelper { /** Creates a JSON response message when a submitted form field is invalid. */ public static ImmutableMap createFormFieldError( String message, String formFieldName) { - return ImmutableMap.of( + return ImmutableMap.of( "status", Status.ERROR.toString(), "message", checkNotNull(message, "message"), "field", checkNotNull(formFieldName, "formFieldName"), diff --git a/java/google/registry/tldconfig/idn/IdnTable.java b/java/google/registry/tldconfig/idn/IdnTable.java index e8df114b3..43a96d3ad 100644 --- a/java/google/registry/tldconfig/idn/IdnTable.java +++ b/java/google/registry/tldconfig/idn/IdnTable.java @@ -122,7 +122,7 @@ public final class IdnTable { } int codepoint = readCodepoint(line); - rangeSet.add(Range.singleton(codepoint)); + rangeSet.add(Range.singleton(codepoint)); } return new IdnTable(language, url, policy, rangeSet.build(), languageValidator); } diff --git a/java/google/registry/tldconfig/idn/JapaneseLanguageValidator.java b/java/google/registry/tldconfig/idn/JapaneseLanguageValidator.java index da5277f62..f2584bd10 100644 --- a/java/google/registry/tldconfig/idn/JapaneseLanguageValidator.java +++ b/java/google/registry/tldconfig/idn/JapaneseLanguageValidator.java @@ -53,9 +53,9 @@ class JapaneseLanguageValidator extends LanguageValidator { */ private static final ImmutableRangeSet JAPANESE_EXCEPTION_CODEPOINTS = new ImmutableRangeSet.Builder() - .add(Range.singleton(IDEOGRAPHIC_CLOSING_MARK)) - .add(Range.singleton(KATAKANA_MIDDLE_DOT)) - .add(Range.singleton(KATAKANA_HIRAGANA_PROLONGED_SOUND_MARK)) + .add(Range.singleton(IDEOGRAPHIC_CLOSING_MARK)) + .add(Range.singleton(KATAKANA_MIDDLE_DOT)) + .add(Range.singleton(KATAKANA_HIRAGANA_PROLONGED_SOUND_MARK)) .build(); @Override diff --git a/java/google/registry/tldconfig/idn/LanguageValidator.java b/java/google/registry/tldconfig/idn/LanguageValidator.java index af3608f32..f8d27462d 100644 --- a/java/google/registry/tldconfig/idn/LanguageValidator.java +++ b/java/google/registry/tldconfig/idn/LanguageValidator.java @@ -21,7 +21,7 @@ abstract class LanguageValidator { /** A registry of all known language validators keyed by their language code. */ private static final ImmutableMap LANGUAGE_VALIDATORS = - ImmutableMap.of("ja", new JapaneseLanguageValidator()); + ImmutableMap.of("ja", new JapaneseLanguageValidator()); /** Return the language validator for the given language code (if one exists). */ static Optional get(String language) { diff --git a/java/google/registry/tmch/TmchCrlAction.java b/java/google/registry/tmch/TmchCrlAction.java index af9dcde16..a67e6190c 100644 --- a/java/google/registry/tmch/TmchCrlAction.java +++ b/java/google/registry/tmch/TmchCrlAction.java @@ -45,7 +45,7 @@ public final class TmchCrlAction implements Runnable { public void run() { try { tmchCertificateAuthority.updateCrl( - new String(marksdb.fetch(tmchCrlUrl, Optional.empty()), UTF_8), + new String(marksdb.fetch(tmchCrlUrl, Optional.empty()), UTF_8), tmchCrlUrl.toString()); } catch (IOException | GeneralSecurityException e) { throw new RuntimeException("Failed to update ICANN TMCH CRL.", e); diff --git a/java/google/registry/tools/AppEngineConnection.java b/java/google/registry/tools/AppEngineConnection.java index 89f16a757..69101fb5a 100644 --- a/java/google/registry/tools/AppEngineConnection.java +++ b/java/google/registry/tools/AppEngineConnection.java @@ -129,7 +129,7 @@ class AppEngineConnection implements Connection { public Map sendJson(String endpoint, Map object) throws IOException { String response = send( endpoint, - ImmutableMap.of(), + ImmutableMap.of(), JSON_UTF_8, JSONValue.toJSONString(object).getBytes(UTF_8)); return (Map) JSONValue.parse(response.substring(JSON_SAFETY_PREFIX.length())); diff --git a/java/google/registry/tools/CreateTldCommand.java b/java/google/registry/tools/CreateTldCommand.java index 78edf5179..a4fc9c4c1 100644 --- a/java/google/registry/tools/CreateTldCommand.java +++ b/java/google/registry/tools/CreateTldCommand.java @@ -109,6 +109,6 @@ class CreateTldCommand extends CreateOrUpdateTldCommand { Optional> getTldStateTransitionToAdd() { return initialTldState != null ? Optional.of(Maps.immutableEntry(START_OF_TIME, initialTldState)) - : Optional.>empty(); + : Optional.empty(); } } diff --git a/java/google/registry/tools/GenerateAuctionDataCommand.java b/java/google/registry/tools/GenerateAuctionDataCommand.java index 99e168084..738ef8bd6 100644 --- a/java/google/registry/tools/GenerateAuctionDataCommand.java +++ b/java/google/registry/tools/GenerateAuctionDataCommand.java @@ -192,7 +192,7 @@ final class GenerateAuctionDataCommand implements RemoteApiCommand { Optional address = Optional.ofNullable(postalInfo.isPresent() ? postalInfo.get().getAddress() : null); List street = - address.isPresent() ? address.get().getStreet() : ImmutableList.of(); + address.isPresent() ? address.get().getStreet() : ImmutableList.of(); Optional phoneNumber = Optional.ofNullable(registrant.getVoiceNumber()); // Each line containing an auction participant has the following format: @@ -235,7 +235,7 @@ final class GenerateAuctionDataCommand implements RemoteApiCommand { Optional.ofNullable(registrar.getLocalizedAddress()) .orElse(registrar.getInternationalizedAddress())); List street = - address.isPresent() ? address.get().getStreet() : ImmutableList.of(); + address.isPresent() ? address.get().getStreet() : ImmutableList.of(); // Each line containing the registrar of an auction participant has the following format: // diff --git a/java/google/registry/tools/GetSchemaTreeCommand.java b/java/google/registry/tools/GetSchemaTreeCommand.java index 592f9ad3f..50765d995 100644 --- a/java/google/registry/tools/GetSchemaTreeCommand.java +++ b/java/google/registry/tools/GetSchemaTreeCommand.java @@ -99,7 +99,7 @@ final class GetSchemaTreeCommand implements Command { // Build up the superclass to subclass mapping. superclassToSubclasses = Multimaps.invertFrom( Multimaps.forMap(subclassToSuperclass), - TreeMultimap., Class>create(arbitrary(), new PrintableNameOrdering())); + TreeMultimap.create(arbitrary(), new PrintableNameOrdering())); printTree(Object.class, 0); } diff --git a/java/google/registry/tools/ListDomainsCommand.java b/java/google/registry/tools/ListDomainsCommand.java index 30638974c..dcfab9998 100644 --- a/java/google/registry/tools/ListDomainsCommand.java +++ b/java/google/registry/tools/ListDomainsCommand.java @@ -44,6 +44,6 @@ final class ListDomainsCommand extends ListObjectsCommand { ImmutableMap getParameterMap() { String tldsParam = Joiner.on(',').join(tlds); checkArgument(tldsParam.length() < 1024, "Total length of TLDs is too long for URL parameter"); - return ImmutableMap.of("tlds", tldsParam); + return ImmutableMap.of("tlds", tldsParam); } } diff --git a/java/google/registry/tools/RegistryToolEnvironment.java b/java/google/registry/tools/RegistryToolEnvironment.java index 2ae018cce..78e4ffcd1 100644 --- a/java/google/registry/tools/RegistryToolEnvironment.java +++ b/java/google/registry/tools/RegistryToolEnvironment.java @@ -48,7 +48,7 @@ enum RegistryToolEnvironment { } private RegistryToolEnvironment(RegistryEnvironment actualEnvironment) { - this(actualEnvironment, ImmutableMap.of()); + this(actualEnvironment, ImmutableMap.of()); } /** diff --git a/java/google/registry/tools/SetupOteCommand.java b/java/google/registry/tools/SetupOteCommand.java index f6fb6955f..f01403a72 100644 --- a/java/google/registry/tools/SetupOteCommand.java +++ b/java/google/registry/tools/SetupOteCommand.java @@ -201,16 +201,16 @@ final class SetupOteCommand extends ConfirmingCommand implements RemoteApiComman // Storing names and credentials in a list of tuples for later play-back. List> registrars = new ArrayList<>(); - registrars.add(ImmutableList.of( + registrars.add(ImmutableList.of( registrar + "-1", passwordGenerator.createString(PASSWORD_LENGTH), registrar + "-sunrise")); - registrars.add(ImmutableList.of( + registrars.add(ImmutableList.of( registrar + "-2", passwordGenerator.createString(PASSWORD_LENGTH), registrar + "-landrush")); - registrars.add(ImmutableList.of( + registrars.add(ImmutableList.of( registrar + "-3", passwordGenerator.createString(PASSWORD_LENGTH), registrar + "-ga")); - registrars.add(ImmutableList.of( + registrars.add(ImmutableList.of( registrar + "-4", passwordGenerator.createString(PASSWORD_LENGTH), registrar + "-ga")); diff --git a/java/google/registry/tools/UpdateTldCommand.java b/java/google/registry/tools/UpdateTldCommand.java index f39e74233..672e499ff 100644 --- a/java/google/registry/tools/UpdateTldCommand.java +++ b/java/google/registry/tools/UpdateTldCommand.java @@ -123,7 +123,7 @@ class UpdateTldCommand extends CreateOrUpdateTldCommand { Optional> getTldStateTransitionToAdd() { return setCurrentTldState != null ? Optional.of(Maps.immutableEntry(DateTime.now(DateTimeZone.UTC), setCurrentTldState)) - : Optional.>empty(); + : Optional.empty(); } @Override diff --git a/java/google/registry/tools/params/EnumParameter.java b/java/google/registry/tools/params/EnumParameter.java index cbe4032aa..1635d180f 100644 --- a/java/google/registry/tools/params/EnumParameter.java +++ b/java/google/registry/tools/params/EnumParameter.java @@ -25,6 +25,6 @@ public abstract class EnumParameter> extends ParameterConverte @Override public T convert(String value) { - return Enum.valueOf(new TypeInstantiator(getClass()){}.getExactType(), value); + return Enum.valueOf(new TypeInstantiator(getClass()){}.getExactType(), value); } } diff --git a/java/google/registry/tools/server/GenerateZoneFilesAction.java b/java/google/registry/tools/server/GenerateZoneFilesAction.java index b9bfc98bd..ccde1dc3f 100644 --- a/java/google/registry/tools/server/GenerateZoneFilesAction.java +++ b/java/google/registry/tools/server/GenerateZoneFilesAction.java @@ -150,7 +150,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA String.format( GCS_PATH_FORMAT, bucket, String.format(FILENAME_FORMAT, tld, exportTime))) .collect(toImmutableList()); - return ImmutableMap.of( + return ImmutableMap.of( "jobPath", createJobPath(jobId), "filenames", filenames); } diff --git a/java/google/registry/tools/server/ListObjectsAction.java b/java/google/registry/tools/server/ListObjectsAction.java index 79d41dc9d..d05bfe093 100644 --- a/java/google/registry/tools/server/ListObjectsAction.java +++ b/java/google/registry/tools/server/ListObjectsAction.java @@ -236,7 +236,7 @@ public abstract class ListObjectsAction implements Ru if (isHeaderRowInUse(data)) { // Add a row of headers (column names mapping to themselves). Map headerRow = - Maps.asMap(data.columnKeySet(), Functions.identity()); + Maps.asMap(data.columnKeySet(), Functions.identity()); lines.add(rowFormatter.apply(headerRow)); // Add a row of separator lines (column names mapping to '-' * column width). diff --git a/java/google/registry/tools/server/ResaveAllHistoryEntriesAction.java b/java/google/registry/tools/server/ResaveAllHistoryEntriesAction.java index 42f65d9f4..93fe5aa03 100644 --- a/java/google/registry/tools/server/ResaveAllHistoryEntriesAction.java +++ b/java/google/registry/tools/server/ResaveAllHistoryEntriesAction.java @@ -58,8 +58,8 @@ public class ResaveAllHistoryEntriesAction implements Runnable { .runMapOnly( new ResaveAllHistoryEntriesActionMapper(), ImmutableList.of(EppResourceInputs.createChildEntityInput( - ImmutableSet.>of(EppResource.class), - ImmutableSet.>of(HistoryEntry.class)))))); + ImmutableSet.of(EppResource.class), + ImmutableSet.of(HistoryEntry.class)))))); } /** Mapper to re-save all HistoryEntry entities. */ diff --git a/java/google/registry/tools/server/ToolsServerModule.java b/java/google/registry/tools/server/ToolsServerModule.java index 8dfd3a2bf..95f87e55b 100644 --- a/java/google/registry/tools/server/ToolsServerModule.java +++ b/java/google/registry/tools/server/ToolsServerModule.java @@ -49,7 +49,7 @@ public class ToolsServerModule { @Parameter("fullFieldNames") static Optional provideFullFieldNames(HttpServletRequest req) { String s = emptyToNull(req.getParameter(ListObjectsAction.FULL_FIELD_NAMES_PARAM)); - return (s == null) ? Optional.empty() : Optional.of(Boolean.parseBoolean(s)); + return (s == null) ? Optional.empty() : Optional.of(Boolean.parseBoolean(s)); } @Provides @@ -74,7 +74,7 @@ public class ToolsServerModule { @Parameter("printHeaderRow") static Optional providePrintHeaderRow(HttpServletRequest req) { String s = emptyToNull(req.getParameter(ListObjectsAction.PRINT_HEADER_ROW_PARAM)); - return (s == null) ? Optional.empty() : Optional.of(Boolean.parseBoolean(s)); + return (s == null) ? Optional.empty() : Optional.of(Boolean.parseBoolean(s)); } @Provides diff --git a/java/google/registry/tools/server/VerifyOteAction.java b/java/google/registry/tools/server/VerifyOteAction.java index c9be6de90..af3c370a2 100644 --- a/java/google/registry/tools/server/VerifyOteAction.java +++ b/java/google/registry/tools/server/VerifyOteAction.java @@ -177,7 +177,7 @@ public class VerifyOteAction implements Runnable, JsonAction { HOST_CREATES_SUBORDINATE(1, equalTo(Type.HOST_CREATE), IS_SUBORDINATE), HOST_DELETES(1, equalTo(Type.HOST_DELETE)), HOST_UPDATES(1, equalTo(Type.HOST_UPDATE)), - UNCLASSIFIED_FLOWS(0, Predicates.alwaysFalse()); + UNCLASSIFIED_FLOWS(0, Predicates.alwaysFalse()); /** The number of StatTypes with a non-zero requirement. */ private static final int NUM_REQUIREMENTS = @@ -205,7 +205,7 @@ public class VerifyOteAction implements Runnable, JsonAction { this.requirement = requirement; this.typeFilter = typeFilter; if (eppInputFilter == null) { - this.eppInputFilter = Optional.>empty(); + this.eppInputFilter = Optional.empty(); } else { this.eppInputFilter = Optional.of(eppInputFilter); } @@ -260,7 +260,7 @@ public class VerifyOteAction implements Runnable, JsonAction { // xmlBytes can be null on contact create and update for safe-harbor compliance. final Optional eppInput = (xmlBytes == null) - ? Optional.empty() + ? Optional.empty() : Optional.of(unmarshal(EppInput.class, xmlBytes)); if (!statCounts.addAll( EnumSet.allOf(StatType.class) diff --git a/java/google/registry/ui/forms/FormField.java b/java/google/registry/ui/forms/FormField.java index 80893ac50..d6e34d0d5 100644 --- a/java/google/registry/ui/forms/FormField.java +++ b/java/google/registry/ui/forms/FormField.java @@ -137,7 +137,7 @@ public final class FormField { /** Returns an optional form field named {@code name} with a specific {@code inputType}. */ public static Builder named(String name, Class typeIn) { checkArgument(!name.isEmpty()); - return new Builder<>(name, checkNotNull(typeIn), typeIn, Functions.identity()); + return new Builder<>(name, checkNotNull(typeIn), typeIn, Functions.identity()); } /** diff --git a/java/google/registry/ui/server/registrar/RegistrarSettingsAction.java b/java/google/registry/ui/server/registrar/RegistrarSettingsAction.java index 840e874d5..19f15041e 100644 --- a/java/google/registry/ui/server/registrar/RegistrarSettingsAction.java +++ b/java/google/registry/ui/server/registrar/RegistrarSettingsAction.java @@ -43,7 +43,6 @@ import google.registry.security.JsonResponseHelper; import google.registry.ui.forms.FormException; import google.registry.ui.forms.FormFieldException; import google.registry.ui.server.RegistrarFormFields; -import google.registry.util.CidrAddressBlock; import google.registry.util.CollectionUtils; import google.registry.util.DiffUtils; import java.util.HashSet; @@ -192,7 +191,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA builder.setIpAddressWhitelist( RegistrarFormFields.IP_ADDRESS_WHITELIST_FIELD .extractUntyped(args) - .orElse(ImmutableList.of())); + .orElse(ImmutableList.of())); RegistrarFormFields.CLIENT_CERTIFICATE_FIELD .extractUntyped(args) .ifPresent( diff --git a/java/google/registry/util/CollectionUtils.java b/java/google/registry/util/CollectionUtils.java index 8941836b4..a2fc07905 100644 --- a/java/google/registry/util/CollectionUtils.java +++ b/java/google/registry/util/CollectionUtils.java @@ -85,28 +85,28 @@ public class CollectionUtils { /** Defensive copy helper for {@link Set}. */ public static ImmutableSet nullToEmptyImmutableCopy(Set data) { - return data == null ? ImmutableSet.of() : ImmutableSet.copyOf(data); + return data == null ? ImmutableSet.of() : ImmutableSet.copyOf(data); } /** Defensive copy helper for {@link Set}. */ public static > ImmutableSortedSet nullToEmptyImmutableSortedCopy(Set data) { - return data == null ? ImmutableSortedSet.of() : ImmutableSortedSet.copyOf(data); + return data == null ? ImmutableSortedSet.of() : ImmutableSortedSet.copyOf(data); } /** Defensive copy helper for {@link SortedMap}. */ public static ImmutableSortedMap nullToEmptyImmutableCopy(SortedMap data) { - return data == null ? ImmutableSortedMap.of() : ImmutableSortedMap.copyOfSorted(data); + return data == null ? ImmutableSortedMap.of() : ImmutableSortedMap.copyOfSorted(data); } /** Defensive copy helper for {@link List}. */ public static ImmutableList nullToEmptyImmutableCopy(List data) { - return data == null ? ImmutableList.of() : ImmutableList.copyOf(data); + return data == null ? ImmutableList.of() : ImmutableList.copyOf(data); } /** Defensive copy helper for {@link Map}. */ public static ImmutableMap nullToEmptyImmutableCopy(Map data) { - return data == null ? ImmutableMap.of() : ImmutableMap.copyOf(data); + return data == null ? ImmutableMap.of() : ImmutableMap.copyOf(data); } /** diff --git a/java/google/registry/util/SqlTemplate.java b/java/google/registry/util/SqlTemplate.java index 752347b83..aae550a88 100644 --- a/java/google/registry/util/SqlTemplate.java +++ b/java/google/registry/util/SqlTemplate.java @@ -42,7 +42,7 @@ public final class SqlTemplate { /** Returns a new immutable SQL template builder object, for query parameter substitution. */ public static SqlTemplate create(String template) { - return new SqlTemplate(template, ImmutableMap.of()); + return new SqlTemplate(template, ImmutableMap.of()); } /** diff --git a/java/google/registry/util/X509Utils.java b/java/google/registry/util/X509Utils.java index 0a3ea1ffd..17950eec7 100644 --- a/java/google/registry/util/X509Utils.java +++ b/java/google/registry/util/X509Utils.java @@ -35,7 +35,6 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.CertificateParsingException; import java.security.cert.CertificateRevokedException; -import java.security.cert.Extension; import java.security.cert.X509CRL; import java.security.cert.X509CRLEntry; import java.security.cert.X509Certificate; @@ -149,7 +148,7 @@ public final class X509Utils { checkNotNull(entry.getRevocationDate(), "revocationDate"), checkNotNull(entry.getRevocationReason(), "revocationReason"), firstNonNull(entry.getCertificateIssuer(), crl.getIssuerX500Principal()), - ImmutableMap.of()); + ImmutableMap.of()); } } diff --git a/java/google/registry/whois/DomainLookupCommand.java b/java/google/registry/whois/DomainLookupCommand.java index 46986f331..72df2a2a3 100644 --- a/java/google/registry/whois/DomainLookupCommand.java +++ b/java/google/registry/whois/DomainLookupCommand.java @@ -32,7 +32,7 @@ public class DomainLookupCommand extends DomainOrHostLookupCommand { protected Optional getResponse(InternetDomainName domainName, DateTime now) { final DomainResource domainResource = loadByForeignKey(DomainResource.class, domainName.toString(), now); - return Optional.ofNullable( + return Optional.ofNullable( domainResource == null ? null : new DomainWhoisResponse(domainResource, now)); } } diff --git a/java/google/registry/whois/NameserverLookupByHostCommand.java b/java/google/registry/whois/NameserverLookupByHostCommand.java index ec9636ab6..8eed80dcf 100644 --- a/java/google/registry/whois/NameserverLookupByHostCommand.java +++ b/java/google/registry/whois/NameserverLookupByHostCommand.java @@ -32,7 +32,7 @@ public class NameserverLookupByHostCommand extends DomainOrHostLookupCommand { protected Optional getResponse(InternetDomainName hostName, DateTime now) { final HostResource hostResource = loadByForeignKey(HostResource.class, hostName.toString(), now); - return Optional.ofNullable( + return Optional.ofNullable( hostResource == null ? null : new NameserverWhoisResponse(hostResource, now)); } } diff --git a/java/google/registry/xml/XmlTransformer.java b/java/google/registry/xml/XmlTransformer.java index c142873b5..cd1fae70c 100644 --- a/java/google/registry/xml/XmlTransformer.java +++ b/java/google/registry/xml/XmlTransformer.java @@ -240,7 +240,7 @@ public class XmlTransformer { */ public void marshalStrict(Object root, Result result) throws XmlException { try { - getMarshaller(schema, ImmutableMap.of()) + getMarshaller(schema, ImmutableMap.of()) .marshal(checkNotNull(root, "root"), checkNotNull(result, "result")); } catch (JAXBException e) { throw new XmlException(e); diff --git a/javatests/google/registry/batch/DeleteProberDataActionTest.java b/javatests/google/registry/batch/DeleteProberDataActionTest.java index 006aa798a..c1d7d1064 100644 --- a/javatests/google/registry/batch/DeleteProberDataActionTest.java +++ b/javatests/google/registry/batch/DeleteProberDataActionTest.java @@ -116,7 +116,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase ibEntities = persistLotsOfDomains("ib-any.test"); runMapreduce(); assertDeleted(ibEntities); - assertNotDeleted(ImmutableSet.of(nic, fkiNic)); + assertNotDeleted(ImmutableSet.of(nic, fkiNic)); } @Test @@ -254,7 +254,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCaseof( + return ImmutableSet.of( domain, historyEntry, billingEvent, pollMessage, fki, eppIndex); } diff --git a/javatests/google/registry/batch/MapreduceEntityCleanupActionTest.java b/javatests/google/registry/batch/MapreduceEntityCleanupActionTest.java index 955cd7403..aed27f780 100644 --- a/javatests/google/registry/batch/MapreduceEntityCleanupActionTest.java +++ b/javatests/google/registry/batch/MapreduceEntityCleanupActionTest.java @@ -265,7 +265,7 @@ public class MapreduceEntityCleanupActionTest createMapreduce("jobname"); executeTasksUntilEmpty(QUEUE_NAME, clock); setJobIdJobNameAndDaysOld( - Optional.empty(), Optional.empty(), Optional.empty()); + Optional.empty(), Optional.empty(), Optional.empty()); action.run(); @@ -349,11 +349,11 @@ public class MapreduceEntityCleanupActionTest executeTasksUntilEmpty(QUEUE_NAME, clock); clock.setTo(DateTime.now(UTC)); action = new MapreduceEntityCleanupAction( - Optional.empty(), // jobId - Optional.empty(), // jobName - Optional.of(1), // numJobsToDelete - Optional.of(0), // daysOld - Optional.empty(), // force + Optional.empty(), // jobId + Optional.empty(), // jobName + Optional.of(1), // numJobsToDelete + Optional.of(0), // daysOld + Optional.empty(), // force mapreduceEntityCleanupUtil, clock, DatastoreServiceFactory.getDatastoreService(), @@ -428,10 +428,10 @@ public class MapreduceEntityCleanupActionTest clock.setTo(DateTime.now(UTC)); action = new MapreduceEntityCleanupAction( Optional.of(jobId2), // jobId - Optional.empty(), // jobName - Optional.empty(), // numJobsToDelete - Optional.empty(), // daysOld - Optional.empty(), // force + Optional.empty(), // jobName + Optional.empty(), // numJobsToDelete + Optional.empty(), // daysOld + Optional.empty(), // force mapreduceEntityCleanupUtil, clock, DatastoreServiceFactory.getDatastoreService(), @@ -453,7 +453,7 @@ public class MapreduceEntityCleanupActionTest @Test public void testDeleteOfRunningJob_fails() throws Exception { String jobId = createMapreduce("jobname"); - executeTasks(QUEUE_NAME, clock, Optional.of(10)); + executeTasks(QUEUE_NAME, clock, Optional.of(10)); setJobId(jobId); action.run(); @@ -469,13 +469,13 @@ public class MapreduceEntityCleanupActionTest @Test public void testDeleteOfRunningJob_succeedsWithForce() throws Exception { String jobId = createMapreduce("jobname"); - executeTasks(QUEUE_NAME, clock, Optional.of(10)); + executeTasks(QUEUE_NAME, clock, Optional.of(10)); clock.setTo(DateTime.now(UTC)); action = new MapreduceEntityCleanupAction( Optional.of(jobId), - Optional.empty(), // jobName - Optional.empty(), // numJobsToDelete - Optional.empty(), // daysOld + Optional.empty(), // jobName + Optional.empty(), // numJobsToDelete + Optional.empty(), // daysOld Optional.of(true), // force mapreduceEntityCleanupUtil, clock, @@ -497,7 +497,7 @@ public class MapreduceEntityCleanupActionTest @Test public void testJobIdAndJobName_fails() throws Exception { setJobIdJobNameAndDaysOld( - Optional.of("jobid"), Optional.of("jobname"), Optional.empty()); + Optional.of("jobid"), Optional.of("jobname"), Optional.empty()); action.run(); @@ -509,7 +509,7 @@ public class MapreduceEntityCleanupActionTest @Test public void testJobIdAndDaysOld_fails() throws Exception { - setJobIdJobNameAndDaysOld(Optional.of("jobid"), Optional.empty(), Optional.of(0)); + setJobIdJobNameAndDaysOld(Optional.of("jobid"), Optional.empty(), Optional.of(0)); action.run(); @@ -524,10 +524,10 @@ public class MapreduceEntityCleanupActionTest public void testJobIdAndNumJobs_fails() throws Exception { action = new MapreduceEntityCleanupAction( Optional.of("jobid"), - Optional.empty(), // jobName + Optional.empty(), // jobName Optional.of(1), // numJobsToDelete - Optional.empty(), // daysOld - Optional.empty(), // force + Optional.empty(), // daysOld + Optional.empty(), // force mapreduceEntityCleanupUtil, clock, DatastoreServiceFactory.getDatastoreService(), @@ -545,11 +545,11 @@ public class MapreduceEntityCleanupActionTest @Test public void testDeleteZeroJobs_throwsUsageError() throws Exception { new MapreduceEntityCleanupAction( - Optional.empty(), // jobId - Optional.empty(), // jobName - Optional.of(0), // numJobsToDelete - Optional.empty(), // daysOld - Optional.empty(), // force + Optional.empty(), // jobId + Optional.empty(), // jobName + Optional.of(0), // numJobsToDelete + Optional.empty(), // daysOld + Optional.empty(), // force mapreduceEntityCleanupUtil, clock, DatastoreServiceFactory.getDatastoreService(), diff --git a/javatests/google/registry/cron/TldFanoutActionTest.java b/javatests/google/registry/cron/TldFanoutActionTest.java index 0e18832eb..12ab330fd 100644 --- a/javatests/google/registry/cron/TldFanoutActionTest.java +++ b/javatests/google/registry/cron/TldFanoutActionTest.java @@ -86,7 +86,7 @@ public class TldFanoutActionTest { action.queue = getLast(params.get("queue")); action.excludes = params.containsKey("exclude") ? ImmutableSet.copyOf(Splitter.on(',').split(params.get("exclude").get(0))) - : ImmutableSet.of(); + : ImmutableSet.of(); action.taskEnqueuer = new TaskEnqueuer(new Retrier(null, 1)); action.response = response; action.runInEmpty = params.containsKey("runInEmpty"); diff --git a/javatests/google/registry/dns/PublishDnsUpdatesActionTest.java b/javatests/google/registry/dns/PublishDnsUpdatesActionTest.java index 4b89d5108..b2da322ec 100644 --- a/javatests/google/registry/dns/PublishDnsUpdatesActionTest.java +++ b/javatests/google/registry/dns/PublishDnsUpdatesActionTest.java @@ -84,8 +84,8 @@ public class PublishDnsUpdatesActionTest { PublishDnsUpdatesAction action = new PublishDnsUpdatesAction(); action.timeout = Duration.standardSeconds(10); action.tld = tld; - action.hosts = ImmutableSet.of(); - action.domains = ImmutableSet.of(); + action.hosts = ImmutableSet.of(); + action.domains = ImmutableSet.of(); action.dnsWriter = "mock"; action.dnsWriterProxy = new DnsWriterProxy(ImmutableMap.of("mock", dnsWriter)); action.dnsMetrics = dnsMetrics; diff --git a/javatests/google/registry/dns/writer/clouddns/CloudDnsWriterTest.java b/javatests/google/registry/dns/writer/clouddns/CloudDnsWriterTest.java index 8792e2c52..cb5c6177a 100644 --- a/javatests/google/registry/dns/writer/clouddns/CloudDnsWriterTest.java +++ b/javatests/google/registry/dns/writer/clouddns/CloudDnsWriterTest.java @@ -32,7 +32,6 @@ import com.google.api.services.dns.model.Change; import com.google.api.services.dns.model.ResourceRecordSet; import com.google.api.services.dns.model.ResourceRecordSetsListResponse; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; import com.google.common.net.InetAddresses; @@ -305,12 +304,12 @@ public class CloudDnsWriterTest { public void testLoadDomain_nonExistentDomain() throws Exception { writer.publishDomain("example.tld"); - verifyZone(ImmutableSet.of()); + verifyZone(ImmutableSet.of()); } @Test public void testLoadDomain_noDsDataOrNameservers() throws Exception { - persistResource(fakeDomain("example.tld", ImmutableSet.of(), 0)); + persistResource(fakeDomain("example.tld", ImmutableSet.of(), 0)); writer.publishDomain("example.tld"); verifyZone(fakeDomainRecords("example.tld", 0, 0, 0, 0)); @@ -319,7 +318,7 @@ public class CloudDnsWriterTest { @Test public void testLoadDomain_deleteOldData() throws Exception { stubZone = fakeDomainRecords("example.tld", 2, 2, 2, 2); - persistResource(fakeDomain("example.tld", ImmutableSet.of(), 0)); + persistResource(fakeDomain("example.tld", ImmutableSet.of(), 0)); writer.publishDomain("example.tld"); verifyZone(fakeDomainRecords("example.tld", 0, 0, 0, 0)); @@ -378,7 +377,7 @@ public class CloudDnsWriterTest { writer.publishHost("ns1.example.com"); // external hosts should not be published in our zone - verifyZone(ImmutableSet.of()); + verifyZone(ImmutableSet.of()); } @Test @@ -409,7 +408,7 @@ public class CloudDnsWriterTest { CloudDnsWriter spyWriter = spy(writer); when(mutateZoneCallable.call()).thenThrow(ZoneStateException.class).thenReturn(null); when(spyWriter.getMutateZoneCallback( - Matchers.>>any())) + Matchers.any())) .thenReturn(mutateZoneCallable); spyWriter.commit(); @@ -428,7 +427,7 @@ public class CloudDnsWriterTest { .build()); writer.publishDomain("example.tld"); - verifyZone(ImmutableSet.of()); + verifyZone(ImmutableSet.of()); } @Test @@ -444,7 +443,7 @@ public class CloudDnsWriterTest { writer.publishDomain("example.tld"); - verifyZone(ImmutableSet.of()); + verifyZone(ImmutableSet.of()); } @Test @@ -459,7 +458,7 @@ public class CloudDnsWriterTest { .build()); writer.publishDomain("example.tld"); - verifyZone(ImmutableSet.of()); + verifyZone(ImmutableSet.of()); } @Test diff --git a/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java index 1ae33918c..2fa0df962 100644 --- a/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java @@ -18,7 +18,6 @@ import static com.google.common.collect.Iterables.getLast; import static com.google.common.io.BaseEncoding.base16; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assert_; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.index.DomainApplicationIndex.loadActiveApplicationsByDomainName; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.testing.DatastoreHelper.assertNoBillingEvents; @@ -1092,10 +1091,7 @@ public class DomainApplicationCreateFlowTest @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistContactsAndHosts(); thrown.expect(NotAuthorizedForTldException.class); runFlow(); @@ -1148,10 +1144,7 @@ public class DomainApplicationCreateFlowTest @Test public void testSuccess_superuserNotAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistContactsAndHosts(); clock.advanceOneMilli(); runSuperuserFlow("domain_create_sunrise_encoded_signed_mark_response.xml"); diff --git a/javatests/google/registry/flows/domain/DomainApplicationDeleteFlowTest.java b/javatests/google/registry/flows/domain/DomainApplicationDeleteFlowTest.java index 6dc13433c..a7f9e2566 100644 --- a/javatests/google/registry/flows/domain/DomainApplicationDeleteFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainApplicationDeleteFlowTest.java @@ -15,7 +15,6 @@ package google.registry.flows.domain; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.EppResourceUtils.isLinked; import static google.registry.model.EppResourceUtils.loadByForeignKey; import static google.registry.model.index.ForeignKeyIndex.loadAndGetKey; @@ -163,26 +162,18 @@ public class DomainApplicationDeleteFlowTest @Test public void testFailure_notAuthorizedForTld() throws Exception { + persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); persistResource( - newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); - persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); thrown.expect(NotAuthorizedForTldException.class); runFlow(); } @Test public void testSuccess_superuserNotAuthorizedForTld() throws Exception { + persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); persistResource( - newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); - persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); clock.advanceOneMilli(); runFlowAssertResponse( CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_delete_response.xml")); diff --git a/javatests/google/registry/flows/domain/DomainApplicationUpdateFlowTest.java b/javatests/google/registry/flows/domain/DomainApplicationUpdateFlowTest.java index 1e371ee1e..09f00617d 100644 --- a/javatests/google/registry/flows/domain/DomainApplicationUpdateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainApplicationUpdateFlowTest.java @@ -17,7 +17,6 @@ package google.registry.flows.domain; import static com.google.common.collect.Sets.union; import static com.google.common.io.BaseEncoding.base16; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.EppResourceUtils.loadByForeignKey; import static google.registry.testing.DatastoreHelper.assertNoBillingEvents; import static google.registry.testing.DatastoreHelper.createTld; @@ -278,7 +277,7 @@ public class DomainApplicationUpdateFlowTest "domain_update_sunrise_dsdata_rem_all.xml", ImmutableSet.of(SOME_DSDATA, DelegationSignerData.create( 12346, 3, 1, base16().decode("38EC35D5B3A34B44C39B"))), - ImmutableSet.of()); + ImmutableSet.of()); } @Test @@ -576,23 +575,17 @@ public class DomainApplicationUpdateFlowTest @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistReferencedEntities(); persistApplication(); thrown.expect(NotAuthorizedForTldException.class); runFlow(); } - + @Test public void testSuccess_superuserNotAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistReferencedEntities(); persistApplication(); clock.advanceOneMilli(); diff --git a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java index e76c19104..5ca7631bc 100644 --- a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java @@ -287,10 +287,7 @@ public class DomainCheckFlowTest @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); thrown.expect(NotAuthorizedForTldException.class); runFlow(); } @@ -299,10 +296,7 @@ public class DomainCheckFlowTest public void testSuccess_superuserNotAuthorizedForTld() throws Exception { persistActiveDomain("example2.tld"); persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); runFlowAssertResponse( CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_check_one_tld_response.xml")); } @@ -415,7 +409,7 @@ public class DomainCheckFlowTest */ @Test public void testAvailExtension_premiumDomainsAreUnavailableWithoutExtension() throws Exception { - sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); + sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); createTld("example"); setEppInput("domain_check_premium.xml"); doCheckTest(create(false, "rich.example", "Premium names require EPP ext.")); @@ -427,7 +421,7 @@ public class DomainCheckFlowTest */ @Test public void testAvailExtension_premiumDomainsAvailableIfNotRequiredByTld() throws Exception { - sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); + sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); createTld("example"); persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build()); setEppInput("domain_check_premium.xml"); diff --git a/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java b/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java index 7b72cb4cc..3c22047fe 100644 --- a/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java @@ -115,10 +115,7 @@ public class DomainClaimsCheckFlowTest @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); thrown.expect(NotAuthorizedForTldException.class); runFlow(); } @@ -128,10 +125,7 @@ public class DomainClaimsCheckFlowTest persistClaimsList( ImmutableMap.of("example2", "2013041500/2/6/9/rJ1NrDO92vDsAzf7EQzgjX4R0000000001")); persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); assertTransactionalFlow(false); assertNoHistory(); // Checks don't create a history event. assertNoBillingEvents(); // Checks are always free. @@ -161,9 +155,8 @@ public class DomainClaimsCheckFlowTest public void testFailure_multipleTlds_oneHasEndedClaims() throws Exception { createTld("tld1"); createTld("tld2"); - persistResource(Registry.get("tld2").asBuilder() - .setClaimsPeriodEnd(clock.nowUtc().minusMillis(1)) - .build()); + persistResource( + Registry.get("tld2").asBuilder().setClaimsPeriodEnd(clock.nowUtc().minusMillis(1)).build()); setEppInput("domain_check_claims_multiple_tlds.xml"); thrown.expect(ClaimsPeriodEndedException.class); runFlow(); diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java index 514fce144..003aaf65b 100644 --- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java @@ -201,7 +201,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase billingFlags = isAnchorTenant ? ImmutableSet.of(BillingEvent.Flag.ANCHOR_TENANT) - : ImmutableSet.of(); + : ImmutableSet.of(); HistoryEntry historyEntry = getHistoryEntries(domain).get(0); assertAboutDomains().that(domain) .hasRegistrationExpirationTime( @@ -319,7 +319,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCaseof()); + doSuccessfulTest(domainTld, responseXmlFile, userPrivileges, ImmutableMap.of()); } private void doSuccessfulTest( @@ -788,7 +788,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCaseof()); + persistClaimsList(ImmutableMap.of()); persistContactsAndHosts(); thrown.expect(UnexpectedClaimsNoticeException.class); runFlow(); @@ -1599,7 +1599,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCaseof("irrelevant")) + .setAllowedTlds(ImmutableSet.of("irrelevant")) .build()); persistContactsAndHosts(); thrown.expect(NotAuthorizedForTldException.class); diff --git a/javatests/google/registry/flows/domain/DomainDeleteFlowTest.java b/javatests/google/registry/flows/domain/DomainDeleteFlowTest.java index b9d25f5af..b58f43b76 100644 --- a/javatests/google/registry/flows/domain/DomainDeleteFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainDeleteFlowTest.java @@ -16,7 +16,6 @@ package google.registry.flows.domain; import static com.google.common.collect.MoreCollectors.onlyElement; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.flows.domain.DomainTransferFlowTestCase.persistWithPendingTransfer; import static google.registry.model.EppResourceUtils.loadByForeignKey; import static google.registry.model.ofy.ObjectifyService.ofy; @@ -261,7 +260,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()); + doImmediateDeleteTest(gracePeriodStatus, responseFilename, ImmutableMap.of()); } private void doImmediateDeleteTest( @@ -289,7 +288,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()); + sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); doImmediateDeleteTest(GracePeriodStatus.ADD, "domain_delete_response.xml"); } @@ -313,12 +312,12 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()); + sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); doImmediateDeleteTest(GracePeriodStatus.SUNRUSH_ADD, "domain_delete_response.xml"); } private void doSuccessfulTest_noAddGracePeriod(String responseFilename) throws Exception { - doSuccessfulTest_noAddGracePeriod(responseFilename, ImmutableMap.of()); + doSuccessfulTest_noAddGracePeriod(responseFilename, ImmutableMap.of()); } private void doSuccessfulTest_noAddGracePeriod( @@ -372,7 +371,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()); + sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); doSuccessfulTest_noAddGracePeriod("domain_delete_response_pending.xml"); } @@ -415,7 +414,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()); + sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); persistResource( Registry.get("tld") .asBuilder() @@ -426,7 +425,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()); + sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); persistResource( Registry.get("tld") .asBuilder() @@ -588,7 +587,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()); + sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); setUpSuccessfulTest(); // Persist the billing event so it can be retrieved for cancellation generation and checking. BillingEvent.OneTime graceBillingEvent = @@ -597,11 +596,11 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); thrown.expect(NotAuthorizedForTldException.class); runFlow(); } @@ -714,10 +710,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); clock.advanceOneMilli(); runFlowAssertResponse( CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_delete_response_pending.xml")); diff --git a/javatests/google/registry/flows/domain/DomainRenewFlowTest.java b/javatests/google/registry/flows/domain/DomainRenewFlowTest.java index ab32a1e17..8cdb0fc62 100644 --- a/javatests/google/registry/flows/domain/DomainRenewFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainRenewFlowTest.java @@ -15,7 +15,6 @@ package google.registry.flows.domain; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.flows.domain.DomainTransferFlowTestCase.persistWithPendingTransfer; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.testing.DatastoreHelper.assertBillingEvents; @@ -127,7 +126,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCaseof()); + doSuccessfulTest(responseFilename, renewalYears, ImmutableMap.of()); } private void doSuccessfulTest( @@ -625,10 +624,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCaseof()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistDomain(); thrown.expect(NotAuthorizedForTldException.class); runFlow(); @@ -637,10 +633,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCaseof()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistDomain(); runFlowAssertResponse( CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_renew_response.xml")); diff --git a/javatests/google/registry/flows/domain/DomainRestoreRequestFlowTest.java b/javatests/google/registry/flows/domain/DomainRestoreRequestFlowTest.java index 36f745048..2c02db1e3 100644 --- a/javatests/google/registry/flows/domain/DomainRestoreRequestFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainRestoreRequestFlowTest.java @@ -15,7 +15,6 @@ package google.registry.flows.domain; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.testing.DatastoreHelper.assertBillingEvents; import static google.registry.testing.DatastoreHelper.createTld; @@ -510,10 +509,7 @@ public class DomainRestoreRequestFlowTest extends @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistPendingDeleteDomain(); thrown.expect(NotAuthorizedForTldException.class); runFlow(); @@ -522,10 +518,7 @@ public class DomainRestoreRequestFlowTest extends @Test public void testSuccess_superuserNotAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistPendingDeleteDomain(); runFlowAssertResponse( CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_update_response.xml")); diff --git a/javatests/google/registry/flows/domain/DomainTransferApproveFlowTest.java b/javatests/google/registry/flows/domain/DomainTransferApproveFlowTest.java index c88869a99..de0508724 100644 --- a/javatests/google/registry/flows/domain/DomainTransferApproveFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainTransferApproveFlowTest.java @@ -16,7 +16,6 @@ package google.registry.flows.domain; import static com.google.common.collect.MoreCollectors.onlyElement; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.NET_ADDS_4_YR; import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL; @@ -309,7 +308,7 @@ public class DomainTransferApproveFlowTest .build()) .toArray(BillingEvent.class)); // There should be no grace period. - assertGracePeriods(domain.getGracePeriods(), ImmutableMap.of()); + assertGracePeriods(domain.getGracePeriods(), ImmutableMap.of()); } private void doSuccessfulTest(String tld, String commandFilename, String expectedXmlFilename) @@ -497,10 +496,7 @@ public class DomainTransferApproveFlowTest @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); thrown.expect(NotAuthorizedForTldException.class); doSuccessfulTest("tld", "domain_transfer_approve.xml", "domain_transfer_approve_response.xml"); } @@ -508,10 +504,7 @@ public class DomainTransferApproveFlowTest @Test public void testSuccess_superuserNotAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); runFlowAssertResponse( CommitMode.LIVE, UserPrivileges.SUPERUSER, diff --git a/javatests/google/registry/flows/domain/DomainTransferCancelFlowTest.java b/javatests/google/registry/flows/domain/DomainTransferCancelFlowTest.java index 2832f16ba..92104f786 100644 --- a/javatests/google/registry/flows/domain/DomainTransferCancelFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainTransferCancelFlowTest.java @@ -15,7 +15,6 @@ package google.registry.flows.domain; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.RESTORED_DOMAINS; import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL; import static google.registry.model.reporting.HistoryEntry.Type.DOMAIN_CREATE; @@ -304,10 +303,7 @@ public class DomainTransferCancelFlowTest @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("NewRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); thrown.expect(NotAuthorizedForTldException.class); doSuccessfulTest("domain_transfer_cancel.xml", "domain_transfer_cancel_response.xml"); } @@ -315,15 +311,10 @@ public class DomainTransferCancelFlowTest @Test public void testSuccess_superuserNotAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("NewRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); clock.advanceOneMilli(); runFlowAssertResponse( - CommitMode.LIVE, - UserPrivileges.SUPERUSER, - readFile("domain_transfer_cancel_response.xml")); + CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_transfer_cancel_response.xml")); } // NB: No need to test pending delete status since pending transfers will get cancelled upon diff --git a/javatests/google/registry/flows/domain/DomainTransferRejectFlowTest.java b/javatests/google/registry/flows/domain/DomainTransferRejectFlowTest.java index 82f510eb3..1d1233b8a 100644 --- a/javatests/google/registry/flows/domain/DomainTransferRejectFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainTransferRejectFlowTest.java @@ -16,7 +16,6 @@ package google.registry.flows.domain; import static com.google.common.collect.MoreCollectors.onlyElement; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.NET_RENEWS_3_YR; import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_NACKED; import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL; @@ -174,10 +173,7 @@ public class DomainTransferRejectFlowTest @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); thrown.expect(NotAuthorizedForTldException.class); doSuccessfulTest("domain_transfer_reject.xml", "domain_transfer_reject_response.xml"); } @@ -185,14 +181,9 @@ public class DomainTransferRejectFlowTest @Test public void testSuccess_superuserNotAuthorizedForTld() throws Exception { persistResource( - loadRegistrar("TheRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); runFlowAssertResponse( - CommitMode.LIVE, - UserPrivileges.SUPERUSER, - readFile("domain_transfer_reject_response.xml")); + CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_transfer_reject_response.xml")); } @Test diff --git a/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java b/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java index 02b99a9cf..0763c0216 100644 --- a/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java @@ -276,7 +276,7 @@ public class DomainTransferRequestFlowTest .build()); } else { // Superuser transfers with no bundled renewal have no transfer billing event. - optionalTransferBillingEvent = Optional.empty(); + optionalTransferBillingEvent = Optional.empty(); } // Construct the autorenew events for the losing/existing client and the gaining one. Note that // all of the other transfer flow tests happen on day 3 of the transfer, but the initial @@ -347,9 +347,7 @@ public class DomainTransferRequestFlowTest null), optionalTransferBillingEvent.get())); } else { - assertGracePeriods( - domainAfterAutomaticTransfer.getGracePeriods(), - ImmutableMap.of()); + assertGracePeriods(domainAfterAutomaticTransfer.getGracePeriods(), ImmutableMap.of()); } } @@ -469,8 +467,8 @@ public class DomainTransferRequestFlowTest commandFilename, expectedXmlFilename, expectedExpirationTime, - ImmutableMap.of(), - Optional.empty(), + ImmutableMap.of(), + Optional.empty(), extraExpectedBillingEvents); } @@ -484,7 +482,7 @@ public class DomainTransferRequestFlowTest expectedXmlFilename, domain.getRegistrationExpirationTime().plusYears(1), substitutions, - Optional.empty()); + Optional.empty()); } private void doSuccessfulTest(String commandFilename, String expectedXmlFilename) @@ -568,7 +566,7 @@ public class DomainTransferRequestFlowTest } private void runTest(String commandFilename, UserPrivileges userPrivileges) throws Exception { - runTest(commandFilename, userPrivileges, ImmutableMap.of()); + runTest(commandFilename, userPrivileges, ImmutableMap.of()); } private void doFailingTest( @@ -577,7 +575,7 @@ public class DomainTransferRequestFlowTest } private void doFailingTest(String commandFilename) throws Exception { - runTest(commandFilename, UserPrivileges.NORMAL, ImmutableMap. of()); + runTest(commandFilename, UserPrivileges.NORMAL, ImmutableMap.of()); } @Test @@ -756,7 +754,7 @@ public class DomainTransferRequestFlowTest "domain_transfer_request_response_su_ext_zero_period_nonzero_transfer_length.xml", domain.getRegistrationExpirationTime().plusYears(0), ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "5"), - Optional.empty(), + Optional.empty(), Period.create(0, Unit.YEARS), Duration.standardDays(5)); } @@ -772,7 +770,7 @@ public class DomainTransferRequestFlowTest "domain_transfer_request_response_su_ext_zero_period_zero_transfer_length.xml", domain.getRegistrationExpirationTime().plusYears(0), ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "0"), - Optional.empty(), + Optional.empty(), Period.create(0, Unit.YEARS), Duration.ZERO); } @@ -788,7 +786,7 @@ public class DomainTransferRequestFlowTest "domain_transfer_request_response_su_ext_one_year_period_nonzero_transfer_length.xml", domain.getRegistrationExpirationTime().plusYears(1), ImmutableMap.of("PERIOD", "1", "AUTOMATIC_TRANSFER_LENGTH", "5"), - Optional.empty(), + Optional.empty(), Period.create(1, Unit.YEARS), Duration.standardDays(5)); } @@ -818,7 +816,7 @@ public class DomainTransferRequestFlowTest "domain_transfer_request_response_su_ext_zero_period_autorenew_grace.xml", domain.getRegistrationExpirationTime(), ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "0"), - Optional.empty(), + Optional.empty(), Period.create(0, Unit.YEARS), Duration.ZERO); } @@ -895,10 +893,7 @@ public class DomainTransferRequestFlowTest public void testFailure_notAuthorizedForTld() throws Exception { setupDomain("example", "tld"); persistResource( - loadRegistrar("NewRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); thrown.expect(NotAuthorizedForTldException.class); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); } @@ -907,10 +902,7 @@ public class DomainTransferRequestFlowTest public void testSuccess_superuserNotAuthorizedForTld() throws Exception { setupDomain("example", "tld"); persistResource( - loadRegistrar("NewRegistrar") - .asBuilder() - .setAllowedTlds(ImmutableSet.of()) - .build()); + loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); clock.advanceOneMilli(); // We don't verify the results; just check that the flow doesn't fail. runTest("domain_transfer_request.xml", UserPrivileges.SUPERUSER); diff --git a/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java b/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java index c8f999381..d48c2ed52 100644 --- a/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java @@ -17,7 +17,6 @@ package google.registry.flows.domain; import static com.google.common.collect.Sets.union; import static com.google.common.io.BaseEncoding.base16; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.EppResourceUtils.loadByForeignKey; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.testing.DatastoreHelper.assertBillingEvents; @@ -592,7 +591,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCaseof()); + ImmutableSet.of()); } @Test @@ -975,10 +974,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCaseof()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistReferencedEntities(); persistDomain(); thrown.expect(NotAuthorizedForTldException.class); @@ -988,10 +984,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCaseof()) - .build()); + loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistReferencedEntities(); persistDomain(); clock.advanceOneMilli(); diff --git a/javatests/google/registry/flows/session/LoginFlowViaTlsTest.java b/javatests/google/registry/flows/session/LoginFlowViaTlsTest.java index 3717dad17..5e56033f0 100644 --- a/javatests/google/registry/flows/session/LoginFlowViaTlsTest.java +++ b/javatests/google/registry/flows/session/LoginFlowViaTlsTest.java @@ -116,7 +116,7 @@ public class LoginFlowViaTlsTest extends LoginFlowTestCase { CidrAddressBlock.create(InetAddresses.forString("192.168.1.1"), 32), CidrAddressBlock.create(InetAddresses.forString("2001:db8::1"), 128))) .build()); - credentials = new TlsCredentials(GOOD_CERT, Optional.empty(), "goo.example"); + credentials = new TlsCredentials(GOOD_CERT, Optional.empty(), "goo.example"); doFailingTest("login_valid.xml", BadRegistrarIpAddressException.class); } diff --git a/javatests/google/registry/rdap/RdapActionBaseTest.java b/javatests/google/registry/rdap/RdapActionBaseTest.java index bbac23c6d..7d1e9d206 100644 --- a/javatests/google/registry/rdap/RdapActionBaseTest.java +++ b/javatests/google/registry/rdap/RdapActionBaseTest.java @@ -89,8 +89,8 @@ public class RdapActionBaseTest { rdapJsonFormatter.addTopLevelEntries( builder, BoilerplateType.OTHER, - ImmutableList.>of(), - ImmutableList.>of(), + ImmutableList.of(), + ImmutableList.of(), "http://myserver.example.com/"); return builder.build(); } diff --git a/javatests/google/registry/rdap/RdapEntityActionTest.java b/javatests/google/registry/rdap/RdapEntityActionTest.java index 0ef649255..cba098be1 100644 --- a/javatests/google/registry/rdap/RdapEntityActionTest.java +++ b/javatests/google/registry/rdap/RdapEntityActionTest.java @@ -159,8 +159,8 @@ public class RdapEntityActionTest { action.request = request; action.fullServletPath = "https://example.com/rdap"; action.response = response; - action.registrarParam = Optional.empty(); - action.includeDeletedParam = Optional.empty(); + action.registrarParam = Optional.empty(); + action.includeDeletedParam = Optional.empty(); action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter(); action.rdapWhoisServer = null; action.sessionUtils = sessionUtils; diff --git a/javatests/google/registry/rdap/RdapJsonFormatterTest.java b/javatests/google/registry/rdap/RdapJsonFormatterTest.java index f89ad4b8a..9a9baec3d 100644 --- a/javatests/google/registry/rdap/RdapJsonFormatterTest.java +++ b/javatests/google/registry/rdap/RdapJsonFormatterTest.java @@ -472,7 +472,7 @@ public class RdapJsonFormatterTest { rdapJsonFormatter.makeRdapJsonForContact( contactResourceTech, false, - Optional.empty(), + Optional.empty(), LINK_BASE, WHOIS_SERVER, clock.nowUtc(), @@ -487,7 +487,7 @@ public class RdapJsonFormatterTest { rdapJsonFormatter.makeRdapJsonForContact( contactResourceNotLinked, false, - Optional.empty(), + Optional.empty(), LINK_BASE, WHOIS_SERVER, clock.nowUtc(), @@ -626,8 +626,8 @@ public class RdapJsonFormatterTest { rdapJsonFormatter.addTopLevelEntries( builder, RdapJsonFormatter.BoilerplateType.OTHER, - ImmutableList.>of(), - ImmutableList.>of(), + ImmutableList.of(), + ImmutableList.of(), LINK_BASE); assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel.json")); } @@ -640,7 +640,7 @@ public class RdapJsonFormatterTest { builder, RdapJsonFormatter.BoilerplateType.OTHER, ImmutableList.of(rdapJsonFormatter.getJsonHelpNotice("/tos", LINK_BASE)), - ImmutableList.>of(), + ImmutableList.of(), LINK_BASE); assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel.json")); } @@ -652,8 +652,8 @@ public class RdapJsonFormatterTest { rdapJsonFormatter.addTopLevelEntries( builder, RdapJsonFormatter.BoilerplateType.DOMAIN, - ImmutableList.>of(), - ImmutableList.>of(), + ImmutableList.of(), + ImmutableList.of(), LINK_BASE); assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel_domain.json")); } @@ -666,7 +666,7 @@ public class RdapJsonFormatterTest { builder, RdapJsonFormatter.BoilerplateType.DOMAIN, ImmutableList.of(rdapJsonFormatter.getJsonHelpNotice("/tos", LINK_BASE)), - ImmutableList.>of(), + ImmutableList.of(), LINK_BASE); assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel_domain.json")); } diff --git a/javatests/google/registry/rdap/RdapNameserverActionTest.java b/javatests/google/registry/rdap/RdapNameserverActionTest.java index 6a0d75c95..c811dca66 100644 --- a/javatests/google/registry/rdap/RdapNameserverActionTest.java +++ b/javatests/google/registry/rdap/RdapNameserverActionTest.java @@ -124,7 +124,7 @@ public class RdapNameserverActionTest { } private Object generateActualJson(String name) { - return generateActualJson(name, Optional.empty(), Optional.empty()); + return generateActualJson(name, Optional.empty(), Optional.empty()); } private Object generateActualJson( @@ -315,7 +315,7 @@ public class RdapNameserverActionTest { public void testNameserver_found_sameRegistrarRequested() throws Exception { assertThat( generateActualJson( - "ns1.cat.lol", Optional.of("TheRegistrar"), Optional.empty())) + "ns1.cat.lol", Optional.of("TheRegistrar"), Optional.empty())) .isEqualTo( generateExpectedJsonWithTopLevelEntries( "ns1.cat.lol", @@ -342,14 +342,14 @@ public class RdapNameserverActionTest { @Test public void testDeletedNameserver_notFound_includeDeletedSetFalse() throws Exception { - generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(false)); + generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(false)); assertThat(response.getStatus()).isEqualTo(404); } @Test public void testDeletedNameserver_notFound_notLoggedIn() throws Exception { when(sessionUtils.checkRegistrarConsoleLogin(request, userAuthInfo)).thenReturn(false); - generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true)); + generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true)); assertThat(response.getStatus()).isEqualTo(404); } @@ -357,7 +357,7 @@ public class RdapNameserverActionTest { public void testDeletedNameserver_notFound_loggedInAsDifferentRegistrar() throws Exception { when(sessionUtils.checkRegistrarConsoleLogin(request, userAuthInfo)).thenReturn(true); when(sessionUtils.getRegistrarClientId(request)).thenReturn("otherregistrar"); - generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true)); + generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true)); assertThat(response.getStatus()).isEqualTo(404); } @@ -366,7 +366,7 @@ public class RdapNameserverActionTest { when(sessionUtils.checkRegistrarConsoleLogin(request, userAuthInfo)).thenReturn(true); when(sessionUtils.getRegistrarClientId(request)).thenReturn("TheRegistrar"); assertThat( - generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true))) + generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true))) .isEqualTo( generateExpectedJsonWithTopLevelEntries( "nsdeleted.cat.lol", @@ -385,7 +385,7 @@ public class RdapNameserverActionTest { when(sessionUtils.getRegistrarClientId(request)).thenReturn("irrelevant"); newRdapNameserverAction( "nsdeleted.cat.lol", - Optional.empty(), + Optional.empty(), Optional.of(true), AuthResult.create(AuthLevel.USER, adminUserAuthInfo)) .run(); diff --git a/javatests/google/registry/rdap/RdapTestHelper.java b/javatests/google/registry/rdap/RdapTestHelper.java index 27f0852dd..a5800d6a7 100644 --- a/javatests/google/registry/rdap/RdapTestHelper.java +++ b/javatests/google/registry/rdap/RdapTestHelper.java @@ -56,7 +56,7 @@ public class RdapTestHelper { switch (contactNoticeType) { case DOMAIN: noticesBuilder.add( - ImmutableMap.of( + ImmutableMap.of( "title", "Contacts Hidden", "description", ImmutableList.of("Domain contacts are visible only to the owning registrar."), @@ -64,7 +64,7 @@ public class RdapTestHelper { break; case CONTACT: noticesBuilder.add( - ImmutableMap.of( + ImmutableMap.of( "title", "Contact Personal Data Hidden", "description", ImmutableList.of( @@ -75,7 +75,7 @@ public class RdapTestHelper { break; } noticesBuilder.add( - ImmutableMap.of( + ImmutableMap.of( "title", "RDAP Terms of Service", "description", ImmutableList.of( @@ -119,7 +119,7 @@ public class RdapTestHelper { ImmutableList.Builder> remarksBuilder = getBuilderWithOthersAdded(otherRemarks); remarksBuilder.add( - ImmutableMap.of( + ImmutableMap.of( "description", ImmutableList.of( "This response conforms to the RDAP Operational Profile for gTLD Registries and" @@ -139,20 +139,20 @@ public class RdapTestHelper { getBuilderWithOthersAdded(otherRemarks); if (addNoContactRemark) { remarksBuilder.add( - ImmutableMap.of( + ImmutableMap.of( "title", "Contacts Hidden", "description", ImmutableList.of("Domain contacts are visible only to the owning registrar."), "type", "object truncated due to unexplainable reasons")); } remarksBuilder.add( - ImmutableMap.of( + ImmutableMap.of( "description", ImmutableList.of( "This response conforms to the RDAP Operational Profile for gTLD Registries and" + " Registrars version 1.0"))); remarksBuilder.add( - ImmutableMap.of( + ImmutableMap.of( "title", "EPP Status Codes", "description", @@ -167,7 +167,7 @@ public class RdapTestHelper { "href", "https://icann.org/epp", "type", "text/html")))); remarksBuilder.add( - ImmutableMap.of( + ImmutableMap.of( "description", ImmutableList.of( "URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf"), diff --git a/javatests/google/registry/rde/DomainResourceToXjcConverterTest.java b/javatests/google/registry/rde/DomainResourceToXjcConverterTest.java index e5f8eb54d..de7c6be51 100644 --- a/javatests/google/registry/rde/DomainResourceToXjcConverterTest.java +++ b/javatests/google/registry/rde/DomainResourceToXjcConverterTest.java @@ -53,7 +53,6 @@ import google.registry.model.poll.PollMessage.Autorenew; import google.registry.model.rde.RdeMode; import google.registry.model.reporting.HistoryEntry; import google.registry.model.transfer.TransferData; -import google.registry.model.transfer.TransferData.TransferServerApproveEntity; import google.registry.model.transfer.TransferStatus; import google.registry.testing.AppEngineRule; import google.registry.testing.FakeClock; @@ -331,7 +330,7 @@ public class DomainResourceToXjcConverterTest { .setMsg("Domain was auto-renewed.") .setParent(historyEntry) .build()))) - .setServerApproveEntities(ImmutableSet.>of( + .setServerApproveEntities(ImmutableSet.of( Key.create(billingEvent))) .setTransferRequestTime(DateTime.parse("1919-01-01T00:00:00Z")) .setTransferStatus(TransferStatus.PENDING) diff --git a/javatests/google/registry/rde/RdeFixtures.java b/javatests/google/registry/rde/RdeFixtures.java index 842250e0b..eb8bbd8fc 100644 --- a/javatests/google/registry/rde/RdeFixtures.java +++ b/javatests/google/registry/rde/RdeFixtures.java @@ -48,7 +48,6 @@ import google.registry.model.poll.PollMessage; import google.registry.model.poll.PollMessage.Autorenew; import google.registry.model.reporting.HistoryEntry; import google.registry.model.transfer.TransferData; -import google.registry.model.transfer.TransferData.TransferServerApproveEntity; import google.registry.model.transfer.TransferStatus; import google.registry.testing.FakeClock; import google.registry.util.Idn; @@ -173,7 +172,7 @@ final class RdeFixtures { .setMsg("Domain was auto-renewed.") .setParent(historyEntry) .build()))) - .setServerApproveEntities(ImmutableSet.>of( + .setServerApproveEntities(ImmutableSet.of( Key.create(billingEvent))) .setTransferRequestTime(DateTime.parse("1919-01-01T00:00:00Z")) .setTransferStatus(TransferStatus.PENDING) diff --git a/javatests/google/registry/rde/RdeStagingActionTest.java b/javatests/google/registry/rde/RdeStagingActionTest.java index 739f5c5bb..881301280 100644 --- a/javatests/google/registry/rde/RdeStagingActionTest.java +++ b/javatests/google/registry/rde/RdeStagingActionTest.java @@ -151,11 +151,11 @@ public class RdeStagingActionTest extends MapreduceTestCase { action.pendingDepositChecker.rdeInterval = Duration.standardDays(1); action.response = response; action.transactionCooldown = Duration.ZERO; - action.directory = Optional.empty(); - action.modeStrings = ImmutableSet.of(); - action.tlds = ImmutableSet.of(); - action.watermarks = ImmutableSet.of(); - action.revision = Optional.empty(); + action.directory = Optional.empty(); + action.modeStrings = ImmutableSet.of(); + action.tlds = ImmutableSet.of(); + action.watermarks = ImmutableSet.of(); + action.revision = Optional.empty(); } @Test @@ -246,7 +246,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { clock.setTo(DateTime.parse("2000-01-01TZ")); action.manual = true; action.directory = Optional.of("test/"); - action.modeStrings = ImmutableSet.of(); + action.modeStrings = ImmutableSet.of(); action.tlds = ImmutableSet.of("lol"); action.watermarks = ImmutableSet.of(clock.nowUtc()); thrown.expect(BadRequestException.class); @@ -273,7 +273,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { action.manual = true; action.directory = Optional.of("test/"); action.modeStrings = ImmutableSet.of("full"); - action.tlds = ImmutableSet.of(); + action.tlds = ImmutableSet.of(); action.watermarks = ImmutableSet.of(clock.nowUtc()); thrown.expect(BadRequestException.class); action.run(); diff --git a/javatests/google/registry/rde/imports/RdeContactImportActionTest.java b/javatests/google/registry/rde/imports/RdeContactImportActionTest.java index 292d83193..ed826392d 100644 --- a/javatests/google/registry/rde/imports/RdeContactImportActionTest.java +++ b/javatests/google/registry/rde/imports/RdeContactImportActionTest.java @@ -74,7 +74,7 @@ public class RdeContactImportActionTest extends MapreduceTestCaseof(3)); + Optional.of(3)); } @Test diff --git a/javatests/google/registry/rde/imports/RdeContactInputTest.java b/javatests/google/registry/rde/imports/RdeContactInputTest.java index 97ba63b06..359c68063 100644 --- a/javatests/google/registry/rde/imports/RdeContactInputTest.java +++ b/javatests/google/registry/rde/imports/RdeContactInputTest.java @@ -66,14 +66,14 @@ public class RdeContactInputTest { @Test public void testZeroContactsDefaultShards_returnsOneReader() throws Exception { pushToGcs(DEPOSIT_0_CONTACT); - assertNumberOfReaders(Optional.empty(), 1); + assertNumberOfReaders(Optional.empty(), 1); } /** Escrow file with zero contacts results in expected reader configuration */ @Test public void testZeroContactsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_0_CONTACT); - assertReaderConfigurations(Optional.empty(), 0, 0, 100); + assertReaderConfigurations(Optional.empty(), 0, 0, 100); } /** Escrow file with zero contacts and 75 shards results in one reader */ @@ -87,14 +87,14 @@ public class RdeContactInputTest { @Test public void testOneContactDefaultShards_returnsOneReader() throws Exception { pushToGcs(DEPOSIT_1_CONTACT); - assertNumberOfReaders(Optional.empty(), 1); + assertNumberOfReaders(Optional.empty(), 1); } /** Escrow file with one contact results in expected reader configuration */ @Test public void testOneContactDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_1_CONTACT); - assertReaderConfigurations(Optional.empty(), 0, 0, 100); + assertReaderConfigurations(Optional.empty(), 0, 0, 100); } /** Escrow file with one contact and 75 shards results in one reader */ @@ -108,14 +108,14 @@ public class RdeContactInputTest { @Test public void test199ContactsDefaultShards_returnsOneReader() throws Exception { pushToGcs(DEPOSIT_199_CONTACT); - assertNumberOfReaders(Optional.empty(), 1); + assertNumberOfReaders(Optional.empty(), 1); } /** Escrow file with 199 contacts results in expected reader configuration */ @Test public void test199ContactsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_199_CONTACT); - assertReaderConfigurations(Optional.empty(), 0, 0, 199); + assertReaderConfigurations(Optional.empty(), 0, 0, 199); } /** Escrow file with 199 contacts and 75 shards results in one reader */ @@ -129,15 +129,15 @@ public class RdeContactInputTest { @Test public void test200ContactsDefaultShards_returnsTwoReaders() throws Exception { pushToGcs(DEPOSIT_200_CONTACT); - assertNumberOfReaders(Optional.empty(), 2); + assertNumberOfReaders(Optional.empty(), 2); } /** Escrow file with 200 contacts results in expected reader configurations */ @Test public void test200ContactsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_200_CONTACT); - assertReaderConfigurations(Optional.empty(), 0, 0, 100); - assertReaderConfigurations(Optional.empty(), 1, 100, 100); + assertReaderConfigurations(Optional.empty(), 0, 0, 100); + assertReaderConfigurations(Optional.empty(), 1, 100, 100); } /** Escrow file with 200 contacts and 75 shards results in two readers */ @@ -151,7 +151,7 @@ public class RdeContactInputTest { @Test public void test1000ContactsDefaultShards_returns10Readers() throws Exception { pushToGcs(DEPOSIT_1000_CONTACT); - assertNumberOfReaders(Optional.empty(), 10); + assertNumberOfReaders(Optional.empty(), 10); } /** Escrow file with 1000 contacts results in expected reader configurations */ @@ -159,7 +159,7 @@ public class RdeContactInputTest { public void test1000ContactsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_1000_CONTACT); for (int i = 0; i < 10; i++) { - assertReaderConfigurations(Optional.empty(), i, i * 100, 100); + assertReaderConfigurations(Optional.empty(), i, i * 100, 100); } } @@ -174,7 +174,7 @@ public class RdeContactInputTest { @Test public void test10000ContactsDefaultShards_returns50Readers() throws Exception { pushToGcs(DEPOSIT_10000_CONTACT); - assertNumberOfReaders(Optional.empty(), 50); + assertNumberOfReaders(Optional.empty(), 50); } /** Escrow file with 10000 contacts results in expected reader configurations */ @@ -182,7 +182,7 @@ public class RdeContactInputTest { public void test10000ContactsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_10000_CONTACT); for (int i = 0; i < 50; i++) { - assertReaderConfigurations(Optional.empty(), i, i * 200, 200); + assertReaderConfigurations(Optional.empty(), i, i * 200, 200); } } diff --git a/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java b/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java index 3b9fc9663..e962f5cf5 100644 --- a/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java +++ b/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java @@ -95,7 +95,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCaseof(3)); + Optional.of(3)); } @Test diff --git a/javatests/google/registry/rde/imports/RdeHostImportActionTest.java b/javatests/google/registry/rde/imports/RdeHostImportActionTest.java index 40bf8207c..69c5480c9 100644 --- a/javatests/google/registry/rde/imports/RdeHostImportActionTest.java +++ b/javatests/google/registry/rde/imports/RdeHostImportActionTest.java @@ -68,7 +68,7 @@ public class RdeHostImportActionTest extends MapreduceTestCaseempty(), Optional.empty()); + mrRunner = new MapreduceRunner(Optional.empty(), Optional.empty()); action = new RdeHostImportAction( mrRunner, response, diff --git a/javatests/google/registry/rde/imports/RdeHostInputTest.java b/javatests/google/registry/rde/imports/RdeHostInputTest.java index e5f01da0c..090e6ef81 100644 --- a/javatests/google/registry/rde/imports/RdeHostInputTest.java +++ b/javatests/google/registry/rde/imports/RdeHostInputTest.java @@ -83,14 +83,14 @@ public class RdeHostInputTest { @Test public void testZeroHostsDefaultShards_returnsOneReader() throws Exception { pushToGcs(DEPOSIT_0_HOST); - assertNumberOfReaders(Optional.empty(), 1); + assertNumberOfReaders(Optional.empty(), 1); } /** Escrow file with zero hosts results in expected reader configuration */ @Test public void testZeroHostsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_0_HOST); - assertReaderConfigurations(Optional.empty(), 0, 0, 100); + assertReaderConfigurations(Optional.empty(), 0, 0, 100); } /** Escrow file with zero hosts and 75 shards results in one reader */ @@ -104,14 +104,14 @@ public class RdeHostInputTest { @Test public void testOneHostDefaultShards_returnsOneReader() throws Exception { pushToGcs(DEPOSIT_1_HOST); - assertNumberOfReaders(Optional.empty(), 1); + assertNumberOfReaders(Optional.empty(), 1); } /** Escrow file with one host results in expected reader configuration */ @Test public void testOneHostDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_1_HOST); - assertReaderConfigurations(Optional.empty(), 0, 0, 100); + assertReaderConfigurations(Optional.empty(), 0, 0, 100); } /** Escrow file with one host and 75 shards results in one reader */ @@ -125,14 +125,14 @@ public class RdeHostInputTest { @Test public void test199HostsDefaultShards_returnsOneReader() throws Exception { pushToGcs(DEPOSIT_199_HOST); - assertNumberOfReaders(Optional.empty(), 1); + assertNumberOfReaders(Optional.empty(), 1); } /** Escrow file with 199 hosts results in expected reader configuration */ @Test public void test199HostsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_199_HOST); - assertReaderConfigurations(Optional.empty(), 0, 0, 199); + assertReaderConfigurations(Optional.empty(), 0, 0, 199); } /** Escrow file with 199 hosts and 75 shards results in one reader */ @@ -146,15 +146,15 @@ public class RdeHostInputTest { @Test public void test200HostsDefaultShards_returnsTwoReaders() throws Exception { pushToGcs(DEPOSIT_200_HOST); - assertNumberOfReaders(Optional.empty(), 2); + assertNumberOfReaders(Optional.empty(), 2); } /** Escrow file with 200 hosts results in expected reader configurations */ @Test public void test200HostsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_200_HOST); - assertReaderConfigurations(Optional.empty(), 0, 0, 100); - assertReaderConfigurations(Optional.empty(), 1, 100, 100); + assertReaderConfigurations(Optional.empty(), 0, 0, 100); + assertReaderConfigurations(Optional.empty(), 1, 100, 100); } /** Escrow file with 200 hosts and 75 shards results in two readers */ @@ -168,7 +168,7 @@ public class RdeHostInputTest { @Test public void test1000HostsDefaultShards_returns10Readers() throws Exception { pushToGcs(DEPOSIT_1000_HOST); - assertNumberOfReaders(Optional.empty(), 10); + assertNumberOfReaders(Optional.empty(), 10); } /** Escrow file with 1000 hosts results in expected reader configurations */ @@ -176,7 +176,7 @@ public class RdeHostInputTest { public void test1000HostsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_1000_HOST); for (int i = 0; i < 10; i++) { - assertReaderConfigurations(Optional.empty(), i, i * 100, 100); + assertReaderConfigurations(Optional.empty(), i, i * 100, 100); } } @@ -191,7 +191,7 @@ public class RdeHostInputTest { @Test public void test10000HostsDefaultShards_returns50Readers() throws Exception { pushToGcs(DEPOSIT_10000_HOST); - assertNumberOfReaders(Optional.empty(), 50); + assertNumberOfReaders(Optional.empty(), 50); } /** Escrow file with 10000 hosts results in expected reader configurations */ @@ -199,7 +199,7 @@ public class RdeHostInputTest { public void test10000HostsDefaultShardsReaderConfigurations() throws Exception { pushToGcs(DEPOSIT_10000_HOST); for (int i = 0; i < 50; i++) { - assertReaderConfigurations(Optional.empty(), i, i * 200, 200); + assertReaderConfigurations(Optional.empty(), i, i * 200, 200); } } diff --git a/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java b/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java index 4a77910d4..42fb5f592 100644 --- a/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java +++ b/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java @@ -84,7 +84,7 @@ public class RdeHostLinkActionTest extends MapreduceTestCase inject.setStaticField(Ofy.class, "clock", clock); createTld("test"); response = new FakeResponse(); - mrRunner = new MapreduceRunner(Optional.empty(), Optional.empty()); + mrRunner = new MapreduceRunner(Optional.empty(), Optional.empty()); action = new RdeHostLinkAction(mrRunner, response, IMPORT_BUCKET_NAME, IMPORT_FILE_NAME, mapShards); } diff --git a/javatests/google/registry/tmch/LordnLogTest.java b/javatests/google/registry/tmch/LordnLogTest.java index ae48f4d98..48e51c438 100644 --- a/javatests/google/registry/tmch/LordnLogTest.java +++ b/javatests/google/registry/tmch/LordnLogTest.java @@ -104,7 +104,7 @@ public class LordnLogTest { @Test public void testFailure_parseEmpty() throws Exception { thrown.expect(Exception.class); - LordnLog.parse(ImmutableList.of()); + LordnLog.parse(ImmutableList.of()); } @Test diff --git a/javatests/google/registry/tmch/LordnTaskTest.java b/javatests/google/registry/tmch/LordnTaskTest.java index 0b5982622..f184915f5 100644 --- a/javatests/google/registry/tmch/LordnTaskTest.java +++ b/javatests/google/registry/tmch/LordnTaskTest.java @@ -91,7 +91,7 @@ public class LordnTaskTest { @Test public void test_convertTasksToCsv_doesntFailOnEmptyTasks() throws Exception { assertThat( - LordnTask.convertTasksToCsv(ImmutableList. of(), clock.nowUtc(), "col1,col2")) + LordnTask.convertTasksToCsv(ImmutableList.of(), clock.nowUtc(), "col1,col2")) .isEqualTo("1,2010-05-01T10:11:12.000Z,0\ncol1,col2\n"); } @@ -187,7 +187,7 @@ public class LordnTaskTest { when(queue.leaseTasks(any(LeaseOptions.class))) .thenThrow(TransientFailureException.class) .thenThrow(DeadlineExceededException.class) - .thenReturn(ImmutableList.of(task), ImmutableList.of()); + .thenReturn(ImmutableList.of(task), ImmutableList.of()); assertThat(LordnTask.loadAllTasks(queue, "tld")).containsExactly(task); } diff --git a/javatests/google/registry/ui/forms/FormFieldTest.java b/javatests/google/registry/ui/forms/FormFieldTest.java index 1c6af8e56..bf2d3e755 100644 --- a/javatests/google/registry/ui/forms/FormFieldTest.java +++ b/javatests/google/registry/ui/forms/FormFieldTest.java @@ -32,7 +32,6 @@ import com.google.common.collect.Lists; import com.google.common.testing.NullPointerTester; import com.google.re2j.Pattern; import java.util.List; -import java.util.Map; import java.util.Set; import org.junit.Rule; import org.junit.Test; @@ -241,7 +240,7 @@ public class FormFieldTest { @Test public void testAsList_empty_returnsEmpty() { - assertThat(FormField.named("lol").asList().build().convert(ImmutableList.of()).get()) + assertThat(FormField.named("lol").asList().build().convert(ImmutableList.of()).get()) .isEmpty(); } @@ -253,7 +252,7 @@ public class FormFieldTest { .emptyToNull() .required() .build() - .convert(ImmutableList.of()); + .convert(ImmutableList.of()); } @Test @@ -262,7 +261,7 @@ public class FormFieldTest { .asList() .emptyToNull() .build() - .convert(ImmutableList.of())) + .convert(ImmutableList.of())) .isEmpty(); } @@ -377,7 +376,7 @@ public class FormFieldTest { FormField.named("cat").emptyToNull().required().build().extractUntyped(input).get()) .asList() .build() - .convert(ImmutableList.>of(ImmutableMap.of("cat", ""))); + .convert(ImmutableList.of(ImmutableMap.of("cat", ""))); } @Test diff --git a/javatests/google/registry/ui/server/registrar/ContactSettingsTest.java b/javatests/google/registry/ui/server/registrar/ContactSettingsTest.java index 4aae8d175..0eaf8c40a 100644 --- a/javatests/google/registry/ui/server/registrar/ContactSettingsTest.java +++ b/javatests/google/registry/ui/server/registrar/ContactSettingsTest.java @@ -94,7 +94,7 @@ public class ContactSettingsTest extends RegistrarSettingsActionTestCase { reqJson.put("contacts", ImmutableList.of(AppEngineRule.makeRegistrarContact2() .asBuilder() - .setTypes(ImmutableList.of()) + .setTypes(ImmutableList.of()) .build().toJsonMap())); Map response = action.handleJsonRequest(ImmutableMap.of( "op", "update", diff --git a/javatests/google/registry/ui/server/registrar/RegistrarPaymentSetupActionTest.java b/javatests/google/registry/ui/server/registrar/RegistrarPaymentSetupActionTest.java index eff3fdc52..aad2ec8f0 100644 --- a/javatests/google/registry/ui/server/registrar/RegistrarPaymentSetupActionTest.java +++ b/javatests/google/registry/ui/server/registrar/RegistrarPaymentSetupActionTest.java @@ -82,7 +82,7 @@ public class RegistrarPaymentSetupActionTest { CurrencyUnit.JPY, "torment"); String blanketsOfSadness = "our hearts are beating, but no one is breathing"; when(clientTokenGateway.generate()).thenReturn(blanketsOfSadness); - assertThat(action.handleJsonRequest(ImmutableMap.of())) + assertThat(action.handleJsonRequest(ImmutableMap.of())) .containsExactly( "status", "SUCCESS", "message", "Success", @@ -113,7 +113,7 @@ public class RegistrarPaymentSetupActionTest { when(sessionUtils.getRegistrarForAuthResult( any(HttpServletRequest.class), any(AuthResult.class))) .thenReturn(registrar); - assertThat(action.handleJsonRequest(ImmutableMap.of())) + assertThat(action.handleJsonRequest(ImmutableMap.of())) .containsExactly( "status", "ERROR", "message", "not-using-cc-billing", diff --git a/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTest.java b/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTest.java index aacca9280..813c63b96 100644 --- a/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTest.java +++ b/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTest.java @@ -74,7 +74,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase any(HttpServletRequest.class), any(AuthResult.class))) .thenThrow(new ForbiddenException("Not authorized to access Registrar Console")); try { - action.handleJsonRequest(ImmutableMap.of()); + action.handleJsonRequest(ImmutableMap.of()); fail("expected ForbiddenException"); } catch (ForbiddenException ex) { assertNoTasksEnqueued("sheet"); @@ -86,7 +86,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase */ @Test public void testRead_authorized_returnsRegistrarJson() throws Exception { - Map response = action.handleJsonRequest(ImmutableMap.of()); + Map response = action.handleJsonRequest(ImmutableMap.of()); assertThat(response).containsEntry("status", "SUCCESS"); assertThat(response).containsEntry("results", asList(loadRegistrar(CLIENT_ID).toJsonMap())); } diff --git a/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTestCase.java b/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTestCase.java index fb028fc5a..24046a13d 100644 --- a/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTestCase.java +++ b/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTestCase.java @@ -92,7 +92,7 @@ public class RegistrarSettingsActionTestCase { action.sessionUtils = sessionUtils; action.authResult = AuthResult.create(AuthLevel.USER, UserAuthInfo.create(user, false)); action.jsonActionRunner = new JsonActionRunner( - ImmutableMap.of(), new JsonResponse(new ResponseImpl(rsp))); + ImmutableMap.of(), new JsonResponse(new ResponseImpl(rsp))); action.registrarChangesNotificationEmailAddresses = ImmutableList.of( "notification@test.example", "notification2@test.example"); action.sendEmailUtils = diff --git a/javatests/google/registry/util/DateTimeUtilsTest.java b/javatests/google/registry/util/DateTimeUtilsTest.java index 57b4de12e..e02bff6e2 100644 --- a/javatests/google/registry/util/DateTimeUtilsTest.java +++ b/javatests/google/registry/util/DateTimeUtilsTest.java @@ -77,12 +77,12 @@ public class DateTimeUtilsTest { @Test public void testFailure_earliestOfEmpty() { thrown.expect(IllegalArgumentException.class); - earliestOf(ImmutableList.of()); + earliestOf(ImmutableList.of()); } @Test public void testFailure_latestOfEmpty() { thrown.expect(IllegalArgumentException.class); - earliestOf(ImmutableList.of()); + earliestOf(ImmutableList.of()); } } diff --git a/javatests/google/registry/util/RequestStatusCheckerImplTest.java b/javatests/google/registry/util/RequestStatusCheckerImplTest.java index 37ce49556..66de1e098 100644 --- a/javatests/google/registry/util/RequestStatusCheckerImplTest.java +++ b/javatests/google/registry/util/RequestStatusCheckerImplTest.java @@ -81,7 +81,7 @@ public final class RequestStatusCheckerImplTest { // it's a request that has just started running recently. @Test public void testIsRunning_unrecognized() { when(RequestStatusCheckerImpl.logService.fetch(expectedLogQuery("12345678"))) - .thenReturn(ImmutableList.of()); + .thenReturn(ImmutableList.of()); assertThat(requestStatusChecker.isRunning("12345678")).isTrue(); assertAboutLogs() .that(logHandler) diff --git a/javatests/google/registry/util/TeeOutputStreamTest.java b/javatests/google/registry/util/TeeOutputStreamTest.java index 84bb6dac9..74c7154ed 100644 --- a/javatests/google/registry/util/TeeOutputStreamTest.java +++ b/javatests/google/registry/util/TeeOutputStreamTest.java @@ -61,7 +61,7 @@ public class TeeOutputStreamTest { @SuppressWarnings("resource") public void testConstructor_failsWithEmptyIterable() { thrown.expect(IllegalArgumentException.class); - new TeeOutputStream(ImmutableSet.of()); + new TeeOutputStream(ImmutableSet.of()); } @Test diff --git a/javatests/google/registry/util/TypeUtilsTest.java b/javatests/google/registry/util/TypeUtilsTest.java index 073e73094..fc3abf445 100644 --- a/javatests/google/registry/util/TypeUtilsTest.java +++ b/javatests/google/registry/util/TypeUtilsTest.java @@ -34,20 +34,20 @@ public class TypeUtilsTest { @Test public void test_getClassFromString_validClass() { Class clazz = - TypeUtils.getClassFromString("java.util.ArrayList", Serializable.class); + TypeUtils.getClassFromString("java.util.ArrayList", Serializable.class); assertThat(clazz).isEqualTo(ArrayList.class); } @Test public void test_getClassFromString_notAssignableFrom() { thrown.expect(IllegalArgumentException.class, "ArrayList does not implement/extend Integer"); - TypeUtils.getClassFromString("java.util.ArrayList", Integer.class); + TypeUtils.getClassFromString("java.util.ArrayList", Integer.class); } @Test public void test_getClassFromString_unknownClass() { thrown.expect( IllegalArgumentException.class, "Failed to load class com.fake.company.nonexistent.Class"); - TypeUtils.getClassFromString("com.fake.company.nonexistent.Class", Object.class); + TypeUtils.getClassFromString("com.fake.company.nonexistent.Class", Object.class); } } diff --git a/javatests/google/registry/xml/XmlTestUtils.java b/javatests/google/registry/xml/XmlTestUtils.java index 0df2b27e2..f677d5d9c 100644 --- a/javatests/google/registry/xml/XmlTestUtils.java +++ b/javatests/google/registry/xml/XmlTestUtils.java @@ -261,7 +261,7 @@ public class XmlTestUtils { XML.toJSONObject(xml), null, ImmutableSet.copyOf(ignoredPaths), - ImmutableMap.of()).getValue(); + ImmutableMap.of()).getValue(); } }