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 75fccd9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
* Copyright (c) 2022, 2024 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down 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 75fccd9

Please sign in to comment.