Open
Description
RegexReplacement#createRegexReplacement
Static builder method returns null
if the regex
attribute is null, but although it logs an error it does not return null
if the replacement
attribute is null
.
public static RegexReplacement createRegexReplacement(
@PluginAttribute("regex") final Pattern regex, @PluginAttribute("replacement") final String replacement) {
if (regex == null) {
LOGGER.error("A regular expression is required for replacement");
return null;
}
if (replacement == null) {
LOGGER.error("A replacement string is required to perform replacement");
}
// FIXME: should we use Matcher.quoteReplacement() here?
return new RegexReplacement(regex, replacement);
}
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
To triage
Milestone
Relationships
Development
No branches or pull requests
Activity
jaykataria1111 commentedon Jan 16, 2025
I can work on this @ppkarwasz feel free too assign this to me :)
Fixed handling of null 'replacement' parameter in RegexReplacement#cr…
JWT007 commentedon Feb 11, 2025
@ppkarwasz - another small PR - simple fix
@jaykataria1111 - sorry to steal this one from you :( - its been a month and I am trying to close out some of the tickets I created before the next release.
Moved changelog to .2.x.x per PR Code Review (apache#3215)
Fixed handling of null 'replacement' parameter in RegexReplacement#cr…
Moved changelog to .2.x.x per PR Code Review (apache#3215)