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

@ -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.<Key<? extends TransferServerApproveEntity>>of(
.setServerApproveEntities(ImmutableSet.of(
Key.create(billingEvent)))
.setTransferRequestTime(DateTime.parse("1919-01-01T00:00:00Z"))
.setTransferStatus(TransferStatus.PENDING)

View file

@ -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.<Key<? extends TransferServerApproveEntity>>of(
.setServerApproveEntities(ImmutableSet.of(
Key.create(billingEvent)))
.setTransferRequestTime(DateTime.parse("1919-01-01T00:00:00Z"))
.setTransferStatus(TransferStatus.PENDING)

View file

@ -151,11 +151,11 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
action.pendingDepositChecker.rdeInterval = Duration.standardDays(1);
action.response = response;
action.transactionCooldown = Duration.ZERO;
action.directory = Optional.<String>empty();
action.modeStrings = ImmutableSet.<String>of();
action.tlds = ImmutableSet.<String>of();
action.watermarks = ImmutableSet.<DateTime>of();
action.revision = Optional.<Integer>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<RdeStagingAction> {
clock.setTo(DateTime.parse("2000-01-01TZ"));
action.manual = true;
action.directory = Optional.of("test/");
action.modeStrings = ImmutableSet.<String>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<RdeStagingAction> {
action.manual = true;
action.directory = Optional.of("test/");
action.modeStrings = ImmutableSet.of("full");
action.tlds = ImmutableSet.<String>of();
action.tlds = ImmutableSet.of();
action.watermarks = ImmutableSet.of(clock.nowUtc());
thrown.expect(BadRequestException.class);
action.run();

View file

@ -74,7 +74,7 @@ public class RdeContactImportActionTest extends MapreduceTestCase<RdeContactImpo
response,
IMPORT_BUCKET_NAME,
IMPORT_FILE_NAME,
Optional.<Integer>of(3));
Optional.of(3));
}
@Test

View file

@ -66,14 +66,14 @@ public class RdeContactInputTest {
@Test
public void testZeroContactsDefaultShards_returnsOneReader() throws Exception {
pushToGcs(DEPOSIT_0_CONTACT);
assertNumberOfReaders(Optional.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>empty(), 0, 0, 100);
assertReaderConfigurations(Optional.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>empty(), i, i * 200, 200);
assertReaderConfigurations(Optional.empty(), i, i * 200, 200);
}
}

View file

@ -95,7 +95,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
response,
IMPORT_BUCKET_NAME,
IMPORT_FILE_NAME,
Optional.<Integer>of(3));
Optional.of(3));
}
@Test

View file

@ -68,7 +68,7 @@ public class RdeHostImportActionTest extends MapreduceTestCase<RdeHostImportActi
@Before
public void before() throws Exception {
response = new FakeResponse();
mrRunner = new MapreduceRunner(Optional.<Integer>empty(), Optional.<Integer>empty());
mrRunner = new MapreduceRunner(Optional.empty(), Optional.empty());
action = new RdeHostImportAction(
mrRunner,
response,

View file

@ -83,14 +83,14 @@ public class RdeHostInputTest {
@Test
public void testZeroHostsDefaultShards_returnsOneReader() throws Exception {
pushToGcs(DEPOSIT_0_HOST);
assertNumberOfReaders(Optional.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>empty(), 0, 0, 100);
assertReaderConfigurations(Optional.<Integer>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.<Integer>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.<Integer>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.<Integer>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.<Integer>empty(), i, i * 200, 200);
assertReaderConfigurations(Optional.empty(), i, i * 200, 200);
}
}

View file

@ -84,7 +84,7 @@ public class RdeHostLinkActionTest extends MapreduceTestCase<RdeHostLinkAction>
inject.setStaticField(Ofy.class, "clock", clock);
createTld("test");
response = new FakeResponse();
mrRunner = new MapreduceRunner(Optional.<Integer>empty(), Optional.<Integer>empty());
mrRunner = new MapreduceRunner(Optional.empty(), Optional.empty());
action =
new RdeHostLinkAction(mrRunner, response, IMPORT_BUCKET_NAME, IMPORT_FILE_NAME, mapShards);
}