Skip to content

Commit c198c13

Browse files
committed
Fixed AbstractConfiguration to use Strings.isBlank per Code Review (apache#3431)
+ moved changelog file to .2.x.x
1 parent cf060d4 commit c198c13

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
import org.apache.logging.log4j.status.StatusLogger;
7979
import org.apache.logging.log4j.util.LoaderUtil;
8080
import org.apache.logging.log4j.util.PropertiesUtil;
81+
import org.apache.logging.log4j.util.Strings;
8182

8283
/**
8384
* The base Configuration. Many configuration implementations will extend this class.
@@ -775,7 +776,7 @@ public static Level getDefaultLevel() {
775776

776777
protected void setToDefault() {
777778
// LOG4J2-3431 don't set a default name if one has already been set
778-
if (this.getName() == null || this.getName().trim().isEmpty()) {
779+
if (Strings.isBlank(getName())) {
779780
// LOG4J2-1176 facilitate memory leak investigation
780781
setName(DefaultConfiguration.DEFAULT_NAME + "@" + Integer.toHexString(hashCode()));
781782
}

0 commit comments

Comments
 (0)