File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
log4j-core-test/src/test/java/org/apache/logging/log4j/core/config
log4j-core/src/main/java/org/apache/logging/log4j/core/filter Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -293,11 +293,10 @@ public void evaluate() throws Throwable {
293293 private void runTest (final LoggerContextRule rule , final Statement statement ) {
294294 try {
295295 rule .apply (
296- statement ,
297- Description .createTestDescription (
298- getClass (),
299- Thread .currentThread ().getStackTrace ()[1 ].getMethodName ()))
300- .evaluate ();
296+ statement ,
297+ Description .createTestDescription (getClass (),
298+ Thread .currentThread ().getStackTrace ()[1 ].getMethodName ()))
299+ .evaluate ();
301300 } catch (final Throwable e ) {
302301 Throwables .rethrow (e );
303302 }
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ private RegexFilter(final Builder builder) {
6666
6767 super (builder );
6868
69- if (Strings .isNotBlank (builder .regex )) {
69+ if (Strings .isBlank (builder .regex )) {
7070 throw new IllegalArgumentException ("The 'regex' attribute must not be null or empty." );
7171 }
7272
@@ -317,8 +317,8 @@ public Builder setUseRawMsg(final boolean useRawMsg) {
317317 public @ Nullable RegexFilter build () {
318318
319319 // validate the "regex" attribute
320- if (this .regex == null ) {
321- LOGGER .error ("Unable to create RegexFilter: The 'regex' attribute must be provided ." );
320+ if (Strings . isEmpty ( this .regex ) ) {
321+ LOGGER .error ("Unable to create RegexFilter: The 'regex' attribute be set to a non-empty String ." );
322322 return null ;
323323 }
324324
You can’t perform that action at this time.
0 commit comments