aawad6 commented on PR #1637:
URL: https://github.com/apache/logging-log4j2/pull/1637#issuecomment-1657121613
Noted, but I have a question regarding the following code block:
```
final String string = options[1]
.replaceAll(PatternParser.DISABLE_ANSI + "=(true|false)",
Strings.EMPTY)
.replaceAll(PatternParser.NO_CONSOLE_NO_ANSI +
"=(true|false)", Strings.EMPTY);
```
To avoid false positive warning messages, aren't we need to replace also the
commas with Strings.empty()?
for example: if `Options[1] = "noConsoleNoAnsi=false, disableAnsi=false,
LOGBACK"`, `string` will be `", , LOGBACK"`.
So I'd suggest to tweak the match pattern to looks like the following:
```
final String string = options[1]
.replaceAll(",?" + PatternParser.DISABLE_ANSI + "=(true|false),?",
Strings.EMPTY)
.replaceAll(",?" + PatternParser.NO_CONSOLE_NO_ANSI +
"=(true|false),?", Strings.EMPTY)
.trim();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]