Skip to content

Commit

Permalink
Do not report unused deprecated runtime props with default val
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Nov 15, 2023
1 parent c8c2e05 commit d514126
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 d514126

Please sign in to comment.