diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/util/configuration/Configuration.java b/sdk/core/azure-core/src/main/java/com/azure/core/util/configuration/Configuration.java index ab68188df2435..f4f4365af3c01 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/util/configuration/Configuration.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/util/configuration/Configuration.java @@ -220,13 +220,19 @@ private T convertOrDefault(String value, T defaultValue) { */ private boolean loadFrom(String name, Function loader, String logMessage) { String value = loader.apply(name); - if (!ImplUtils.isNullOrEmpty(value) && !value.equals(configurations.get(name))) { + + if (value == null) { + // Nothing was loaded + return false; + } else if (value.equals(configurations.get(name))) { + // Value loaded is the same, no need to log anything. + return true; + } else { + // Value changed, log it! configurations.put(name, value); logger.info(logMessage, name, value); return true; } - - return false; } /*