ppkarwasz commented on code in PR #3265:
URL: https://github.com/apache/logging-log4j2/pull/3265#discussion_r1868413348


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java:
##########
@@ -148,7 +148,8 @@ public static RegexFilter createFilter(
             LOGGER.error("A regular expression must be provided for 
RegexFilter");
             return null;
         }
-        return new RegexFilter(useRawMsg, Pattern.compile(regex, 
toPatternFlags(patternFlags)), match, mismatch);
+        return new RegexFilter(
+                useRawMsg != null && useRawMsg, Pattern.compile(regex, 
toPatternFlags(patternFlags)), match, mismatch);

Review Comment:
   _Nit_: Maybe comparing `useRawMsg` to `Boolean.TRUE` might be simpler to 
read:
   ```suggestion
           return new RegexFilter(
                   Boolean.TRUE.equals(useRawMsg), Pattern.compile(regex, 
toPatternFlags(patternFlags)), match, mismatch);
   ```
   



-- 
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