You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In RegexFilter.Builder (2.24.1) the PluginAttribute for useRawMsg is a Boolean default null.
@PluginFactory
public static RegexFilter createFilter(
// @formatter:off
@PluginAttribute("regex") final String regex,
@PluginElement("PatternFlags") final String[] patternFlags,
@PluginAttribute("useRawMsg") final Boolean useRawMsg,
@PluginAttribute("onMatch") final Result match,
@PluginAttribute("onMismatch") final Result mismatch)
// @formatter:on
throws IllegalArgumentException, IllegalAccessException {
if (regex == null) {
LOGGER.error("A regular expression must be provided for RegexFilter");
return null;
}
return new RegexFilter(useRawMsg, Pattern.compile(regex, toPatternFlags(patternFlags)), match, mismatch);
}
The RegexFilter constructor expects a boolean primitive.
private RegexFilter(final boolean raw, final Pattern pattern, final Result onMatch, final Result onMismatch) {
super(onMatch, onMismatch);
this.pattern = pattern;
this.useRawMessage = raw;
}
I believe, if the useRawMsg attribute is not set (undefined/null), auto-boxing from Boolean to boolean will cause/throw a NPE which is not caught and the builder will not return null as it should?
Also, the 'regex' attribute should probably be defined as @required for the isValid() builder-functionality to work correctly.
The text was updated successfully, but these errors were encountered:
In RegexFilter.Builder (2.24.1) the PluginAttribute for
useRawMsg
is aBoolean
defaultnull
.The
RegexFilter
constructor expects a boolean primitive.I believe, if the
useRawMsg
attribute is not set (undefined/null), auto-boxing fromBoolean
toboolean
will cause/throw a NPE which is not caught and the builder will not returnnull
as it should?Also, the 'regex' attribute should probably be defined as @required for the
isValid()
builder-functionality to work correctly.The text was updated successfully, but these errors were encountered: