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

@ -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.<String>of())
.setServiceAccountScopes(ImmutableSet.of())
.setServiceAccountUser(gSuiteAdminAccountEmailAddress)
.build();
}

View file

@ -70,7 +70,7 @@ public final class RequestParameters {
String stringParam = req.getParameter(name);
try {
return isNullOrEmpty(stringParam)
? Optional.<Integer>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<String> extractSetOfParameters(HttpServletRequest req, String name) {
String[] parameters = req.getParameterValues(name);
return parameters == null ? ImmutableSet.<String>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.<Boolean>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.<DateTime>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.<DateTime>of();
return ImmutableSet.of();
}
ImmutableSet.Builder<DateTime> datesBuilder = new ImmutableSet.Builder<>();
for (String stringParam : stringParams) {

View file

@ -30,7 +30,7 @@ public class AuthModule {
@Provides
ImmutableList<AuthenticationMechanism> provideApiAuthenticationMechanisms(
OAuthAuthenticationMechanism oauthAuthenticationMechanism) {
return ImmutableList.<AuthenticationMechanism>of(
return ImmutableList.of(
oauthAuthenticationMechanism);
}

View file

@ -37,7 +37,7 @@ public abstract class AuthResult {
}
public static AuthResult create(AuthLevel authLevel) {
return new AutoValue_AuthResult(authLevel, Optional.<UserAuthInfo>empty());
return new AutoValue_AuthResult(authLevel, Optional.empty());
}
public static AuthResult create(AuthLevel authLevel, @Nullable UserAuthInfo userAuthInfo) {

View file

@ -39,7 +39,7 @@ public abstract class UserAuthInfo {
public static UserAuthInfo create(
User user, boolean isUserAdmin) {
return new AutoValue_UserAuthInfo(user, isUserAdmin, Optional.<OAuthTokenInfo>empty());
return new AutoValue_UserAuthInfo(user, isUserAdmin, Optional.empty());
}
public static UserAuthInfo create(