mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 17:01:51 +02:00
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:
parent
79387f5d1e
commit
b65b855067
16 changed files with 29 additions and 32 deletions
|
@ -213,8 +213,8 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
.setParent(historyEntry)
|
||||
.build();
|
||||
|
||||
ImmutableSet<BillingEvent> billingEvents = ImmutableSet.of(
|
||||
createBillingEvent, renewBillingEvent);
|
||||
ImmutableSet.Builder<BillingEvent> expectedBillingEvents =
|
||||
new ImmutableSet.Builder<BillingEvent>().add(createBillingEvent).add(renewBillingEvent);
|
||||
|
||||
// If EAP is applied, a billing event for EAP should be present.
|
||||
if (!eapFee.isZero()) {
|
||||
|
@ -229,12 +229,9 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
.setFlags(billingFlags)
|
||||
.setParent(historyEntry)
|
||||
.build();
|
||||
billingEvents = ImmutableSet.<BillingEvent>builder()
|
||||
.addAll(billingEvents)
|
||||
.add(eapBillingEvent)
|
||||
.build();
|
||||
expectedBillingEvents.add(eapBillingEvent);
|
||||
}
|
||||
assertBillingEvents(billingEvents);
|
||||
assertBillingEvents(expectedBillingEvents.build());
|
||||
|
||||
assertGracePeriods(
|
||||
domain.getGracePeriods(),
|
||||
|
|
|
@ -64,7 +64,7 @@ public class EppResourceIndexTest extends EntityTestCase {
|
|||
*/
|
||||
private ImmutableList<EppResourceIndex> getEppResourceIndexObjects() {
|
||||
int numBuckets = RegistryEnvironment.get().config().getEppResourceIndexBucketCount();
|
||||
ImmutableList.Builder<EppResourceIndex> indexEntities = ImmutableList.builder();
|
||||
ImmutableList.Builder<EppResourceIndex> indexEntities = new ImmutableList.Builder<>();
|
||||
for (int i = 0; i < numBuckets; i++) {
|
||||
indexEntities.addAll(ofy().load()
|
||||
.type(EppResourceIndex.class)
|
||||
|
|
|
@ -78,7 +78,7 @@ public class RdapActionBaseTest {
|
|||
if (pathSearchString.equals("RuntimeException")) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
|
||||
ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>();
|
||||
builder.put("key", "value");
|
||||
RdapJsonFormatter.addTopLevelEntries(
|
||||
builder,
|
||||
|
|
|
@ -468,7 +468,7 @@ public class RdapJsonFormatterTest {
|
|||
|
||||
@Test
|
||||
public void testTopLevel() throws Exception {
|
||||
ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
|
||||
ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>();
|
||||
builder.put("key", "value");
|
||||
RdapJsonFormatter.addTopLevelEntries(
|
||||
builder,
|
||||
|
@ -481,7 +481,7 @@ public class RdapJsonFormatterTest {
|
|||
|
||||
@Test
|
||||
public void testTopLevel_withTermsOfService() throws Exception {
|
||||
ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
|
||||
ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>();
|
||||
builder.put("key", "value");
|
||||
RdapJsonFormatter.addTopLevelEntries(
|
||||
builder,
|
||||
|
@ -494,7 +494,7 @@ public class RdapJsonFormatterTest {
|
|||
|
||||
@Test
|
||||
public void testTopLevel_domain() throws Exception {
|
||||
ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
|
||||
ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>();
|
||||
builder.put("key", "value");
|
||||
RdapJsonFormatter.addTopLevelEntries(
|
||||
builder,
|
||||
|
@ -507,7 +507,7 @@ public class RdapJsonFormatterTest {
|
|||
|
||||
@Test
|
||||
public void testTopLevel_domainWithTermsOfService() throws Exception {
|
||||
ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
|
||||
ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>();
|
||||
builder.put("key", "value");
|
||||
RdapJsonFormatter.addTopLevelEntries(
|
||||
builder,
|
||||
|
|
|
@ -308,7 +308,7 @@ public class TaskQueueHelper {
|
|||
if (info.getTagAsBytes() != null) {
|
||||
this.tag = new String(info.getTagAsBytes(), UTF_8);
|
||||
}
|
||||
ImmutableMultimap.Builder<String, String> headerBuilder = ImmutableMultimap.builder();
|
||||
ImmutableMultimap.Builder<String, String> headerBuilder = new ImmutableMultimap.Builder<>();
|
||||
for (HeaderWrapper header : info.getHeaders()) {
|
||||
// Lowercase header name for comparison since HTTP
|
||||
// header names are case-insensitive.
|
||||
|
|
|
@ -79,7 +79,7 @@ public abstract class ListObjectsCommandTestCase<C extends ListObjectsCommand>
|
|||
Optional<Boolean> printHeaderRow,
|
||||
Optional<Boolean> fullFieldNames) throws Exception {
|
||||
|
||||
ImmutableMap.Builder<String, Object> params = ImmutableMap.<String, Object>builder();
|
||||
ImmutableMap.Builder<String, Object> params = new ImmutableMap.Builder<>();
|
||||
if (fields != null) {
|
||||
params.put(FIELDS_PARAM, fields);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue