-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix precedence for explicit sys prop and env var sources. #1002
Conversation
@tomas-langer Note the comments in the tests that say "Implicit sources always take precedence"; this strikes me as wrong/backwards, but I'm assuming fixing it would be a breaking change. |
String qualifiedName = "[" + name + "]"; | ||
for (ConfigSource source : sources) { | ||
if (source instanceof MapConfigSource | ||
&& source.description().contains(qualifiedName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we rely on a description, you should also update the place the description is created to make sure it is not changed.
I would prefer a more deterministic way of finding these sources out - maybe wrapping them in a specific class (EnvVarConfigSource
and SysPropConfigSource
or similar) and looking for these types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, agreed, this is a little fragile; I'm just about to lose internet for a couple of days, so will deal with this next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #977.