Skip to content

Commit

Permalink
Merge pull request quarkusio#37130 from michalvavrik/feature/do-not-l…
Browse files Browse the repository at this point in the history
…og-deprecated-runtime-properties-default-val

Do not report unused deprecated runtime props with default value as used
  • Loading branch information
zakkak authored Nov 16, 2023
2 parents 141acfd + d514126 commit 64d9892
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.jboss.logging.Logger;

import io.quarkus.runtime.annotations.Recorder;
import io.smallrye.config.SmallRyeConfig;

@Recorder
public class DeprecatedRuntimePropertiesRecorder {
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 64d9892

Please sign in to comment.