This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch docs
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/docs by this push:
     new 15723bab35 docs: YAML parser buffer-underflow fix entry in 9.5.0 
release notes (TODO-88)
15723bab35 is described below

commit 15723bab353b8efe28a49832e820157427b240dd
Author: James Bognar <[email protected]>
AuthorDate: Tue May 26 16:45:28 2026 -0400

    docs: YAML parser buffer-underflow fix entry in 9.5.0 release notes 
(TODO-88)
    
    Co-authored-by: Cursor <[email protected]>
---
 pages/release-notes/9.5.0.md | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/pages/release-notes/9.5.0.md b/pages/release-notes/9.5.0.md
index 79354fe746..d72d68df95 100644
--- a/pages/release-notes/9.5.0.md
+++ b/pages/release-notes/9.5.0.md
@@ -1376,6 +1376,27 @@ YAML is included in `BasicUniversalConfig` by default, 
or can be used standalone
 
 See [YAML Basics](/docs/topics/YamlBasics) for full documentation.
 
+##### YAML parser buffer-underflow fix on large documents (TODO-88)
+
+- Fixed a latent `java.io.IOException: Buffer underflow.` thrown by 
`YamlParser` when round-tripping
+  larger YAML documents whose deeply-indented lines crossed the parser's 
internal 1024-char read
+  buffer. The shared `org.apache.juneau.parser.ParserReader` had a hard-coded 
10-char unread
+  lookback budget on the unmarked-refill path, but the YAML parser's indent 
handling
+  (`skipBlanksAndCountIndent` + `unreadSpaces(...)`, plus similar patterns in 
`parseBlockScalar`
+  and `isNullBlockValue`) routinely needs to unread an entire line's leading 
indent at once —
+  12-20+ chars for deeply-nested OpenAPI 3.1 documents. When the indent read 
happened to cross
+  the buffer boundary, only the last 10 of those chars survived the refill and 
the rest of the
+  unreads underflowed.
+- The fix widens that lookback budget from 10 to 256 chars (a new
+  `ParserReader.UNMARKED_LOOKBACK_CHARS` constant). 256 covers any realistic 
YAML indent depth
+  (128 levels at 2-space indent) while still leaving 768 chars per refill for 
forward-progress
+  reads. The change has zero API surface — every parser benefits via the 
shared seam — and full
+  utest suite (124k+ tests) runs at the same wall-clock as before.
+- Acceptance test: the full `BasicRestServlet` OpenAPI 3.1 document (six 
api-docs URLs + full
+  components.schemas set) now round-trips JSON → YAML → JSON cleanly. 
Previously
+  `OpenApiYamlRoundTrip_Test#c01` had to scope to a single 
`BasicOpenApiResource` mount via
+  `noInherit={"mixins"}` to dodge the underflow; that workaround has been 
removed.
+
 #### Direct Iterator/Iterable/Stream/Enumeration Serialization
 
 `Iterator`, `Iterable` (non-Collection), `Enumeration`, and 
`java.util.stream.Stream` types are now serialized directly as arrays by all 
serializers without requiring intermediate `List` materialization.

Reply via email to