Skip to content
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 empty config values propagation #9506 #9750

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielkec
Copy link
Contributor

Fixes #9506

@danielkec danielkec added config messaging Reactive Messaging labels Feb 7, 2025
@danielkec danielkec self-assigned this Feb 7, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 7, 2025
Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, otherwise ok

@@ -45,7 +45,10 @@ AdHocConfigBuilder put(String key, String value) {
}

AdHocConfigBuilder putAll(Config configToPut) {
configuration.putAll(configToPut.detach().asMap().orElse(Map.of()));
for (var e : configToPut.detach().asMap().orElse(Map.of()).entrySet()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orElseGet(Map::of) is a better construct here, to avoid creating an empty map for each invocation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Counter: Map.of() returns a static constant and the orElse variant is easier to read.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config messaging Reactive Messaging OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.x: MpConfigSources.create does not handle empty values
3 participants