File tree 2 files changed +7
-8
lines changed
log4j-core/src/main/java/org/apache/logging/log4j/core/filter
log4j-core-test/src/test/java/org/apache/logging/log4j/core/config
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 {
293
293
private void runTest (final LoggerContextRule rule , final Statement statement ) {
294
294
try {
295
295
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 ();
301
300
} catch (final Throwable e ) {
302
301
Throwables .rethrow (e );
303
302
}
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ private RegexFilter(final Builder builder) {
66
66
67
67
super (builder );
68
68
69
- if (Strings .isNotBlank (builder .regex )) {
69
+ if (Strings .isBlank (builder .regex )) {
70
70
throw new IllegalArgumentException ("The 'regex' attribute must not be null or empty." );
71
71
}
72
72
@@ -317,8 +317,8 @@ public Builder setUseRawMsg(final boolean useRawMsg) {
317
317
public @ Nullable RegexFilter build () {
318
318
319
319
// 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 ." );
322
322
return null ;
323
323
}
324
324
You can’t perform that action at this time.
0 commit comments