Skip to content

Commit

Permalink
Discard blank keys in PropertiesUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
vy committed Apr 23, 2024
1 parent e8a5053 commit f0bd878
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ private synchronized void reload() {
final Set<String> keys = new HashSet<>();
sources.stream().map(PropertySource::getPropertyNames).forEach(keys::addAll);
// 2. Fills the property caches. Sources with higher priority values don't override the previous ones.
keys.stream().filter(Objects::nonNull).forEach(key -> {
keys.stream().filter(Strings::isNotBlank).forEach(key -> {
final List<CharSequence> tokens = PropertySource.Util.tokenize(key);
final boolean hasTokens = !tokens.isEmpty();
sources.forEach(source -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="fixed">
<issue id="2414" link="https://github.com/apache/logging-log4j2/issues/2414"/>
<description format="asciidoc">Discard blank keys in `PropertiesUtil`</description>
</entry>

0 comments on commit f0bd878

Please sign in to comment.