vy commented on code in PR #1277:
URL: https://github.com/apache/logging-log4j2/pull/1277#discussion_r1108395816
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java:
##########
@@ -570,7 +570,15 @@ private void appendMap(final String prefix, final
Map<String, String> map, final
}
private String escapeSDParams(final String value) {
- return PARAM_VALUE_ESCAPE_PATTERN.matcher(value).replaceAll("\\\\$0");
+ StringBuilder output = new StringBuilder();
Review Comment:
@adwsingh, could you implement the following changes as well, please?
1. Remove the `PARAM_VALUE_ESCAPE_PATTERN` constant (reorganize the
`import`s)
2. Don't instantiate the `StringBuilder` until you encounter one of the
target characters. If nothing to be escaped, i.e., `output == null`, you can
simply return the `value` as is.
3. Please stick to the coding style followed in the rest of the file;
whitespace after `if`, decorate variables with `final` modifier wherever
possible, etc.
--
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]