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

ConfigRecorder: fix value changed check with null build-time values #38177

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

import org.eclipse.microprofile.config.ConfigProvider;
Expand Down Expand Up @@ -42,7 +43,8 @@ public void handleConfigChange(Map<String, ConfigValue> buildTimeRuntimeValues)
for (Map.Entry<String, ConfigValue> entry : buildTimeRuntimeValues.entrySet()) {
ConfigValue currentValue = config.getConfigValue(entry.getKey());
// Check for changes. Also, we only have a change if the source ordinal is higher
if (currentValue.getValue() != null && !entry.getValue().getValue().equals(currentValue.getValue())
// The config value can be null (for ex. if the property uses environment variables not available at build time)
if (currentValue.getValue() != null && !Objects.equals(entry.getValue().getValue(), currentValue.getValue())
&& entry.getValue().getSourceOrdinal() < currentValue.getSourceOrdinal()) {
mismatches.add(
" - " + entry.getKey() + " is set to '" + currentValue.getValue()
Expand Down
Loading