Skip to content

Commit

Permalink
Guard logging calls and deprecate useDefaultJavaResolver() method.
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
  • Loading branch information
spericas committed Jan 24, 2024
1 parent ec228b9 commit 9f9e739
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ final class DefaultAddressLookupFinder {

private static final LazyValue<DnsAddressLookup> DEFAULT_IP_VERSION = LazyValue.create(() -> {
if (IPV4_PREFERRED.get() || !IPV6_PREFERRED.get()) {
LOGGER.log(Level.DEBUG, "Preferring IPv4 over IPv6 address resolution");
if (LOGGER.isLoggable(Level.DEBUG)) {
LOGGER.log(Level.DEBUG, "Preferring IPv4 over IPv6 address resolution");
}
return DnsAddressLookup.IPV4_PREFERRED;
}
LOGGER.log(Level.DEBUG, "Preferring IPv6 over IPv4 address resolution");
if (LOGGER.isLoggable(Level.DEBUG)) {
LOGGER.log(Level.DEBUG, "Preferring IPv6 over IPv4 address resolution");
}
return DnsAddressLookup.IPV6_PREFERRED;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ public interface DnsResolver {

/**
* Whether to use standard Java DNS resolver.
* If this method returns true, {@link #resolveAddress(String, io.helidon.webclient.api.DnsAddressLookup)} method is not invoked and
* no {@link DnsAddressLookup} preferences will be applied.
* If this method returns true, {@link #resolveAddress(String, io.helidon.webclient.api.DnsAddressLookup)}
* method is not invoked and no {@link DnsAddressLookup} preferences will be applied.
*
* @return use standard Java resolver
* @deprecated this method is no longer invoked and may be removed in the future
*/
@Deprecated(forRemoval = true, since = "4.0.4")
default boolean useDefaultJavaResolver() {
return false;
}
Expand Down

0 comments on commit 9f9e739

Please sign in to comment.