mirror of
https://github.com/google/nomulus
synced 2026-01-09 23:47:49 +00:00
Enforce nullness consistency on EppResponse.set...() methods
The callsites were inconsistent between whether they were passing empty list or null, and many of the ones that were passing null were not correctly annotated with @Nullable. I'm now going with empty list throughout except for the final step where the actual field that will be transformed into XML is set, where it is coerced to null to avoid an empty element in the XML output. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=139340837
This commit is contained in:
@@ -221,7 +221,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
||||
DomainResource existingDomain, DateTime now) {
|
||||
FeeTransformResponseExtension.Builder feeResponseBuilder = getDeleteResponseBuilder();
|
||||
if (feeResponseBuilder == null) {
|
||||
return null;
|
||||
return ImmutableList.of();
|
||||
}
|
||||
ImmutableList.Builder<Credit> creditsBuilder = new ImmutableList.Builder<>();
|
||||
for (GracePeriod gracePeriod : existingDomain.getGracePeriods()) {
|
||||
@@ -234,7 +234,7 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
||||
}
|
||||
ImmutableList<Credit> credits = creditsBuilder.build();
|
||||
if (credits.isEmpty()) {
|
||||
return null;
|
||||
return ImmutableList.of();
|
||||
}
|
||||
return ImmutableList.of(feeResponseBuilder.setCredits(credits).build());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user