ppkarwasz commented on code in PR #1419:
URL: https://github.com/apache/logging-log4j2/pull/1419#discussion_r1162525131
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java:
##########
@@ -255,7 +261,7 @@ private static int[] nanoRange(final String pattern) {
* @return the length of the resulting formatted date and time strings
*/
public int getLength() {
- return pattern.length() - escapeCount;
+ return pattern.length() - escapeCount + extraTimeZoneFormatLength;
Review Comment:
This gives the exact length required in `Locale.ENGLISH`.
In other locales the length of short month names may be longer (e.g. it uses
3 Unicode characters beyond the BMP, so 6 chars). That's why I would use `2 *
getLength()` as buffer length.
--
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]