Skip to content

Refactor RegexFilter to use a plugin builder, restore configurable re…#4119

Open
ramanathan1504 wants to merge 2 commits into
apache:2.xfrom
ramanathan1504:fix-regex-pattern-flags
Open

Refactor RegexFilter to use a plugin builder, restore configurable re…#4119
ramanathan1504 wants to merge 2 commits into
apache:2.xfrom
ramanathan1504:fix-regex-pattern-flags

Conversation

@ramanathan1504
Copy link
Copy Markdown
Contributor

Fixes #3086

This pull request refactors the RegexFilter to use a plugin builder pattern, restores support for configuring regex patternFlags via a comma-separated attribute, and improves robustness around the useRawMsg option. It also adds tests and documentation for the new pattern flags feature.

RegexFilter Refactor and Feature Restoration:

  • Refactored RegexFilter to use a plugin builder (Builder class), simplifying construction and improving maintainability. The builder now uses a primitive boolean for useRawMsg to avoid null-unboxing issues. [1] [2]
  • Restored and improved support for configurable regex patternFlags via a comma-separated string attribute (e.g., patternFlags="CASE_INSENSITIVE"), replacing the previous, more cumbersome approach.

Testing Improvements:

  • Added a new test (testPatternFlagsFromConfiguration) in RegexFilterTest.java to verify that pattern flags are correctly loaded from configuration files.
  • Added a corresponding test configuration file RegexFilterPatternFlagsTest.xml to exercise the new pattern flags feature.

Documentation and Changelog:

  • Updated the manual to document the patternFlags attribute, listing all supported flag values and usage.
  • Added a changelog entry describing the refactor, restoration of patternFlags, and the builder improvements.

Other:

  • Bumped the OSGi version for the filter package to 2.26.0 to reflect the new feature.

…gex patternFlags via a CSV attribute, and improve handling of useRawMsg with a primitive boolean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Fix RegexFilter pattern flags

1 participant