Skip to content

Commit

Permalink
Merge branch '4.1.x' into 4.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjbaxter committed Jan 21, 2025
2 parents 10583b0 + d9a0bf9 commit 5853b05
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import org.apache.commons.logging.Log;
Expand Down Expand Up @@ -139,7 +140,7 @@ private Map<String, Object> changes(Map<String, Object> before, Map<String, Obje
if (!after.containsKey(key)) {
result.put(key, null);
}
else if (!equal(before.get(key), after.get(key))) {
else if (!Objects.equals(before.get(key), after.get(key))) {
result.put(key, after.get(key));
}
}
Expand All @@ -151,16 +152,6 @@ else if (!equal(before.get(key), after.get(key))) {
return result;
}

private boolean equal(Object one, Object two) {
if (one == null && two == null) {
return true;
}
if (one == null || two == null) {
return false;
}
return one.equals(two);
}

private Map<String, Object> extract(MutablePropertySources propertySources) {
Map<String, Object> result = new HashMap<>();
List<PropertySource<?>> sources = new ArrayList<>();
Expand Down

0 comments on commit 5853b05

Please sign in to comment.