mirror of
https://github.com/google/nomulus.git
synced 2025-07-02 17:23:32 +02:00
Remove unnecessary generic type arguments
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=175155365
This commit is contained in:
parent
8dcc2d6833
commit
2aa897e698
140 changed files with 355 additions and 465 deletions
|
@ -129,7 +129,7 @@ class AppEngineConnection implements Connection {
|
|||
public Map<String, Object> sendJson(String endpoint, Map<String, ?> object) throws IOException {
|
||||
String response = send(
|
||||
endpoint,
|
||||
ImmutableMap.<String, Object>of(),
|
||||
ImmutableMap.of(),
|
||||
JSON_UTF_8,
|
||||
JSONValue.toJSONString(object).getBytes(UTF_8));
|
||||
return (Map<String, Object>) JSONValue.parse(response.substring(JSON_SAFETY_PREFIX.length()));
|
||||
|
|
|
@ -109,6 +109,6 @@ class CreateTldCommand extends CreateOrUpdateTldCommand {
|
|||
Optional<Map.Entry<DateTime, TldState>> getTldStateTransitionToAdd() {
|
||||
return initialTldState != null
|
||||
? Optional.of(Maps.immutableEntry(START_OF_TIME, initialTldState))
|
||||
: Optional.<Map.Entry<DateTime, TldState>>empty();
|
||||
: Optional.empty();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ final class GenerateAuctionDataCommand implements RemoteApiCommand {
|
|||
Optional<ContactAddress> address =
|
||||
Optional.ofNullable(postalInfo.isPresent() ? postalInfo.get().getAddress() : null);
|
||||
List<String> street =
|
||||
address.isPresent() ? address.get().getStreet() : ImmutableList.<String>of();
|
||||
address.isPresent() ? address.get().getStreet() : ImmutableList.of();
|
||||
Optional<ContactPhoneNumber> 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<String> street =
|
||||
address.isPresent() ? address.get().getStreet() : ImmutableList.<String>of();
|
||||
address.isPresent() ? address.get().getStreet() : ImmutableList.of();
|
||||
|
||||
// Each line containing the registrar of an auction participant has the following format:
|
||||
//
|
||||
|
|
|
@ -99,7 +99,7 @@ final class GetSchemaTreeCommand implements Command {
|
|||
// Build up the superclass to subclass mapping.
|
||||
superclassToSubclasses = Multimaps.invertFrom(
|
||||
Multimaps.forMap(subclassToSuperclass),
|
||||
TreeMultimap.<Class<?>, Class<?>>create(arbitrary(), new PrintableNameOrdering()));
|
||||
TreeMultimap.create(arbitrary(), new PrintableNameOrdering()));
|
||||
printTree(Object.class, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,6 @@ final class ListDomainsCommand extends ListObjectsCommand {
|
|||
ImmutableMap<String, Object> getParameterMap() {
|
||||
String tldsParam = Joiner.on(',').join(tlds);
|
||||
checkArgument(tldsParam.length() < 1024, "Total length of TLDs is too long for URL parameter");
|
||||
return ImmutableMap.<String, Object>of("tlds", tldsParam);
|
||||
return ImmutableMap.of("tlds", tldsParam);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ enum RegistryToolEnvironment {
|
|||
}
|
||||
|
||||
private RegistryToolEnvironment(RegistryEnvironment actualEnvironment) {
|
||||
this(actualEnvironment, ImmutableMap.<String, String>of());
|
||||
this(actualEnvironment, ImmutableMap.of());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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<List<String>> registrars = new ArrayList<>();
|
||||
registrars.add(ImmutableList.<String>of(
|
||||
registrars.add(ImmutableList.of(
|
||||
registrar + "-1", passwordGenerator.createString(PASSWORD_LENGTH),
|
||||
registrar + "-sunrise"));
|
||||
registrars.add(ImmutableList.<String>of(
|
||||
registrars.add(ImmutableList.of(
|
||||
registrar + "-2", passwordGenerator.createString(PASSWORD_LENGTH),
|
||||
registrar + "-landrush"));
|
||||
registrars.add(ImmutableList.<String>of(
|
||||
registrars.add(ImmutableList.of(
|
||||
registrar + "-3", passwordGenerator.createString(PASSWORD_LENGTH),
|
||||
registrar + "-ga"));
|
||||
registrars.add(ImmutableList.<String>of(
|
||||
registrars.add(ImmutableList.of(
|
||||
registrar + "-4", passwordGenerator.createString(PASSWORD_LENGTH),
|
||||
registrar + "-ga"));
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ class UpdateTldCommand extends CreateOrUpdateTldCommand {
|
|||
Optional<Map.Entry<DateTime, TldState>> getTldStateTransitionToAdd() {
|
||||
return setCurrentTldState != null
|
||||
? Optional.of(Maps.immutableEntry(DateTime.now(DateTimeZone.UTC), setCurrentTldState))
|
||||
: Optional.<Map.Entry<DateTime, TldState>>empty();
|
||||
: Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,6 @@ public abstract class EnumParameter<T extends Enum<T>> extends ParameterConverte
|
|||
|
||||
@Override
|
||||
public T convert(String value) {
|
||||
return Enum.<T>valueOf(new TypeInstantiator<T>(getClass()){}.getExactType(), value);
|
||||
return Enum.valueOf(new TypeInstantiator<T>(getClass()){}.getExactType(), value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.<String, Object>of(
|
||||
return ImmutableMap.of(
|
||||
"jobPath", createJobPath(jobId),
|
||||
"filenames", filenames);
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ public abstract class ListObjectsAction<T extends ImmutableObject> implements Ru
|
|||
if (isHeaderRowInUse(data)) {
|
||||
// Add a row of headers (column names mapping to themselves).
|
||||
Map<String, String> headerRow =
|
||||
Maps.asMap(data.columnKeySet(), Functions.<String>identity());
|
||||
Maps.asMap(data.columnKeySet(), Functions.identity());
|
||||
lines.add(rowFormatter.apply(headerRow));
|
||||
|
||||
// Add a row of separator lines (column names mapping to '-' * column width).
|
||||
|
|
|
@ -58,8 +58,8 @@ public class ResaveAllHistoryEntriesAction implements Runnable {
|
|||
.runMapOnly(
|
||||
new ResaveAllHistoryEntriesActionMapper(),
|
||||
ImmutableList.of(EppResourceInputs.createChildEntityInput(
|
||||
ImmutableSet.<Class<? extends EppResource>>of(EppResource.class),
|
||||
ImmutableSet.<Class<? extends HistoryEntry>>of(HistoryEntry.class))))));
|
||||
ImmutableSet.of(EppResource.class),
|
||||
ImmutableSet.of(HistoryEntry.class))))));
|
||||
}
|
||||
|
||||
/** Mapper to re-save all HistoryEntry entities. */
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ToolsServerModule {
|
|||
@Parameter("fullFieldNames")
|
||||
static Optional<Boolean> provideFullFieldNames(HttpServletRequest req) {
|
||||
String s = emptyToNull(req.getParameter(ListObjectsAction.FULL_FIELD_NAMES_PARAM));
|
||||
return (s == null) ? Optional.<Boolean>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<Boolean> providePrintHeaderRow(HttpServletRequest req) {
|
||||
String s = emptyToNull(req.getParameter(ListObjectsAction.PRINT_HEADER_ROW_PARAM));
|
||||
return (s == null) ? Optional.<Boolean>empty() : Optional.of(Boolean.parseBoolean(s));
|
||||
return (s == null) ? Optional.empty() : Optional.of(Boolean.parseBoolean(s));
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
@ -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.<HistoryEntry.Type>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.<Predicate<EppInput>>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> eppInput =
|
||||
(xmlBytes == null)
|
||||
? Optional.<EppInput>empty()
|
||||
? Optional.empty()
|
||||
: Optional.of(unmarshal(EppInput.class, xmlBytes));
|
||||
if (!statCounts.addAll(
|
||||
EnumSet.allOf(StatType.class)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue