mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 19:20:44 +02:00
Remove unnecessary if statements in CloudDnsWriter (#2071)
The condition they are guarding against cannot possibly occur.
This commit is contained in:
parent
fe19f0fe78
commit
8d22c2a8d8
1 changed files with 14 additions and 18 deletions
|
@ -144,15 +144,13 @@ public class CloudDnsWriter extends BaseDnsWriter {
|
||||||
dsRrData.add(ds.toRrData());
|
dsRrData.add(ds.toRrData());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dsRrData.isEmpty()) {
|
domainRecords.add(
|
||||||
domainRecords.add(
|
new ResourceRecordSet()
|
||||||
new ResourceRecordSet()
|
.setName(absoluteDomainName)
|
||||||
.setName(absoluteDomainName)
|
.setTtl((int) tld.getDnsDsTtl().orElse(defaultDsTtl).getStandardSeconds())
|
||||||
.setTtl((int) tld.getDnsDsTtl().orElse(defaultDsTtl).getStandardSeconds())
|
.setType("DS")
|
||||||
.setType("DS")
|
.setKind("dns#resourceRecordSet")
|
||||||
.setKind("dns#resourceRecordSet")
|
.setRrdatas(ImmutableList.copyOf(dsRrData)));
|
||||||
.setRrdatas(ImmutableList.copyOf(dsRrData)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct NS records (if any).
|
// Construct NS records (if any).
|
||||||
|
@ -169,15 +167,13 @@ public class CloudDnsWriter extends BaseDnsWriter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nsRrData.isEmpty()) {
|
domainRecords.add(
|
||||||
domainRecords.add(
|
new ResourceRecordSet()
|
||||||
new ResourceRecordSet()
|
.setName(absoluteDomainName)
|
||||||
.setName(absoluteDomainName)
|
.setTtl((int) tld.getDnsNsTtl().orElse(defaultNsTtl).getStandardSeconds())
|
||||||
.setTtl((int) tld.getDnsNsTtl().orElse(defaultNsTtl).getStandardSeconds())
|
.setType("NS")
|
||||||
.setType("NS")
|
.setKind("dns#resourceRecordSet")
|
||||||
.setKind("dns#resourceRecordSet")
|
.setRrdatas(ImmutableList.copyOf(nsRrData)));
|
||||||
.setRrdatas(ImmutableList.copyOf(nsRrData)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
desiredRecords.put(absoluteDomainName, domainRecords.build());
|
desiredRecords.put(absoluteDomainName, domainRecords.build());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue