Remove unnecessary generic type arguments

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175155365
This commit is contained in:
mcilwain 2017-11-09 07:33:40 -08:00 committed by jianglai
parent 8dcc2d6833
commit 2aa897e698
140 changed files with 355 additions and 465 deletions

View file

@ -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.<StatusValue>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.<FeeTransformResponseExtension>of()
? ImmutableList.of()
: ImmutableList.of(createFeeCreateResponse(feeCreate, feesAndCredits));
}

View file

@ -187,7 +187,7 @@ public final class DomainCheckFlow implements Flow {
}
return reservationTypes.isEmpty()
? Optional.<String>empty()
? Optional.empty()
: Optional.of(getTypeOfHighestSeverity(reservationTypes).getMessageForCheck());
}

View file

@ -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.<StatusValue>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.<BillingEvent.Flag>of())
: ImmutableSet.of())
.setParent(historyEntry)
.build();
}
@ -471,7 +470,7 @@ public class DomainCreateFlow implements TransactionalFlow {
private static ImmutableList<FeeTransformResponseExtension> createResponseExtensions(
FeeCreateCommandExtension feeCreate, FeesAndCredits feesAndCredits) {
return (feeCreate == null)
? ImmutableList.<FeeTransformResponseExtension>of()
? ImmutableList.of()
: ImmutableList.of(createFeeCreateResponse(feeCreate, feesAndCredits));
}

View file

@ -503,7 +503,7 @@ public class DomainFlowUtils {
: newAutorenewPollMessage(domain)
.setId(existingAutorenewKey.getId())
.setAutorenewEndTime(newEndTime)
.setParentKey(existingAutorenewKey.<HistoryEntry>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<DelegationSignerData> toAdd = (add == null)
? ImmutableSet.<DelegationSignerData>of()
? ImmutableSet.of()
: add.getDsData();
Set<DelegationSignerData> toRemove = (remove == null)
? ImmutableSet.<DelegationSignerData>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));

View file

@ -210,6 +210,6 @@ public final class DomainPricingLogic {
return Optional.of(token);
}
}
return Optional.<LrpTokenEntity>empty();
return Optional.empty();
}
}

View file

@ -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.<ImmutableObject>of(
ImmutableSet.of(
newDomain,
historyEntry,
explicitRenewEvent,
@ -264,7 +263,7 @@ public final class DomainRenewFlow implements TransactionalFlow {
private ImmutableList<FeeTransformResponseExtension> createResponseExtensions(
Money renewCost, FeeRenewCommandExtension feeRenew) {
return (feeRenew == null)
? ImmutableList.<FeeTransformResponseExtension>of()
? ImmutableList.of()
: ImmutableList.of(feeRenew.createResponseBuilder()
.setCurrency(renewCost.getCurrencyUnit())
.setFees(ImmutableList.of(Fee.create(renewCost.getAmount(), FeeType.RENEW)))

View file

@ -263,7 +263,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow {
private static ImmutableList<FeeTransformResponseExtension> createResponseExtensions(
Money restoreCost, Money renewCost, FeeUpdateCommandExtension feeUpdate) {
return (feeUpdate == null)
? ImmutableList.<FeeTransformResponseExtension>of()
? ImmutableList.of()
: ImmutableList.of(feeUpdate.createResponseBuilder()
.setCurrency(restoreCost.getCurrencyUnit())
.setFees(ImmutableList.of(

View file

@ -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.OneTime> billingEvent =
(transferData.getTransferPeriod().getValue() == 0)
? Optional.<BillingEvent.OneTime>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.<GracePeriod>of())
: ImmutableSet.of())
.build();
// Create a poll message for the gaining client.
PollMessage gainingClientPollMessage = createGainingTransferPollMessage(

View file

@ -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> feesAndCredits =
(period.getValue() == 0)
? Optional.<FeesAndCredits>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.<Money>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<FeeTransformResponseExtension> createResponseExtensions(
Optional<FeesAndCredits> feesAndCredits, FeeTransferCommandExtension feeTransfer) {
return (feeTransfer == null || !feesAndCredits.isPresent())
? ImmutableList.<FeeTransformResponseExtension>of()
? ImmutableList.of()
: ImmutableList.of(feeTransfer.createResponseBuilder()
.setFees(feesAndCredits.get().getFees())
.setCredits(feesAndCredits.get().getCredits())