ppkarwasz commented on a change in pull request #756:
URL: https://github.com/apache/logging-log4j2/pull/756#discussion_r808247913



##########
File path: 
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
##########
@@ -763,10 +762,7 @@ public Builder withFooter(final String footer) {
 
         @Override
         public PatternLayout build() {
-            // fall back to DefaultConfiguration
-            if (configuration == null) {
-                configuration = new DefaultConfiguration();
-            }
+            // should work with a null configuration

Review comment:
       This requires more explanations: the `PatternParser` does not use a 
configuration directly (or has null checks), but allows one to be injected into 
the `PatternConverter`s.
   
   Looking at the available `PatternConverter`s, the color converters, "enc", 
"equals*", "highlight", "maxLength", "replace", "style", "ex*" require a 
configuration to create a `PatternParser`.
   
   I didn't find any converters except `LiteralPatternConverter` that actually 
use `Configuration`. `LiteralPatternConverter` has appropriate null checks.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to