From d5141269e66b5184e3d61eb9d4b8fb577a318b9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20Vav=C5=99=C3=ADk?= <mvavrik@redhat.com>
Date: Thu, 16 Nov 2023 00:06:57 +0100
Subject: [PATCH] Do not report unused deprecated runtime props with default
 val

---
 .../configuration/DeprecatedRuntimePropertiesRecorder.java  | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/core/runtime/src/main/java/io/quarkus/runtime/configuration/DeprecatedRuntimePropertiesRecorder.java b/core/runtime/src/main/java/io/quarkus/runtime/configuration/DeprecatedRuntimePropertiesRecorder.java
index 6ff8eb37c3f82..994e2fbd5c0dc 100644
--- a/core/runtime/src/main/java/io/quarkus/runtime/configuration/DeprecatedRuntimePropertiesRecorder.java
+++ b/core/runtime/src/main/java/io/quarkus/runtime/configuration/DeprecatedRuntimePropertiesRecorder.java
@@ -7,6 +7,7 @@
 import org.jboss.logging.Logger;
 
 import io.quarkus.runtime.annotations.Recorder;
+import io.smallrye.config.SmallRyeConfig;
 
 @Recorder
 public class DeprecatedRuntimePropertiesRecorder {
@@ -17,6 +18,11 @@ public void reportDeprecatedProperties(Set<String> deprecatedRuntimeProperties)
         Config config = ConfigProvider.getConfig();
         for (String property : config.getPropertyNames()) {
             if (deprecatedRuntimeProperties.contains(property)) {
+                String configSourceName = ((SmallRyeConfig) config).getConfigValue(property).getConfigSourceName();
+                // this condition can be removed when support of the @ConfigRoot annotation on classes is removed
+                if ("DefaultValuesConfigSource".equals(configSourceName)) {
+                    continue;
+                }
                 log.warnf("The '%s' config property is deprecated and should not be used anymore", property);
             }
         }