Skip to content

Commit f0bd878

Browse files
committed
Discard blank keys in PropertiesUtil
1 parent e8a5053 commit f0bd878

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ private synchronized void reload() {
536536
final Set<String> keys = new HashSet<>();
537537
sources.stream().map(PropertySource::getPropertyNames).forEach(keys::addAll);
538538
// 2. Fills the property caches. Sources with higher priority values don't override the previous ones.
539-
keys.stream().filter(Objects::nonNull).forEach(key -> {
539+
keys.stream().filter(Strings::isNotBlank).forEach(key -> {
540540
final List<CharSequence> tokens = PropertySource.Util.tokenize(key);
541541
final boolean hasTokens = !tokens.isEmpty();
542542
sources.forEach(source -> {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="https://logging.apache.org/xml/ns"
4+
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
5+
type="fixed">
6+
<issue id="2414" link="https://github.com/apache/logging-log4j2/issues/2414"/>
7+
<description format="asciidoc">Discard blank keys in `PropertiesUtil`</description>
8+
</entry>

0 commit comments

Comments
 (0)