[main] Add @Required and validation to StringMatchFilter text attribute (#3158 port)#4153
Open
vpelikh wants to merge 1 commit into
Open
[main] Add @Required and validation to StringMatchFilter text attribute (#3158 port)#4153vpelikh wants to merge 1 commit into
@Required and validation to StringMatchFilter text attribute (#3158 port)#4153vpelikh wants to merge 1 commit into
Conversation
089cd4e to
340a851
Compare
apache#3158) Signed-off-by: Vasily Pelikh <2010720+vpelikh@users.noreply.github.com>
340a851 to
fd62c22
Compare
@Required and validation to StringMatchFilter text attribute (#3158)@Required and validation to StringMatchFilter text attribute (#3158 port)
27 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports #3158 from the 2.x branch to 3.x.
Changes
@Requiredconstraint annotation on thetextbuilder field,Assert.requireNonEmptychecks in the constructor andsetMatchString()method, and a null/empty validation guard inbuild()returning the null filter sentinel when validation failstextrejection, nulltextrejection, missing attribute rejection, and post-stop guardlog4j2-stringmatchfilter-3153-ok.xmlandlog4j2-stringmatchfilter-3153-nok.xmlfixture configurationsWhy
An empty or missing
textattribute onStringMatchFilterpreviously resulted in either a crypticNullPointerExceptionat runtime (afterstop()) or silently matching the empty string against every event. This change provides clear validation at configuration time and graceful degradation.