From 37fc129404923baed8f9ecb79a0860b06f19b4cf Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 7 Sep 2026 15:05:30 +0100 Subject: [PATCH] Fix swapped shared-buffer constants in Smile async parser `NonBlockingParserBase._expandSeenNames()` compared the current length against `DEFAULT_STRING_VALUE_BUFFER_LENGTH`, and `_expandSeenStringValues()` against `DEFAULT_NAME_BUFFER_LENGTH` -- each using the other one's constant. Both constants are currently 64, so the growth steps come out the same and there is no behavioural change today. But the pairing is wrong, and retuning either constant independently would silently break the growth sequence of the other table. This mirrors the same fix already applied to the blocking `SmileParser`. Co-Authored-By: Claude Opus 5 (1M context) --- .../jackson/dataformat/smile/async/NonBlockingParserBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smile/src/main/java/tools/jackson/dataformat/smile/async/NonBlockingParserBase.java b/smile/src/main/java/tools/jackson/dataformat/smile/async/NonBlockingParserBase.java index 9906e705f..4072f3704 100644 --- a/smile/src/main/java/tools/jackson/dataformat/smile/async/NonBlockingParserBase.java +++ b/smile/src/main/java/tools/jackson/dataformat/smile/async/NonBlockingParserBase.java @@ -518,7 +518,7 @@ protected final String[] _expandSeenNames(String[] oldShared) newShared = oldShared; _seenNameCount = 0; // could also clear, but let's not yet bother } else { - int newSize = (len == DEFAULT_STRING_VALUE_BUFFER_LENGTH) ? 256 : SmileConstants.MAX_SHARED_NAMES; + int newSize = (len == DEFAULT_NAME_BUFFER_LENGTH) ? 256 : SmileConstants.MAX_SHARED_NAMES; newShared = new String[newSize]; System.arraycopy(oldShared, 0, newShared, 0, oldShared.length); } @@ -589,7 +589,7 @@ private final void _expandSeenStringValues(String v) newShared = oldShared; _seenStringValueCount = 0; // could also clear, but let's not yet bother } else { - int newSize = (len == DEFAULT_NAME_BUFFER_LENGTH) ? 256 : SmileConstants.MAX_SHARED_STRING_VALUES; + int newSize = (len == DEFAULT_STRING_VALUE_BUFFER_LENGTH) ? 256 : SmileConstants.MAX_SHARED_STRING_VALUES; newShared = new String[newSize]; System.arraycopy(oldShared, 0, newShared, 0, oldShared.length); }