Always use the constructor to make Immutable Collection Builders

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135359669
This commit is contained in:
mcilwain 2016-10-06 08:09:47 -07:00 committed by Ben McIlwain
parent 79387f5d1e
commit b65b855067
16 changed files with 29 additions and 32 deletions

View file

@ -45,13 +45,13 @@ public final class GetLrpTokenCommand implements RemoteApiCommand {
names = {"-h", "--history"},
description = "Return expanded history entry (including domain application)")
private boolean includeHistory = false;
@Override
public void run() throws Exception {
checkArgument(
(tokenString == null) == (assignee != null),
"Exactly one of either token or assignee must be specified.");
ImmutableSet.Builder<LrpToken> tokensBuilder = ImmutableSet.builder();
ImmutableSet.Builder<LrpToken> tokensBuilder = new ImmutableSet.Builder<>();
if (tokenString != null) {
LrpToken token = ofy().load().key(Key.create(LrpToken.class, tokenString)).now();
if (token != null) {
@ -69,7 +69,7 @@ public final class GetLrpTokenCommand implements RemoteApiCommand {
System.out.println(
ofy().load().key(token.getRedemptionHistoryEntry()).now().toHydratedString());
}
}
}
} else {
System.out.println("Token not found.");
}