frankgh commented on code in PR #227: URL: https://github.com/apache/cassandra-sidecar/pull/227#discussion_r2157420031
########## server-common/src/main/java/org/apache/cassandra/sidecar/common/server/dns/DnsResolver.java: ########## @@ -26,29 +26,17 @@ */ public interface DnsResolver { - DnsResolver DEFAULT = new DnsResolver() - { - @Override - public String resolve(String hostname) throws UnknownHostException - { - return InetAddress.getByName(hostname).getHostAddress(); - } - - @Override - public String reverseResolve(String address) throws UnknownHostException - { - return InetAddress.getByName(address).getHostName(); - } - }; - /** * Resolves the IP address of the hostname * * @param hostname the hostname to resolve * @return IP address * @throws UnknownHostException when the host is not known */ - String resolve(String hostname) throws UnknownHostException; + default String resolve(String hostname) throws UnknownHostException + { + return InetAddress.getByName(hostname).getHostAddress(); + } Review Comment: I would preserve this interface and not add a default, but instead implement `resolve` in the `DnsResolverEnum` ```suggestion String resolve(String hostname) throws UnknownHostException; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org