mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Don't allow null in BillingEvent.setFlags()
It's better that it always takes a non-null ImmutableSet, which may either be empty or contain elements. That way the ugliness of nullness is contained just to the entity class itself, and all other code that interacts with it can always be assured of having a real set to deal with. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=132066238
This commit is contained in:
parent
c06133435b
commit
07135f6190
3 changed files with 9 additions and 3 deletions
|
@ -157,7 +157,9 @@ public class DomainCreateFlow extends DomainCreateOrAllocateFlow {
|
|||
.setBillingTime(now.plus(isAnchorTenant()
|
||||
? registry.getAnchorTenantAddGracePeriodLength()
|
||||
: registry.getAddGracePeriodLength()))
|
||||
.setFlags(isAnchorTenant() ? ImmutableSet.of(BillingEvent.Flag.ANCHOR_TENANT) : null)
|
||||
.setFlags(isAnchorTenant()
|
||||
? ImmutableSet.of(BillingEvent.Flag.ANCHOR_TENANT)
|
||||
: ImmutableSet.<BillingEvent.Flag>of())
|
||||
.setParent(historyEntry)
|
||||
.build();
|
||||
ofy().save().entity(createEvent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue