From b63642124f21a803b3b4fb98900b74872f5486c5 Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Wed, 26 Apr 2023 15:49:32 -0400 Subject: [PATCH] Make a few minor changes to make the linter happy (#2010) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change is [Reviewable](https://reviewable.io/reviews/google/nomulus/2010) --- .../dns/writer/clouddns/CloudDnsWriter.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java b/core/src/main/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java index 2f9b58908..b449359de 100644 --- a/core/src/main/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java +++ b/core/src/main/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java @@ -173,7 +173,7 @@ public class CloudDnsWriter extends BaseDnsWriter { domainRecords.add( new ResourceRecordSet() .setName(absoluteDomainName) - .setTtl((int) (tld.getDnsNsTtl().orElse(defaultNsTtl).getStandardSeconds())) + .setTtl((int) tld.getDnsNsTtl().orElse(defaultNsTtl).getStandardSeconds()) .setType("NS") .setKind("dns#resourceRecordSet") .setRrdatas(ImmutableList.copyOf(nsRrData))); @@ -279,11 +279,12 @@ public class CloudDnsWriter extends BaseDnsWriter { } /** Returns the glue records for in-bailiwick nameservers for the given domain+records. */ - private Stream filterGlueRecords(String domainName, Stream records) { + private static Stream filterGlueRecords( + String domainName, Stream records) { return records - .filter(record -> record.getType().equals("NS")) + .filter(record -> "NS".equals(record.getType())) .flatMap(record -> record.getRrdatas().stream()) - .filter(hostName -> hostName.endsWith("." + domainName) && !hostName.equals(domainName)); + .filter(hostName -> hostName.endsWith('.' + domainName) && !hostName.equals(domainName)); } /** Mutate the zone with the provided map of hostnames to desired DNS records. */ @@ -366,8 +367,8 @@ public class CloudDnsWriter extends BaseDnsWriter { *

This call should be used in conjunction with {@link #getResourceRecordsForDomains} in a * get-and-set retry loop. * - *

See {@link "https://cloud.google.com/dns/troubleshooting"} for a list of errors produced by - * the Google Cloud DNS API. + *

See {@link "Troubleshoot Cloud + * DNS"} for a list of errors produced by the Google Cloud DNS API. * * @throws ZoneStateException if the operation could not be completely successfully because the * records to delete do not exist, already exist or have been modified with different @@ -420,12 +421,12 @@ public class CloudDnsWriter extends BaseDnsWriter { * @param hostName the fully qualified hostname */ private static String getAbsoluteHostName(String hostName) { - return hostName.endsWith(".") ? hostName : hostName + "."; + return hostName.endsWith(".") ? hostName : hostName + '.'; } /** Zone state on Cloud DNS does not match the expected state. */ static class ZoneStateException extends RuntimeException { - public ZoneStateException(String reason) { + ZoneStateException(String reason) { super("Zone state on Cloud DNS does not match the expected state: " + reason); } }