-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
Banner placeholders use default values too soon #34764
Banner placeholders use default values too soon #34764
Conversation
Thanks very much, @krzyk. |
propertySources.addLast(getTitleSource(sourceClass)); | ||
propertySources.addLast(getAnsiSource()); | ||
propertySources.addLast(getVersionSource(sourceClass)); | ||
return Collections.singletonList(new PropertySourcesPropertyResolver(propertySources)); |
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.
@wilkinsona Using singletonList
here changed the behavior of this method by making the returned list unmodifiable. Was this intentional?
For ResourceBanner subclasses, the change to use an unmodifiable list introduced a breaking change. We were able to work around it by creating a new list, adding items from this list, along with our own PropertyResolver(s).
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.
Good spot. I've fixed that in a707c5e
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.
Thanks, @edwardsre. I missed that when reviewing the changes.
Reorder methods and add a test to ensure that getPropertyResolvers can be mutated. See gh-34764
For #34713.
Fixed support for default value placeholders in banner.
I had to change the way they are handled - replace PropertyResolvers with PropertySources (and add a custom one/anonymous one for Environment).
Added two tests to make sure it really fixed the problem and didn't break in case of missing values.