Skip to content

Commit 8c84355

Browse files
committed
fix: revert fix for #3816
The fix will be provided separately.
1 parent bb8b41f commit 8c84355

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/instant/InstantPatternLegacyFormatter.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ final class InstantPatternLegacyFormatter implements InstantPatternFormatter {
4646
private final BiConsumer<StringBuilder, Instant> formatter;
4747

4848
InstantPatternLegacyFormatter(final String pattern, final Locale locale, final TimeZone timeZone) {
49-
// Replaces 'n' used in legacy patterns with 'S' to obtain the right precision.
50-
// In legacy patterns, the precision of 'n' depends on the pattern length, but
51-
// in `DateTimeFormatter`, it is always nanoseconds.
52-
this.precision = new InstantPatternDynamicFormatter(pattern.replace('n', 'S'), locale, timeZone).getPrecision();
49+
this.precision = new InstantPatternDynamicFormatter(pattern, locale, timeZone).getPrecision();
5350
this.pattern = pattern;
5451
this.locale = locale;
5552
this.timeZone = timeZone;

0 commit comments

Comments
 (0)